From: Stefan Binding <sbinding@opensource.cirrus.com>
To: Jaroslav Kysela <perex@perex.cz>, Takashi Iwai <tiwai@suse.com>,
"Mark Brown" <broonie@kernel.org>
Cc: <alsa-devel@alsa-project.org>, <linux-kernel@vger.kernel.org>,
<linux-sound@vger.kernel.org>, <patches@opensource.cirrus.com>,
"Stefan Binding" <sbinding@opensource.cirrus.com>
Subject: [PATCH v1 6/8] ALSA: hda: cs35l41: Do not unload firmware before reset in system suspend
Date: Thu, 26 Oct 2023 16:05:56 +0100 [thread overview]
Message-ID: <20231026150558.2105827-7-sbinding@opensource.cirrus.com> (raw)
In-Reply-To: <20231026150558.2105827-1-sbinding@opensource.cirrus.com>
Given the part is about to reset due to system suspend, and we are
already in hibernate, there is no need to wake up the amp, just to get
it ready to be reset. We just need to ensure cs_dsp is ready for reset
by resetting the states.
Signed-off-by: Stefan Binding <sbinding@opensource.cirrus.com>
---
sound/pci/hda/cs35l41_hda.c | 33 ++++-----------------------------
1 file changed, 4 insertions(+), 29 deletions(-)
diff --git a/sound/pci/hda/cs35l41_hda.c b/sound/pci/hda/cs35l41_hda.c
index 9746c64ff0dd..69303888be1a 100644
--- a/sound/pci/hda/cs35l41_hda.c
+++ b/sound/pci/hda/cs35l41_hda.c
@@ -760,41 +760,16 @@ int cs35l41_verify_id(struct cs35l41_hda *cs35l41, unsigned int *regid, unsigned
static int cs35l41_ready_for_reset(struct cs35l41_hda *cs35l41)
{
- int ret = 0;
-
mutex_lock(&cs35l41->fw_mutex);
if (cs35l41->firmware_running) {
-
- regcache_cache_only(cs35l41->regmap, false);
-
- ret = cs35l41_exit_hibernate(cs35l41->dev, cs35l41->regmap);
- if (ret) {
- dev_warn(cs35l41->dev, "Unable to exit Hibernate.");
- goto err;
- }
-
- /* Test key needs to be unlocked to allow the OTP settings to re-apply */
- cs35l41_test_key_unlock(cs35l41->dev, cs35l41->regmap);
- ret = regcache_sync(cs35l41->regmap);
- cs35l41_test_key_lock(cs35l41->dev, cs35l41->regmap);
- if (ret) {
- dev_err(cs35l41->dev, "Failed to restore register cache: %d\n", ret);
- goto err;
- }
-
- if (cs35l41->hw_cfg.bst_type == CS35L41_EXT_BOOST)
- cs35l41_init_boost(cs35l41->dev, cs35l41->regmap, &cs35l41->hw_cfg);
-
- cs35l41_shutdown_dsp(cs35l41);
- cs35l41_safe_reset(cs35l41->regmap, cs35l41->hw_cfg.bst_type);
+ cs35l41->cs_dsp.running = false;
+ cs35l41->cs_dsp.booted = false;
+ cs35l41->firmware_running = false;
}
-err:
- regcache_cache_only(cs35l41->regmap, true);
regcache_mark_dirty(cs35l41->regmap);
-
mutex_unlock(&cs35l41->fw_mutex);
- return ret;
+ return 0;
}
static int cs35l41_system_suspend_prep(struct device *dev)
--
2.34.1
next prev parent reply other threads:[~2023-10-26 15:06 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-10-26 15:05 [PATCH v1 0/8] System Suspend fixes and improvements for CS35L41 HDA Stefan Binding
2023-10-26 15:05 ` [PATCH v1 1/8] ALSA: hda: cs35l41: Use reset label to get GPIO for HP Zbook Fury 17 G9 Stefan Binding
2023-10-26 15:05 ` [PATCH v1 2/8] ALSA: hda: cs35l41: Assert reset before system suspend Stefan Binding
2023-10-26 15:05 ` [PATCH v1 3/8] ALSA: hda: cs35l41: Assert Reset prior to de-asserting in probe and system resume Stefan Binding
2023-10-26 15:05 ` [PATCH v1 4/8] ALSA: hda: cs35l41: Run boot process during resume callbacks Stefan Binding
2023-10-26 15:05 ` [PATCH v1 5/8] ALSA: hda: cs35l41: Force a software reset after hardware reset Stefan Binding
2023-10-26 15:05 ` Stefan Binding [this message]
2023-10-26 15:05 ` [PATCH v1 7/8] ALSA: hda: cs35l41: Check CSPL state after loading firmware Stefan Binding
2023-10-26 15:05 ` [PATCH v1 8/8] ASoC: cs35l41: Detect CSPL errors when sending CSPL commands Stefan Binding
2023-10-26 15:09 ` Mark Brown
2023-10-26 16:02 ` [PATCH v1 0/8] System Suspend fixes and improvements for CS35L41 HDA Takashi Iwai
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=20231026150558.2105827-7-sbinding@opensource.cirrus.com \
--to=sbinding@opensource.cirrus.com \
--cc=alsa-devel@alsa-project.org \
--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