hw/misc/allwinner-h3-dramc: enforce 64-bit multiply when calculating row mirror address
[qemu/ar7.git] / hw / audio / lm4549.h
blobaba9bb5b077c48895ea344dfe8496df94987b603
1 /*
2 * LM4549 Audio Codec Interface
4 * Copyright (c) 2011
5 * Written by Mathieu Sonet - www.elasticsheep.com
7 * This code is licensed under the GPL.
9 * *****************************************************************
12 #ifndef HW_LM4549_H
13 #define HW_LM4549_H
15 #include "audio/audio.h"
16 #include "exec/hwaddr.h"
18 typedef void (*lm4549_callback)(void *opaque);
20 #define LM4549_BUFFER_SIZE (512 * 2) /* 512 16-bit stereo samples */
23 typedef struct {
24 QEMUSoundCard card;
25 SWVoiceOut *voice;
26 uint32_t voice_is_active;
28 uint16_t regfile[128];
29 lm4549_callback data_req_cb;
30 void *opaque;
32 uint16_t buffer[LM4549_BUFFER_SIZE];
33 uint32_t buffer_level;
34 } lm4549_state;
36 extern const VMStateDescription vmstate_lm4549_state;
39 void lm4549_init(lm4549_state *s, lm4549_callback data_req, void *opaque);
40 uint32_t lm4549_read(lm4549_state *s, hwaddr offset);
41 void lm4549_write(lm4549_state *s, hwaddr offset, uint32_t value);
42 uint32_t lm4549_write_samples(lm4549_state *s, uint32_t left, uint32_t right);
44 #endif /* HW_LM4549_H */