Skip to content

Commit f082bb5

Browse files
Sylwester Nawrockibroonie
authored andcommitted
ASoC: wm8994: Avoid attempts to read unreadable registers
The driver supports WM1811, WM8994, WM8958 devices but according to documentation and the regmap definitions the WM8958_DSP2_* registers are only available on WM8958. In current code these registers are being accessed as if they were available on all the three chips. When starting playback on WM1811 CODEC multiple errors like: "wm8994-codec wm8994-codec: ASoC: error at soc_component_read_no_lock on wm8994-codec: -5" can be seen, which is caused by attempts to read an unavailable WM8958_DSP2_PROGRAM register. The issue has been uncovered by recent commit "e2329ee ASoC: soc-component: add soc_component_err()". This patch adds a check in wm8958_aif_ev() callback so the DSP2 handling is only done for WM8958. Signed-off-by: Sylwester Nawrocki <[email protected]> Acked-by: Charles Keepax <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
1 parent ff69c97 commit f082bb5

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

sound/soc/codecs/wm8958-dsp2.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -412,8 +412,12 @@ int wm8958_aif_ev(struct snd_soc_dapm_widget *w,
412412
struct snd_kcontrol *kcontrol, int event)
413413
{
414414
struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm);
415+
struct wm8994 *control = dev_get_drvdata(component->dev->parent);
415416
int i;
416417

418+
if (control->type != WM8958)
419+
return 0;
420+
417421
switch (event) {
418422
case SND_SOC_DAPM_POST_PMU:
419423
case SND_SOC_DAPM_PRE_PMU:

0 commit comments

Comments
 (0)