summaryrefslogtreecommitdiff
path: root/sound/pci/hda
diff options
context:
space:
mode:
authorLucas Tanure <tanureal@opensource.cirrus.com>2022-04-13 11:37:19 +0300
committerTakashi Iwai <tiwai@suse.de>2022-04-13 11:42:33 +0300
commitf04bb4cae18b8eb7e7e7bc35a8e07f1f26bbb919 (patch)
tree5feaa2ea6ac9f45bc3c3d61ceb4b14089ba593da /sound/pci/hda
parentb8388a1aba32bef84884c06c8270efa9eec91267 (diff)
downloadlinux-f04bb4cae18b8eb7e7e7bc35a8e07f1f26bbb919.tar.xz
ALSA: hda: cs35l41: Put the device into safe mode for external boost
To facilitate the configuration of external boost devices, put all devices, with or without VSPK switch, into safe mode from the start. That allows the following parts of the driver to handle all external boost devices in the same way. Signed-off-by: Lucas Tanure <tanureal@opensource.cirrus.com> Link: https://lore.kernel.org/r/20220413083728.10730-8-tanureal@opensource.cirrus.com Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci/hda')
-rw-r--r--sound/pci/hda/cs35l41_hda.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/sound/pci/hda/cs35l41_hda.c b/sound/pci/hda/cs35l41_hda.c
index 0dac622805c4..46e920ec3000 100644
--- a/sound/pci/hda/cs35l41_hda.c
+++ b/sound/pci/hda/cs35l41_hda.c
@@ -109,8 +109,6 @@ static const struct reg_sequence cs35l41_reset_to_safe[] = {
};
static const struct cs35l41_hda_reg_sequence cs35l41_hda_reg_seq_no_bst = {
- .probe = cs35l41_reset_to_safe,
- .num_probe = ARRAY_SIZE(cs35l41_reset_to_safe),
.prepare = cs35l41_safe_to_active,
.num_prepare = ARRAY_SIZE(cs35l41_safe_to_active),
.cleanup = cs35l41_active_to_safe,
@@ -224,10 +222,15 @@ static int cs35l41_hda_apply_properties(struct cs35l41_hda *cs35l41)
return ret;
break;
case CS35L41_EXT_BOOST:
- cs35l41->reg_seq = &cs35l41_hda_reg_seq_ext_bst;
- break;
case CS35L41_EXT_BOOST_NO_VSPK_SWITCH:
- cs35l41->reg_seq = &cs35l41_hda_reg_seq_no_bst;
+ if (hw_cfg->bst_type == CS35L41_EXT_BOOST)
+ cs35l41->reg_seq = &cs35l41_hda_reg_seq_ext_bst;
+ else
+ cs35l41->reg_seq = &cs35l41_hda_reg_seq_no_bst;
+ ret = regmap_multi_reg_write(cs35l41->regmap, cs35l41_reset_to_safe,
+ ARRAY_SIZE(cs35l41_reset_to_safe));
+ if (ret)
+ return ret;
break;
default:
dev_err(cs35l41->dev, "Boost type %d not supported\n", hw_cfg->bst_type);