Skip to content

Commit 33790d1

Browse files
Stefan Bindingtiwai
authored andcommitted
ALSA: hda: cs35l41: Do not unload firmware before reset in system suspend
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 <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Takashi Iwai <[email protected]>
1 parent 2ee06ff commit 33790d1

File tree

1 file changed

+4
-29
lines changed

1 file changed

+4
-29
lines changed

sound/pci/hda/cs35l41_hda.c

Lines changed: 4 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -760,41 +760,16 @@ int cs35l41_verify_id(struct cs35l41_hda *cs35l41, unsigned int *regid, unsigned
760760

761761
static int cs35l41_ready_for_reset(struct cs35l41_hda *cs35l41)
762762
{
763-
int ret = 0;
764-
765763
mutex_lock(&cs35l41->fw_mutex);
766764
if (cs35l41->firmware_running) {
767-
768-
regcache_cache_only(cs35l41->regmap, false);
769-
770-
ret = cs35l41_exit_hibernate(cs35l41->dev, cs35l41->regmap);
771-
if (ret) {
772-
dev_warn(cs35l41->dev, "Unable to exit Hibernate.");
773-
goto err;
774-
}
775-
776-
/* Test key needs to be unlocked to allow the OTP settings to re-apply */
777-
cs35l41_test_key_unlock(cs35l41->dev, cs35l41->regmap);
778-
ret = regcache_sync(cs35l41->regmap);
779-
cs35l41_test_key_lock(cs35l41->dev, cs35l41->regmap);
780-
if (ret) {
781-
dev_err(cs35l41->dev, "Failed to restore register cache: %d\n", ret);
782-
goto err;
783-
}
784-
785-
if (cs35l41->hw_cfg.bst_type == CS35L41_EXT_BOOST)
786-
cs35l41_init_boost(cs35l41->dev, cs35l41->regmap, &cs35l41->hw_cfg);
787-
788-
cs35l41_shutdown_dsp(cs35l41);
789-
cs35l41_safe_reset(cs35l41->regmap, cs35l41->hw_cfg.bst_type);
765+
cs35l41->cs_dsp.running = false;
766+
cs35l41->cs_dsp.booted = false;
767+
cs35l41->firmware_running = false;
790768
}
791-
err:
792-
regcache_cache_only(cs35l41->regmap, true);
793769
regcache_mark_dirty(cs35l41->regmap);
794-
795770
mutex_unlock(&cs35l41->fw_mutex);
796771

797-
return ret;
772+
return 0;
798773
}
799774

800775
static int cs35l41_system_suspend_prep(struct device *dev)

0 commit comments

Comments
 (0)