ASoC: cs35l56: Fix pm_runtime imbalance if suspending before first attach

Remove the check for init_done in cs35l56_sdw_system_suspend(). Instead,
protect the call to cs35l56_mask_soundwire_interrupts() to only be done
if the amp is currently enumerated.

This fixes a runtime imbalance if cs35l56_sdw_system_suspend() is called
before the first SoundWire attach. This would skip the call to
pm_runtime_force_suspend() in cs35l56_system_suspend(). But resume
unconditionally called pm_runtime_force_resume() leading to an imbalance.

cs35l56_system_suspend() doesn't have any dependency on completion of
cs35l56_init(), so there is no need for the skip on !init_done in
cs35l56_sdw_system_suspend().

Fixes: f9dc6b875e ("ASoC: cs35l56: Add basic system suspend handling")
Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Link: https://patch.msgid.link/20260831094506.57467-1-rf@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
Richard Fitzgerald 2026-08-31 10:45:06 +01:00 committed by Mark Brown
parent 04405aeef4
commit fbf2c660ba
No known key found for this signature in database
GPG Key ID: 24D68B725D5487D0

View File

@ -386,11 +386,8 @@ static int __maybe_unused cs35l56_sdw_system_suspend(struct device *dev)
{
struct cs35l56_private *cs35l56 = dev_get_drvdata(dev);
if (!cs35l56->base.init_done)
return 0;
/* runtime_resume unmasks the interrupt */
cs35l56_mask_soundwire_interrupts(cs35l56);
if (cs35l56->sdw_attached)
cs35l56_mask_soundwire_interrupts(cs35l56);
return cs35l56_system_suspend(dev);
}