Re: [PATCH v2 2/7] ASoC: cs35l41: Prevent software reset when using SPI
From: Mark Brown
Date: Thu Nov 26 2026 - 21:16:08 EST
> If there is any SPI Bus activity during a software reset, even if the
> chip select is not set for that Amp, the amp may not boot.
>
> This affects both CS35L41 ASoC and HDA drivers. For HDA this also
> affects system resume.
>
> Whilst the driver needs the amp to be reset when coming out of system
> suspend, the driver will always toggle the reset GPIO off and on to
> ensure this occurs. If a reset GPIO is not defined for the amplifier,
> the amplifier will not probe - unless the amp is using a shared reset.
> In the case of a shared reset, the GPIO will control resets for both
> amps anyway.
>
> Link: https://bugzilla.kernel.org/show_bug.cgi?id=221161
> Fixes: 9bfbc1af0713 ("ALSA: hda: cs35l41: Add common wait_for_boot api and reset_and_boot api")
>
> Signed-off-by: Stefan Binding <sbinding@xxxxxxxxxxxxxxxxxxxxx>
> @@ -1627,27 +1640,35 @@ int cs35l41_reset_and_boot(struct device *dev, struct regmap *regmap)
> {
> int ret;
>
> - ret = regmap_write(regmap, CS35L41_SFT_RESET, CS35L41_SOFTWARE_RESET);
> - if (ret) {
> - dev_warn(dev, "Failed to write software reset: %d\n", ret);
> -
> + if (cs35l41_is_spi_regmap(regmap)) {
What happens if for example we suspend but the suspend is aborted before
a shared reset controller actually asserts reset, or if someone unloeads
and reloads the driver?
--
Mark Brown <broonie@xxxxxxxxxx>