linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/3] ASoC:codec:max98373: Changed amp shutdown register as volatile
@ 2021-03-25  3:35 Ryan Lee
  2021-03-25  3:35 ` [PATCH 2/3] ASoC:codec:max98373: Added 30ms turn on/off time delay Ryan Lee
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Ryan Lee @ 2021-03-25  3:35 UTC (permalink / raw)
  To: lgirdwood, broonie, perex, tiwai, pierre-louis.bossart,
	kai.vehmanen, yung-chuan.liao, rander.wang, ryans.lee,
	guennadi.liakhovetski, vkoul, yong.zhi, judyhsiao, alsa-devel,
	linux-kernel
  Cc: ryan.lee.maxim

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>
---
 sound/soc/codecs/max98373-i2c.c | 1 +
 sound/soc/codecs/max98373-sdw.c | 1 +
 2 files changed, 2 insertions(+)

diff --git a/sound/soc/codecs/max98373-i2c.c b/sound/soc/codecs/max98373-i2c.c
index 85f6865019d4..ddb6436835d7 100644
--- a/sound/soc/codecs/max98373-i2c.c
+++ b/sound/soc/codecs/max98373-i2c.c
@@ -446,6 +446,7 @@ static bool max98373_volatile_reg(struct device *dev, unsigned int reg)
 	case MAX98373_R2054_MEAS_ADC_PVDD_CH_READBACK:
 	case MAX98373_R2055_MEAS_ADC_THERM_CH_READBACK:
 	case MAX98373_R20B6_BDE_CUR_STATE_READBACK:
+	case MAX98373_R20FF_GLOBAL_SHDN:
 	case MAX98373_R21FF_REV_ID:
 		return true;
 	default:
diff --git a/sound/soc/codecs/max98373-sdw.c b/sound/soc/codecs/max98373-sdw.c
index d8c47667a9ea..f3a12205cd48 100644
--- a/sound/soc/codecs/max98373-sdw.c
+++ b/sound/soc/codecs/max98373-sdw.c
@@ -220,6 +220,7 @@ static bool max98373_volatile_reg(struct device *dev, unsigned int reg)
 	case MAX98373_R2054_MEAS_ADC_PVDD_CH_READBACK:
 	case MAX98373_R2055_MEAS_ADC_THERM_CH_READBACK:
 	case MAX98373_R20B6_BDE_CUR_STATE_READBACK:
+	case MAX98373_R20FF_GLOBAL_SHDN:
 	case MAX98373_R21FF_REV_ID:
 	/* SoundWire Control Port Registers */
 	case MAX98373_R0040_SCP_INIT_STAT_1 ... MAX98373_R0070_SCP_FRAME_CTLR:
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2021-03-25 17:38 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-25  3:35 [PATCH 1/3] ASoC:codec:max98373: Changed amp shutdown register as volatile Ryan Lee
2021-03-25  3:35 ` [PATCH 2/3] ASoC:codec:max98373: Added 30ms turn on/off time delay Ryan Lee
2021-03-25  3:35 ` [PATCH 3/3] ASoC:codec:max98373: Added controls for autorestart config Ryan Lee
2021-03-25 13:56 ` [PATCH 1/3] ASoC:codec:max98373: Changed amp shutdown register as volatile Mark Brown
2021-03-25 17:37 ` Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).