Commit 9af818a3 authored by Sylwester Nawrocki's avatar Sylwester Nawrocki Committed by Greg Kroah-Hartman

ASoC: wm8994: Ensure the device is resumed in wm89xx_mic_detect functions

[ Upstream commit f5a2cda4 ]

When the wm8958_mic_detect, wm8994_mic_detect functions get called from
the machine driver, e.g. from the card's late_probe() callback, the CODEC
device may be PM runtime suspended and any regmap writes have no effect.
Add PM runtime calls to these functions to ensure the device registers
are updated as expected.
This suppresses an error during boot
"wm8994-codec: ASoC: error at snd_soc_component_update_bits on wm8994-codec"
caused by the regmap access error due to the cache_only flag being set.
Signed-off-by: default avatarSylwester Nawrocki <s.nawrocki@samsung.com>
Acked-by: default avatarKrzysztof Kozlowski <krzk@kernel.org>
Acked-by: default avatarCharles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20200827173357.31891-2-s.nawrocki@samsung.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent 9688d307
...@@ -3376,6 +3376,8 @@ int wm8994_mic_detect(struct snd_soc_component *component, struct snd_soc_jack * ...@@ -3376,6 +3376,8 @@ int wm8994_mic_detect(struct snd_soc_component *component, struct snd_soc_jack *
return -EINVAL; return -EINVAL;
} }
pm_runtime_get_sync(component->dev);
switch (micbias) { switch (micbias) {
case 1: case 1:
micdet = &wm8994->micdet[0]; micdet = &wm8994->micdet[0];
...@@ -3423,6 +3425,8 @@ int wm8994_mic_detect(struct snd_soc_component *component, struct snd_soc_jack * ...@@ -3423,6 +3425,8 @@ int wm8994_mic_detect(struct snd_soc_component *component, struct snd_soc_jack *
snd_soc_dapm_sync(dapm); snd_soc_dapm_sync(dapm);
pm_runtime_put(component->dev);
return 0; return 0;
} }
EXPORT_SYMBOL_GPL(wm8994_mic_detect); EXPORT_SYMBOL_GPL(wm8994_mic_detect);
...@@ -3790,6 +3794,8 @@ int wm8958_mic_detect(struct snd_soc_component *component, struct snd_soc_jack * ...@@ -3790,6 +3794,8 @@ int wm8958_mic_detect(struct snd_soc_component *component, struct snd_soc_jack *
return -EINVAL; return -EINVAL;
} }
pm_runtime_get_sync(component->dev);
if (jack) { if (jack) {
snd_soc_dapm_force_enable_pin(dapm, "CLK_SYS"); snd_soc_dapm_force_enable_pin(dapm, "CLK_SYS");
snd_soc_dapm_sync(dapm); snd_soc_dapm_sync(dapm);
...@@ -3858,6 +3864,8 @@ int wm8958_mic_detect(struct snd_soc_component *component, struct snd_soc_jack * ...@@ -3858,6 +3864,8 @@ int wm8958_mic_detect(struct snd_soc_component *component, struct snd_soc_jack *
snd_soc_dapm_sync(dapm); snd_soc_dapm_sync(dapm);
} }
pm_runtime_put(component->dev);
return 0; return 0;
} }
EXPORT_SYMBOL_GPL(wm8958_mic_detect); EXPORT_SYMBOL_GPL(wm8958_mic_detect);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment