ALSA: hda: cs35l41: Update DSP1RX5/6 Sources for DSP config
authorStefan Binding <sbinding@opensource.cirrus.com>
Thu, 11 Apr 2024 11:08:10 +0000 (12:08 +0100)
committerTakashi Iwai <tiwai@suse.de>
Thu, 18 Apr 2024 06:43:19 +0000 (08:43 +0200)
Currently, all PC systems are set to use VBSTMON for DSP1RX5_SRC,
however, this is required only for external boost systems.
Internal boost systems require VPMON instead of VBSTMON to be the
input to DSP1RX5_SRC.
All systems require DSP1RX6_SRC to be set to VBSTMON.
Also fix incorrect comment for DACPCM1_SRC to use DSP1TX1.

Signed-off-by: Stefan Binding <sbinding@opensource.cirrus.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Message-ID: <20240411110813.330483-5-sbinding@opensource.cirrus.com>

sound/pci/hda/cs35l41_hda.c

index 12609d6d96c22e9dd06987669ffc5c80a796c97d..17e812c60ac9b63c3f50ceb04efa602ccd6310a7 100644 (file)
@@ -101,7 +101,7 @@ static const struct reg_sequence cs35l41_hda_config_dsp[] = {
        { CS35L41_SP_HIZ_CTRL,          0x00000003 }, // Hi-Z unused/disabled
        { CS35L41_SP_TX_WL,             0x00000018 }, // 24 cycles/slot
        { CS35L41_SP_RX_WL,             0x00000018 }, // 24 cycles/slot
-       { CS35L41_DAC_PCM1_SRC,         0x00000032 }, // DACPCM1_SRC = ERR_VOL
+       { CS35L41_DAC_PCM1_SRC,         0x00000032 }, // DACPCM1_SRC = DSP1TX1
        { CS35L41_ASP_TX1_SRC,          0x00000018 }, // ASPTX1 SRC = VMON
        { CS35L41_ASP_TX2_SRC,          0x00000019 }, // ASPTX2 SRC = IMON
        { CS35L41_ASP_TX3_SRC,          0x00000028 }, // ASPTX3 SRC = VPMON
@@ -110,7 +110,7 @@ static const struct reg_sequence cs35l41_hda_config_dsp[] = {
        { CS35L41_DSP1_RX2_SRC,         0x00000008 }, // DSP1RX2 SRC = ASPRX1
        { CS35L41_DSP1_RX3_SRC,         0x00000018 }, // DSP1RX3 SRC = VMON
        { CS35L41_DSP1_RX4_SRC,         0x00000019 }, // DSP1RX4 SRC = IMON
-       { CS35L41_DSP1_RX5_SRC,         0x00000029 }, // DSP1RX5 SRC = VBSTMON
+       { CS35L41_DSP1_RX6_SRC,         0x00000029 }, // DSP1RX6 SRC = VBSTMON
 };
 
 static const struct reg_sequence cs35l41_hda_unmute[] = {
@@ -692,6 +692,10 @@ static void cs35l41_hda_play_start(struct device *dev)
        if (cs35l41->cs_dsp.running) {
                regmap_multi_reg_write(reg, cs35l41_hda_config_dsp,
                                       ARRAY_SIZE(cs35l41_hda_config_dsp));
+               if (cs35l41->hw_cfg.bst_type == CS35L41_INT_BOOST)
+                       regmap_write(reg, CS35L41_DSP1_RX5_SRC, CS35L41_INPUT_SRC_VPMON);
+               else
+                       regmap_write(reg, CS35L41_DSP1_RX5_SRC, CS35L41_INPUT_SRC_VBSTMON);
                regmap_update_bits(reg, CS35L41_PWR_CTRL2,
                                   CS35L41_VMON_EN_MASK | CS35L41_IMON_EN_MASK,
                                   1 << CS35L41_VMON_EN_SHIFT | 1 << CS35L41_IMON_EN_SHIFT);