Skip to contentSkip to conversation

hw/wm8731: add WM8731 codec support

PATCH New Dante 1 participant 1 message Jan 18, 2013

lore
Share & tools
lore

Dante

author
#0 lore raw

PATCH 1/1 hw/wm8731: add WM8731 codec support

Wolfson WM8731 is a simple audio codec for embedded systems. It contains 2 input and 1 output ports:

** Input **
1. Linue-In
2. Microphone

** Output **
1. Headphone out

BTW it's based on hw/wm8750.c with 16bit I2S support by default.

---
 default-configs/arm-softmmu.mak |    1 +
 hw/Makefile.objs                |    1 +
 hw/i2c.h                        |    6 +
 hw/wm8731.c                     |  478 +++++++++++++++++++++++++++++++++++++++
 4 files changed, 486 insertions(+)
 create mode 100644 hw/wm8731.c
default-configs/arm-softmmu.mak +1 -0
index 2f1a5c9..c86d0f2 100644
@@ -10,6 +10,7 @@ CONFIG_SERIAL=y
 CONFIG_PTIMER=y
 CONFIG_SD=y
 CONFIG_MAX7310=y
+CONFIG_WM8731=y
 CONFIG_WM8750=y
 CONFIG_TWL92230=y
 CONFIG_TSC2005=y
hw/Makefile.objs +1 -0
index 74b07a7..21c9f6b 100644
@@ -165,6 +165,7 @@ common-obj-$(CONFIG_REALLY_VIRTFS) += 9pfs/
 common-obj-y += usb/
 common-obj-$(CONFIG_PTIMER) += ptimer.o
 common-obj-$(CONFIG_MAX7310) += max7310.o
+common-obj-$(CONFIG_WM8731) += wm8731.o
 common-obj-$(CONFIG_WM8750) += wm8750.o
 common-obj-$(CONFIG_TWL92230) += twl92230.o
 common-obj-$(CONFIG_TSC2005) += tsc2005.o
hw/i2c.h +6 -0
index 883b5c5..89d63cd 100644
@@ -64,6 +64,12 @@ int i2c_recv(i2c_bus *bus);
 
 DeviceState *i2c_create_slave(i2c_bus *bus, const char *name, uint8_t addr);
 
+/* wm8731.c */
+void wm8731_data_req_set(DeviceState *dev,
+                void (*data_req)(void *, int, int), void *opaque);
+void wm8731_dac_dat(void *opaque, uint32_t sample);
+uint32_t wm8731_adc_dat(void *opaque);
+
 /* wm8750.c */
 void wm8750_data_req_set(DeviceState *dev,
                 void (*data_req)(void *, int, int), void *opaque);
hw/wm8731.c new file +478 -0

478 lines not on this page · raw message

Signature · 13 lines
1.7.9.5


********************* Confidentiality Notice ************************
This electronic message and any attachments may contain
confidential and legally privileged information or
information which is otherwise protected from disclosure.
If you are not the intended recipient,please do not disclose
the contents, either in whole or in part, to anyone,and
immediately delete the message and any attachments from
your computer system and destroy all hard copies.
Thank you for your cooperation.
***********************************************************************