From 7ab14c5ace7bce758dcf40c63f1eb4b44d915426 Mon Sep 17 00:00:00 2001 From: Philippe Mathieu-Daudé Date: Tue, 19 Sep 2017 09:30:53 -0300 Subject: hw/audio/wm8750: move WM8750 declarations from i2c/i2c.h to audio/wm8750.h while here use TYPE_WM8750 and declare a data_req_cb() typedef. Signed-off-by: Philippe Mathieu-Daudé Message-id: 20170919123053.32675-1-f4bug@amsat.org Signed-off-by: Gerd Hoffmann --- include/hw/audio/wm8750.h | 30 ++++++++++++++++++++++++++++++ include/hw/i2c/i2c.h | 9 --------- 2 files changed, 30 insertions(+), 9 deletions(-) create mode 100644 include/hw/audio/wm8750.h (limited to 'include') diff --git a/include/hw/audio/wm8750.h b/include/hw/audio/wm8750.h new file mode 100644 index 0000000000..84e7a119bb --- /dev/null +++ b/include/hw/audio/wm8750.h @@ -0,0 +1,30 @@ +/* + * This program is free software; you can redistribute it and/or modify it + * under the terms and conditions of the GNU General Public License, + * version 2 or later, as published by the Free Software Foundation. + * + * This program is distributed in the hope it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along with + * this program. If not, see . + */ +#ifndef HW_DAC_WM8750_H +#define HW_DAC_WM8750_H + +#include "hw/hw.h" + +#define TYPE_WM8750 "wm8750" + +typedef void data_req_cb(void *opaque, int free_out, int free_in); + +void wm8750_data_req_set(DeviceState *dev, data_req_cb *data_req, void *opaque); +void wm8750_dac_dat(void *opaque, uint32_t sample); +uint32_t wm8750_adc_dat(void *opaque); +void *wm8750_dac_buffer(void *opaque, int samples); +void wm8750_dac_commit(void *opaque); +void wm8750_set_bclk_in(void *opaque, int new_hz); + +#endif diff --git a/include/hw/i2c/i2c.h b/include/hw/i2c/i2c.h index 2ce611d4c8..24e95d0155 100644 --- a/include/hw/i2c/i2c.h +++ b/include/hw/i2c/i2c.h @@ -70,15 +70,6 @@ int i2c_recv(I2CBus *bus); DeviceState *i2c_create_slave(I2CBus *bus, const char *name, uint8_t addr); -/* wm8750.c */ -void wm8750_data_req_set(DeviceState *dev, - void (*data_req)(void *, int, int), void *opaque); -void wm8750_dac_dat(void *opaque, uint32_t sample); -uint32_t wm8750_adc_dat(void *opaque); -void *wm8750_dac_buffer(void *opaque, int samples); -void wm8750_dac_commit(void *opaque); -void wm8750_set_bclk_in(void *opaque, int new_hz); - /* lm832x.c */ void lm832x_key_event(DeviceState *dev, int key, int state); -- cgit v1.2.3-55-g7522