aboutsummaryrefslogtreecommitdiff
path: root/sound/soc/codecs/ssm4567.c
diff options
context:
space:
mode:
authorLars-Peter Clausen <lars@metafoo.de>2016-01-27 14:26:18 +0100
committerSasha Levin <sasha.levin@oracle.com>2016-07-10 23:07:11 -0400
commitfad61c46cc9c999169b95d14a67c60a0a7141d00 (patch)
treee245656066f9191fdba97506a576ac408db481d6 /sound/soc/codecs/ssm4567.c
parent0cbc7967e970b92f2b60a5d935dc49eef08cfa2e (diff)
ASoC: ssm4567: Reset device before regcache_sync()
[ Upstream commit 712a8038cc24dba668afe82f0413714ca87184e0 ] When the ssm4567 is powered up the driver calles regcache_sync() to restore the register map content. regcache_sync() assumes that the device is in its power-on reset state. Make sure that this is the case by explicitly resetting the ssm4567 register map before calling regcache_sync() otherwise we might end up with a incorrect register map which leads to undefined behaviour. One such undefined behaviour was observed when returning from system suspend while a playback stream is active, in that case the ssm4567 was kept muted after resume. Fixes: 1ee44ce03011 ("ASoC: ssm4567: Add driver for Analog Devices SSM4567 amplifier") Reported-by: Harsha Priya <harshapriya.n@intel.com> Tested-by: Fang, Yang A <yang.a.fang@intel.com> Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Mark Brown <broonie@kernel.org> Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
Diffstat (limited to 'sound/soc/codecs/ssm4567.c')
-rw-r--r--sound/soc/codecs/ssm4567.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/sound/soc/codecs/ssm4567.c b/sound/soc/codecs/ssm4567.c
index f7549cc7ea85..d1f53abb60de 100644
--- a/sound/soc/codecs/ssm4567.c
+++ b/sound/soc/codecs/ssm4567.c
@@ -338,6 +338,11 @@ static int ssm4567_set_power(struct ssm4567 *ssm4567, bool enable)
regcache_cache_only(ssm4567->regmap, !enable);
if (enable) {
+ ret = regmap_write(ssm4567->regmap, SSM4567_REG_SOFT_RESET,
+ 0x00);
+ if (ret)
+ return ret;
+
ret = regmap_update_bits(ssm4567->regmap,
SSM4567_REG_POWER_CTRL,
SSM4567_POWER_SPWDN, 0x00);