[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20231226002021.4776-10-sashal@kernel.org>
Date: Mon, 25 Dec 2023 19:19:00 -0500
From: Sasha Levin <sashal@...nel.org>
To: linux-kernel@...r.kernel.org,
stable@...r.kernel.org
Cc: Ricardo Rivera-Matos <rriveram@...nsource.cirrus.com>,
Charles Keepax <ckeepax@...nsource.cirrus.com>,
Mark Brown <broonie@...nel.org>,
Sasha Levin <sashal@...nel.org>,
james.schulman@...rus.com,
david.rhodes@...rus.com,
rf@...nsource.cirrus.com,
lgirdwood@...il.com,
perex@...ex.cz,
tiwai@...e.com,
alsa-devel@...a-project.org,
patches@...nsource.cirrus.com,
linux-sound@...r.kernel.org
Subject: [PATCH AUTOSEL 6.6 10/39] ASoC: cs35l45: Prevents spinning during runtime suspend
From: Ricardo Rivera-Matos <rriveram@...nsource.cirrus.com>
[ Upstream commit a0ffa8115e1ea9786b03edc3f431d2f4ef3e7a2e ]
Masks the "DSP Virtual Mailbox 2 write" interrupt when before
issuing the hibernate command to the DSP. The interrupt is
unmasked when exiting runtime suspend as it is required for
DSP operation.
Without this change the DSP fires an interrupt when hibernating
causing the system spin between runtime suspend and runtime
resume.
Signed-off-by: Ricardo Rivera-Matos <rriveram@...nsource.cirrus.com>
Acked-by: Charles Keepax <ckeepax@...nsource.cirrus.com>
Link: https://lore.kernel.org/r/20231206160318.1255034-4-rriveram@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@...nel.org>
Signed-off-by: Sasha Levin <sashal@...nel.org>
---
sound/soc/codecs/cs35l45.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/sound/soc/codecs/cs35l45.c b/sound/soc/codecs/cs35l45.c
index 310747b7689d3..9b9fc2d491089 100644
--- a/sound/soc/codecs/cs35l45.c
+++ b/sound/soc/codecs/cs35l45.c
@@ -775,6 +775,8 @@ static int cs35l45_enter_hibernate(struct cs35l45_private *cs35l45)
cs35l45_setup_hibernate(cs35l45);
+ regmap_set_bits(cs35l45->regmap, CS35L45_IRQ1_MASK_2, CS35L45_DSP_VIRT2_MBOX_MASK);
+
// Don't wait for ACK since bus activity would wake the device
regmap_write(cs35l45->regmap, CS35L45_DSP_VIRT1_MBOX_1, CSPL_MBOX_CMD_HIBERNATE);
@@ -795,6 +797,8 @@ static int cs35l45_exit_hibernate(struct cs35l45_private *cs35l45)
CSPL_MBOX_CMD_OUT_OF_HIBERNATE);
if (!ret) {
dev_dbg(cs35l45->dev, "Wake success at cycle: %d\n", j);
+ regmap_clear_bits(cs35l45->regmap, CS35L45_IRQ1_MASK_2,
+ CS35L45_DSP_VIRT2_MBOX_MASK);
return 0;
}
usleep_range(100, 200);
--
2.43.0
Powered by blists - more mailing lists