ASoC: max98373: Changed amp shutdown register as volatile
authorRyan Lee <ryans.lee@maximintegrated.com>
Thu, 25 Mar 2021 03:35:53 +0000 (20:35 -0700)
committerMark Brown <broonie@kernel.org>
Thu, 25 Mar 2021 13:59:46 +0000 (13:59 +0000)
commita23f9099ff1541f15704e96b784d3846d2a4483d
tree914f691d5384c6b7f9f7947b26813feaf6bf48e0
parent632aeebe1b7a3a8b193d71942a10e66919bebfb8
ASoC: max98373: Changed amp shutdown register as volatile

0x20FF(amp global enable) register was defined as non-volatile,
but it is not. Overheating, overcurrent can cause amp shutdown
in hardware.
'regmap_write' compare register readback value before writing
to avoid same value writing. 'regmap_read' just read cache
not actual hardware value for the non-volatile register.
When amp is internally shutdown by some reason, next 'AMP ON'
command can be ignored because regmap think amp is already ON.

Signed-off-by: Ryan Lee <ryans.lee@maximintegrated.com>
Link: https://lore.kernel.org/r/20210325033555.29377-1-ryans.lee@maximintegrated.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/codecs/max98373-i2c.c
sound/soc/codecs/max98373-sdw.c