ASoC: WM8770: Initial driver
Subsystems (3)
PATCH 1/1 ASoC: WM8770: Initial driver
The WM8770 is a high performance, multi-channel audio codec. The WM8770 is ideal for surround sound processing applications for home hi-fi, automotive and other audio visual equipment.
Signed-off-by Dimitris Papastamos <[email protected]>
--- sound/soc/codecs/Kconfig | 4 + sound/soc/codecs/Makefile | 2 + sound/soc/codecs/wm8770.c | 745 +++++++++++++++++++++++++++++++++++++++++++++ sound/soc/codecs/wm8770.h | 51 +++ 4 files changed, 802 insertions(+), 0 deletions(-) create mode 100644 sound/soc/codecs/wm8770.c create mode 100644 sound/soc/codecs/wm8770.h
sound/soc/codecs/Kconfig +4 -0
@@ -58,6 +58,7 @@ config SND_SOC_ALL_CODECS select SND_SOC_WM8741 if SND_SOC_I2C_AND_SPI select SND_SOC_WM8750 if SND_SOC_I2C_AND_SPI select SND_SOC_WM8753 if SND_SOC_I2C_AND_SPI + select SND_SOC_WM8770 if SPI_MASTER select SND_SOC_WM8776 if SND_SOC_I2C_AND_SPI select SND_SOC_WM8804 if SND_SOC_I2C_AND_SPI select SND_SOC_WM8900 if I2C
@@ -244,6 +245,9 @@ config SND_SOC_WM8750 config SND_SOC_WM8753 tristate +config SND_SOC_WM8770 + tristate + config SND_SOC_WM8776 tristate
sound/soc/codecs/Makefile +2 -0
@@ -42,6 +42,7 @@ snd-soc-wm8731-objs := wm8731.o snd-soc-wm8741-objs := wm8741.o snd-soc-wm8750-objs := wm8750.o snd-soc-wm8753-objs := wm8753.o +snd-soc-wm8770-objs := wm8770.o snd-soc-wm8776-objs := wm8776.o snd-soc-wm8804-objs := wm8804.o snd-soc-wm8900-objs := wm8900.o
@@ -118,6 +119,7 @@ obj-$(CONFIG_SND_SOC_WM8731) += snd-soc-wm8731.o obj-$(CONFIG_SND_SOC_WM8741) += snd-soc-wm8741.o obj-$(CONFIG_SND_SOC_WM8750) += snd-soc-wm8750.o obj-$(CONFIG_SND_SOC_WM8753) += snd-soc-wm8753.o +obj-$(CONFIG_SND_SOC_WM8770) += snd-soc-wm8770.o obj-$(CONFIG_SND_SOC_WM8776) += snd-soc-wm8776.o obj-$(CONFIG_SND_SOC_WM8804) += snd-soc-wm8804.o obj-$(CONFIG_SND_SOC_WM8900) += snd-soc-wm8900.o
sound/soc/codecs/wm8770.c new file +745 -0
745 lines not on this page · raw message
sound/soc/codecs/wm8770.h new file +51 -0
51 lines not on this page · raw message
Signature · 1 line
1.7.3.2
sound/soc/codecs/wm8770.c line 223
Quoted 6 lines · Dimitris Papastamos
sound/soc/codecs/wm8770.c new file +6
-0+SND_SOC_DAPM_MIXER_E ("VOUT1 Mixer" ,SND_SOC_NOPM ,0 ,0 , + vout1_mix_controls,ARRAY_SIZE (vout1_mix_controls), + vout12mixer_event,SND_SOC_DAPM_PRE_PMU |SND_SOC_DAPM_PRE_PMD ), +SND_SOC_DAPM_MIXER_E ("VOUT2 Mixer" ,SND_SOC_NOPM ,0 ,0 , + vout2_mix_controls,ARRAY_SIZE (vout2_mix_controls), + vout12mixer_event, SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_PRE_PMD),
Both of these use this event:
Quoted 5 lines
sound/soc/codecs/wm8770.c new file +5
-0+static int vout12mixer_event (struct snd_soc_dapm_widget *w, +struct snd_kcontrol *kcontrol,int event) +{ +struct snd_soc_codec *codec; +
sound/soc/codecs/wm8770.c line 284
Quoted 10 lines
sound/soc/codecs/wm8770.c new file +10
-0+ codec = w->codec; + +switch (event) { +case SND_SOC_DAPM_PRE_PMU : +snd_soc_update_bits (codec,WM8770_OUTMUX1 ,0x180 ,0 ); +break ; +case SND_SOC_DAPM_PRE_PMD : +snd_soc_update_bits (codec,WM8770_OUTMUX1 ,0x180 ,0x180 ); +break ; + }
If one widget is powered down while the other is kept active then this will power down both which probably isn't what was wanted. This can be handled by attaching the event to a _SUPPLY widget which feeds into both mixers, or by explicit reference counting in the event.