diff options
| author | Stefan Binding <sbinding@opensource.cirrus.com> | 2026-10-30 17:10:14 +0000 |
|---|---|---|
| committer | Takashi Iwai <tiwai@suse.de> | 2026-11-05 08:54:45 +0100 |
| commit | 9bfbc1af07137f5d4792de282091d16ac36f6ea5 (patch) | |
| tree | fa54602a1d15acc692e3cb2c50682c3c3b677d71 /include | |
| parent | 023d3e1176202339cd94a3d732e3aec74e36ba22 (diff) | |
ALSA: hda: cs35l41: Add common wait_for_boot api and reset_and_boot api
Both the ASoC CS35L41 and HDA CS35L41 drivers currently use
regmap_read_poll_timeout() calls to wait for the chip to boot.
However, this macro will exit immediately if one of the regmap_read()
calls fail. This could be cause by the hardware not being ready yet
after a reset, which then breaks the loop early and leads to probe
and resume calls failing.
This patch replaces the existing code in the HDA driver with a
function with a loop which does not break on regmap_read() failure.
Since both drivers need to do this, make a common function in
cs35l41-lib.c to be called from both drivers.
This patch only updates the HDA driver, a separate patch will update
the ASoC driver.
In addition, before the call to wait to boot, the HDA driver also
does a software reset to ensure the device is in a known state before
probe or resume (for example, if there is no reset gpio). Since this
write could fail for the same reason, add a common api to do this
with a retry mechanism.
Signed-off-by: Stefan Binding <sbinding@opensource.cirrus.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20261030171045.469944-2-sbinding@opensource.cirrus.com
Diffstat (limited to 'include')
| -rw-r--r-- | include/sound/cs35l41.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/include/sound/cs35l41.h b/include/sound/cs35l41.h index 7542cabfa726..b6b338c55ff0 100644 --- a/include/sound/cs35l41.h +++ b/include/sound/cs35l41.h @@ -924,5 +924,7 @@ bool cs35l41_safe_reset(struct regmap *regmap, enum cs35l41_boost_type b_type); int cs35l41_mdsync_up(struct regmap *regmap); int cs35l41_global_enable(struct device *dev, struct regmap *regmap, enum cs35l41_boost_type b_type, int enable, struct cs_dsp *dsp); +int cs35l41_wait_boot_done(struct device *dev, struct regmap *regmap); +int cs35l41_reset_and_boot(struct device *dev, struct regmap *regmap); #endif /* __CS35L41_H */ |
