From: Stefan Binding <sbinding@opensource.cirrus.com>
To: Mark Brown <broonie@kernel.org>, Jaroslav Kysela <perex@perex.cz>,
Takashi Iwai <tiwai@suse.com>
Cc: linux-sound@vger.kernel.org, linux-kernel@vger.kernel.org,
patches@opensource.cirrus.com,
Stefan Binding <sbinding@opensource.cirrus.com>
Subject: [PATCH v1 2/2] ASoC: cs35l41: Use common wait_for_boot and reset_and_boot apis
Date: Fri, 30 Oct 2026 17:10:15 +0000 [thread overview]
Message-ID: <20261030171045.469944-3-sbinding@opensource.cirrus.com> (raw)
In-Reply-To: <20261030171045.469944-1-sbinding@opensource.cirrus.com>
Use the newly added common wait_for_boot and reset_and_boot apis on
probe.
This should prevent issues occurring if the chip is not ready on
before it starts reading and writing to it.
In addition, the driver now ensures the chip is reset using a software
reset, when calling reset_and_boot().
Signed-off-by: Stefan Binding <sbinding@opensource.cirrus.com>
---
sound/soc/codecs/cs35l41.c | 18 +++---------------
1 file changed, 3 insertions(+), 15 deletions(-)
diff --git a/sound/soc/codecs/cs35l41.c b/sound/soc/codecs/cs35l41.c
index d286025183f4..0e40444a1003 100644
--- a/sound/soc/codecs/cs35l41.c
+++ b/sound/soc/codecs/cs35l41.c
@@ -1211,7 +1211,7 @@ static int cs35l41_get_system_name(struct cs35l41_private *cs35l41)
int cs35l41_probe(struct cs35l41_private *cs35l41, const struct cs35l41_hw_cfg *hw_cfg)
{
- u32 regid, reg_revid, i, mtl_revid, int_status, chipid_match;
+ u32 regid, reg_revid, i, mtl_revid, chipid_match;
int irq_pol = 0;
int ret;
@@ -1260,21 +1260,9 @@ int cs35l41_probe(struct cs35l41_private *cs35l41, const struct cs35l41_hw_cfg *
usleep_range(2000, 2100);
- ret = regmap_read_poll_timeout(cs35l41->regmap, CS35L41_IRQ1_STATUS4,
- int_status, int_status & CS35L41_OTP_BOOT_DONE,
- 1000, 100000);
- if (ret) {
- dev_err_probe(cs35l41->dev, ret,
- "Failed waiting for OTP_BOOT_DONE\n");
- goto err;
- }
-
- regmap_read(cs35l41->regmap, CS35L41_IRQ1_STATUS3, &int_status);
- if (int_status & CS35L41_OTP_BOOT_ERR) {
- dev_err(cs35l41->dev, "OTP Boot error\n");
- ret = -EINVAL;
+ ret = cs35l41_reset_and_boot(cs35l41->dev, cs35l41->regmap);
+ if (ret)
goto err;
- }
ret = regmap_read(cs35l41->regmap, CS35L41_DEVID, ®id);
if (ret < 0) {
--
2.43.0
next prev parent reply other threads:[~2026-10-30 17:11 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-30 17:10 [PATCH v1 0/2] Add common wait_for_boot and reset_and_boot apis for cs35l41 drivers Stefan Binding
2026-10-30 17:10 ` [PATCH v1 1/2] ALSA: hda: cs35l41: Add common wait_for_boot api and reset_and_boot api Stefan Binding
2026-10-30 17:26 ` sashiko-bot
2026-10-30 17:10 ` Stefan Binding [this message]
2026-10-30 17:20 ` [PATCH v1 2/2] ASoC: cs35l41: Use common wait_for_boot and reset_and_boot apis Mark Brown
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261030171045.469944-3-sbinding@opensource.cirrus.com \
--to=sbinding@opensource.cirrus.com \
--cc=broonie@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-sound@vger.kernel.org \
--cc=patches@opensource.cirrus.com \
--cc=perex@perex.cz \
--cc=tiwai@suse.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox