ASoC: Treat WM8958 revision A as WM8994 revision D
Subsystems (3)
PATCH 1/3 ASoC: Treat WM8958 revision A as WM8994 revision D
The first WM8958 revision requires similar treatment.
--- sound/soc/codecs/wm8994.c | 36 ++++++++++++++++++++++++++---------- 1 files changed, 26 insertions(+), 10 deletions(-)
sound/soc/codecs/wm8994.c +26 -10
@@ -3327,14 +3327,23 @@ static int wm8994_codec_probe(struct snd_soc_codec *codec)case WM8958 :snd_soc_add_controls (codec, wm8958_snd_controls,ARRAY_SIZE (wm8958_snd_controls)); -snd_soc_dapm_new_controls (dapm, wm8994_lateclk_widgets, -ARRAY_SIZE (wm8994_lateclk_widgets)); -snd_soc_dapm_new_controls (dapm, wm8994_adc_widgets, -ARRAY_SIZE (wm8994_adc_widgets)); -snd_soc_dapm_new_controls (dapm, wm8994_dac_widgets, -ARRAY_SIZE (wm8994_dac_widgets));snd_soc_dapm_new_controls (dapm, wm8958_dapm_widgets,ARRAY_SIZE (wm8958_dapm_widgets)); +if (wm8994->revision <1 ) { +snd_soc_dapm_new_controls (dapm, wm8994_lateclk_revd_widgets, +ARRAY_SIZE (wm8994_lateclk_revd_widgets)); +snd_soc_dapm_new_controls (dapm, wm8994_adc_revd_widgets, +ARRAY_SIZE (wm8994_adc_revd_widgets)); +snd_soc_dapm_new_controls (dapm, wm8994_dac_revd_widgets, +ARRAY_SIZE (wm8994_dac_revd_widgets)); + }else { +snd_soc_dapm_new_controls (dapm, wm8994_lateclk_widgets, +ARRAY_SIZE (wm8994_lateclk_widgets)); +snd_soc_dapm_new_controls (dapm, wm8994_adc_widgets, +ARRAY_SIZE (wm8994_adc_widgets)); +snd_soc_dapm_new_controls (dapm, wm8994_dac_widgets, +ARRAY_SIZE (wm8994_dac_widgets)); + }break ; }
@@ -3358,10 +3367,17 @@ static int wm8994_codec_probe(struct snd_soc_codec *codec) }break ;case WM8958 : -snd_soc_dapm_add_routes (dapm, wm8994_lateclk_intercon, -ARRAY_SIZE (wm8994_lateclk_intercon)); -snd_soc_dapm_add_routes (dapm, wm8958_intercon, -ARRAY_SIZE (wm8958_intercon)); +if (wm8994->revision <1 ) { +snd_soc_dapm_add_routes (dapm, wm8994_revd_intercon, +ARRAY_SIZE (wm8994_revd_intercon)); +snd_soc_dapm_add_routes (dapm, wm8994_lateclk_revd_intercon, +ARRAY_SIZE (wm8994_lateclk_revd_intercon)); + }else { +snd_soc_dapm_add_routes (dapm, wm8994_lateclk_intercon, +ARRAY_SIZE (wm8994_lateclk_intercon)); +snd_soc_dapm_add_routes (dapm, wm8958_intercon, +ARRAY_SIZE (wm8958_intercon)); + }break ; }
Signature · 1 line
1.7.4.1
PATCH 2/3 ASoC: Factor WM8958 DSP2 handling into separate file
DSP2 on the WM8958 has a default ROM which provides a multi-band compressor for enhanced performance on mobile devices but can also support runtime download of alternative firmware. In preparation for more exploiting this functionality refactor the code to split the handling of DSP2 into a separate file.
--- sound/soc/codecs/Makefile | 2 +- sound/soc/codecs/wm8958-dsp2.c | 289 +++++++++++++++++++++++++++++++++++++ sound/soc/codecs/wm8994.c | 305 +--------------------------------------- sound/soc/codecs/wm8994.h | 71 +++++++++ 4 files changed, 364 insertions(+), 303 deletions(-) create mode 100644 sound/soc/codecs/wm8958-dsp2.c
sound/soc/codecs/Makefile +1 -1
@@ -69,7 +69,7 @@ snd-soc-wm8988-objs := wm8988.o snd-soc-wm8990-objs := wm8990.o snd-soc-wm8991-objs := wm8991.o snd-soc-wm8993-objs := wm8993.o -snd-soc-wm8994-objs := wm8994.o wm8994-tables.o +snd-soc-wm8994-objs := wm8994.o wm8994-tables.o wm8958-dsp2.o snd-soc-wm8995-objs := wm8995.o snd-soc-wm9081-objs := wm9081.o snd-soc-wm9705-objs := wm9705.o
sound/soc/codecs/wm8958-dsp2.c new file +289 -0
289 lines not on this page · raw message
sound/soc/codecs/wm8994.c +3 -302
347 lines not on this page · raw message
sound/soc/codecs/wm8994.h +71 -0
81 lines not on this page · raw message
Signature · 1 line
1.7.4.1
PATCH 3/3 ASoC: Handle startup sequencing of WM8958 DSP2 with deferred clocking
In reply to Mark BrownThe DSP2 startup requires that the clock be enable so if we've deferred clock startup we need to defer DSP2 startup
--- sound/soc/codecs/wm8958-dsp2.c | 35 ++++++++++++++--------------------- sound/soc/codecs/wm8994.c | 3 +++ 2 files changed, 17 insertions(+), 21 deletions(-)
sound/soc/codecs/wm8958-dsp2.c +14 -21
@@ -69,6 +69,13 @@ static void wm8958_mbc_apply(struct snd_soc_codec *codec, int mbc, int start)if (reg &WM8958_DSP2_ENA )return ; +/* If neither AIFnCLK is not yet enabled postpone */ +if (!(snd_soc_read (codec,WM8994_AIF1_CLOCKING_1 ) + &WM8994_AIF1CLK_ENA_MASK ) && + !(snd_soc_read (codec,WM8994_AIF2_CLOCKING_1 ) + &WM8994_AIF2CLK_ENA_MASK )) +return ; +/* Switch the clock over to the appropriate AIF */ snd_soc_update_bits(codec, WM8994_CLOCKING_1, WM8958_DSP2CLK_SRC | WM8958_DSP2CLK_ENA,
@@ -120,32 +127,18 @@ int wm8958_aif_ev(struct snd_soc_dapm_widget *w, struct snd_kcontrol *kcontrol, int event) {struct snd_soc_codec *codec = w->codec; -int mbc; - -switch (w->shift) { -case 13 : -case 12 : - mbc =2 ; -break ; -case 11 : -case 10 : - mbc =1 ; -break ; -case 9 : -case 8 : - mbc =0 ; -break ; -default : -BUG (); -return -EINVAL ; - } +int i;switch (event) {case SND_SOC_DAPM_POST_PMU : -wm8958_mbc_apply (codec, mbc,1 ); +case SND_SOC_DAPM_PRE_PMU : +for (i =0 ; i <3 ; i++) +wm8958_mbc_apply (codec, i,1 );break ;case SND_SOC_DAPM_POST_PMD : -wm8958_mbc_apply (codec, mbc,0 ); +case SND_SOC_DAPM_PRE_PMD : +for (i =0 ; i <3 ; i++) +wm8958_mbc_apply (codec, i,0 );break ; }
sound/soc/codecs/wm8994.c +3 -0
@@ -759,6 +759,9 @@ static int late_enable_ev(struct snd_soc_dapm_widget *w,break ; } +/* We may also have postponed startup of DSP, handle that. */ +wm8958_aif_ev (w, kcontrol, event); +return 0 ; }
Signature · 1 line
1.7.4.1
Quoted 3 lines · Mark Brown
The first WM8958 revision requires similar treatment.
Signed-off-by Mark Brown <[email protected]>
All