Skip to content

Commit 51113dd

Browse files
committed
ASoC: cs35l45: Prevents spinning during runtime suspend
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. Change-Id: I06455a60bb6af323415321de4fd77186ffc38c96 Signed-off-by: Ricardo Rivera-Matos <[email protected]> Acked-by: Charles Keepax <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
1 parent 694ab75 commit 51113dd

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

sound/soc/codecs/cs35l45.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -947,6 +947,8 @@ static int cs35l45_enter_hibernate(struct cs35l45_private *cs35l45)
947947

948948
cs35l45_setup_hibernate(cs35l45);
949949

950+
regmap_set_bits(cs35l45->regmap, CS35L45_IRQ1_MASK_2, CS35L45_DSP_VIRT2_MBOX_MASK);
951+
950952
// Don't wait for ACK since bus activity would wake the device
951953
regmap_write(cs35l45->regmap, CS35L45_DSP_VIRT1_MBOX_1, CSPL_MBOX_CMD_HIBERNATE);
952954

@@ -967,6 +969,8 @@ static int cs35l45_exit_hibernate(struct cs35l45_private *cs35l45)
967969
CSPL_MBOX_CMD_OUT_OF_HIBERNATE);
968970
if (!ret) {
969971
dev_dbg(cs35l45->dev, "Wake success at cycle: %d\n", j);
972+
regmap_clear_bits(cs35l45->regmap, CS35L45_IRQ1_MASK_2,
973+
CS35L45_DSP_VIRT2_MBOX_MASK);
970974
return 0;
971975
}
972976
usleep_range(100, 200);

0 commit comments

Comments
 (0)