summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorb-ak <anur.bhargav@gmail.com>2019-01-07 22:30:22 +0530
committerBen Hutchings <ben@decadent.org.uk>2019-05-02 21:41:13 +0100
commitbf9acddc04762d7bf308a3c34bcb29c7d376044f (patch)
treec6cf2a75b1217759b435c70c3fc5d6340f0f2db0
parent1a429f7526f1e7391b6c046daa1877666b659759 (diff)
downloadlinux-stable-bf9acddc04762d7bf308a3c34bcb29c7d376044f.tar.gz
linux-stable-bf9acddc04762d7bf308a3c34bcb29c7d376044f.tar.bz2
linux-stable-bf9acddc04762d7bf308a3c34bcb29c7d376044f.zip
ASoC: tlv320aic32x4: Kernel OOPS while entering DAPM standby mode
commit 667e9334fa64da2273e36ce131b05ac9e47c5769 upstream. During the bootup of the kernel, the DAPM bias level is in the OFF state. As soon as the DAPM framework kicks in it pushes the codec into STANDBY state. The probe function doesn't prepare the clock, and STANDBY state does a clk_disable_unprepare() without checking the previous state. This leads to an OOPS. Not transitioning from an OFF state to the STANDBY state fixes the problem. Signed-off-by: b-ak <anur.bhargav@gmail.com> Signed-off-by: Mark Brown <broonie@kernel.org> [bwh: Backported to 3.16: - Open-code snd_soc_component_get_bias_level() - Adjust context] Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
-rw-r--r--sound/soc/codecs/tlv320aic32x4.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/sound/soc/codecs/tlv320aic32x4.c b/sound/soc/codecs/tlv320aic32x4.c
index 1d9b117345a3..4b3f7504e0b2 100644
--- a/sound/soc/codecs/tlv320aic32x4.c
+++ b/sound/soc/codecs/tlv320aic32x4.c
@@ -534,6 +534,10 @@ static int aic32x4_set_bias_level(struct snd_soc_codec *codec,
case SND_SOC_BIAS_PREPARE:
break;
case SND_SOC_BIAS_STANDBY:
+ /* Initial cold start */
+ if (codec->dapm.bias_level == SND_SOC_BIAS_OFF)
+ break;
+
/* Switch off BCLK_N Divider */
snd_soc_update_bits(codec, AIC32X4_BCLKN,
AIC32X4_BCLKEN, 0);