Unverified Commit c64e7749 authored by Richard Fitzgerald's avatar Richard Fitzgerald Committed by Mark Brown
Browse files

ASoC: cs35l56: Fix hibernate write in runtime resume error path



The error path of cs35l56_runtime_resume_common() should only write
the hibernation sequence if can_hibernate is true.

Something has already gone badly wrong if we ever reach the error
path. But triggering hibernate on hardware that does not support it
is likely to make the situation unrecoverable without a full reboot
because there might not be any hardware signal to exit hibernate.

Fixes: a47cf4da ("ASoC: cs35l56: Change hibernate sequence to use allow auto hibernate")
Signed-off-by: default avatarRichard Fitzgerald <rf@opensource.cirrus.com>
Link: https://patch.msgid.link/20260429105315.2438298-1-rf@opensource.cirrus.com


Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent ec061186
Loading
Loading
Loading
Loading
+5 −3
Original line number Diff line number Diff line
@@ -851,9 +851,11 @@ int cs35l56_runtime_resume_common(struct cs35l56_base *cs35l56_base, bool is_sou
err:
	regcache_cache_only(cs35l56_base->regmap, true);

	if (cs35l56_base->can_hibernate) {
		regmap_multi_reg_write_bypassed(cs35l56_base->regmap,
						cs35l56_hibernate_seq,
						ARRAY_SIZE(cs35l56_hibernate_seq));
	}

	return ret;
}