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

ASoC: ssm4567: Reset device before regcache_sync()

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>

authored by

Lars-Peter Clausen and committed by
Mark Brown
712a8038 92e963f5

+5
+5
sound/soc/codecs/ssm4567.c
··· 352 352 regcache_cache_only(ssm4567->regmap, !enable); 353 353 354 354 if (enable) { 355 + ret = regmap_write(ssm4567->regmap, SSM4567_REG_SOFT_RESET, 356 + 0x00); 357 + if (ret) 358 + return ret; 359 + 355 360 ret = regmap_update_bits(ssm4567->regmap, 356 361 SSM4567_REG_POWER_CTRL, 357 362 SSM4567_POWER_SPWDN, 0x00);