]> git.proxmox.com Git - mirror_qemu.git/blame - hw/audio/lm4549.h
hw/mips: Express dependencies of the r4k platform with Kconfig
[mirror_qemu.git] / hw / audio / lm4549.h
CommitLineData
d028d02d
MS
1/*
2 * LM4549 Audio Codec Interface
3 *
4 * Copyright (c) 2011
5 * Written by Mathieu Sonet - www.elasticsheep.com
6 *
4d8db4e4 7 * This code is licensed under the GPL.
d028d02d
MS
8 *
9 * *****************************************************************
10 */
11
12#ifndef HW_LM4549_H
13#define HW_LM4549_H
14
15#include "audio/audio.h"
16
17typedef void (*lm4549_callback)(void *opaque);
18
19#define LM4549_BUFFER_SIZE (512 * 2) /* 512 16-bit stereo samples */
20
21
22typedef struct {
23 QEMUSoundCard card;
24 SWVoiceOut *voice;
25 uint32_t voice_is_active;
26
27 uint16_t regfile[128];
28 lm4549_callback data_req_cb;
29 void *opaque;
30
31 uint16_t buffer[LM4549_BUFFER_SIZE];
32 uint32_t buffer_level;
33} lm4549_state;
34
35extern const VMStateDescription vmstate_lm4549_state;
36
37
38void lm4549_init(lm4549_state *s, lm4549_callback data_req, void *opaque);
a8170e5e
AK
39uint32_t lm4549_read(lm4549_state *s, hwaddr offset);
40void lm4549_write(lm4549_state *s, hwaddr offset, uint32_t value);
d028d02d
MS
41uint32_t lm4549_write_samples(lm4549_state *s, uint32_t left, uint32_t right);
42
175de524 43#endif /* HW_LM4549_H */