ASoC: wm8994: Ensure the device is resumed in wm89xx_mic_detect functions
authorSylwester Nawrocki <s.nawrocki@samsung.com>
Thu, 27 Aug 2020 17:33:57 +0000 (19:33 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 1 Oct 2020 15:36:23 +0000 (17:36 +0200)
commit700fefbe8c672795b1d4bf8328682bc91cbf3e51
tree7fd842cbf43a7ab3c561b0c983c4bed4e957504a
parent2e1e2b748af2a1b76ae5e9fd2abf2bcd701fc4f4
ASoC: wm8994: Ensure the device is resumed in wm89xx_mic_detect functions

[ Upstream commit f5a2cda4f1db89776b64c4f0f2c2ac609527ac70 ]

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: Sylwester Nawrocki <s.nawrocki@samsung.com>
Acked-by: Krzysztof Kozlowski <krzk@kernel.org>
Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20200827173357.31891-2-s.nawrocki@samsung.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
sound/soc/codecs/wm8994.c