Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ASoC: mioa701_wm9713: Fix speaker event

Commit f6b2a04590bb ("ASoC: pxa: mioa701_wm9713: Convert to table based DAPM
setup") converted the driver to register the board level DAPM elements with
the card's DAPM context rather than the CODEC's DAPM context. The change
overlooked that the speaker widget event callback accesses the widget's
codec field which is only valid if the widget has been registered in a CODEC
DAPM context. This patch modifies the callback to take an alternative route
to get the CODEC.

Fixes: f6b2a04590bb ("ASoC: pxa: mioa701_wm9713: Convert to table based DAPM
setup")
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Lars-Peter Clausen and committed by
Mark Brown
7331ea47 0201e505

+1 -1
+1 -1
sound/soc/pxa/mioa701_wm9713.c
··· 81 81 static int rear_amp_event(struct snd_soc_dapm_widget *widget, 82 82 struct snd_kcontrol *kctl, int event) 83 83 { 84 - struct snd_soc_codec *codec = widget->codec; 84 + struct snd_soc_codec *codec = widget->dapm->card->rtd[0].codec; 85 85 86 86 return rear_amp_power(codec, SND_SOC_DAPM_EVENT_ON(event)); 87 87 }