]> git.baikalelectronics.ru Git - kernel.git/commitdiff
ALSA: hda: cs35l41: Add defaulted values into dsp bypass config sequence
authorStefan Binding <sbinding@opensource.cirrus.com>
Thu, 30 Jun 2022 00:23:33 +0000 (01:23 +0100)
committerTakashi Iwai <tiwai@suse.de>
Fri, 15 Jul 2022 14:23:14 +0000 (16:23 +0200)
The config sequences for running with and without firmware and DSP
are different. The original behavior assumed that we would only
run without DSP only in the case where firmware load failed.
This meant the non-firmware sequence was written with the assumtion
that various registers would be set to their default value.
However, to support the ability to unload the firmware, the
non-firmware register sequence must be updated to update all
required registers, including values that would be defaulted,
in case the firmware sequence, which could have already run,
has changed their value.

Signed-off-by: Stefan Binding <sbinding@opensource.cirrus.com>
Signed-off-by: Vitaly Rodionov <vitalyr@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20220630002335.366545-13-vitalyr@opensource.cirrus.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/pci/hda/cs35l41_hda.c

index 75edaffb568a1117ed32322c08fab1d9695b6483..a02a74f68c2d1f33ec969dcf1fae385cf4387d49 100644 (file)
 
 static const struct reg_sequence cs35l41_hda_config[] = {
        { CS35L41_PLL_CLK_CTRL,         0x00000430 }, // 3072000Hz, BCLK Input, PLL_REFCLK_EN = 1
+       { CS35L41_DSP_CLK_CTRL,         0x00000003 }, // DSP CLK EN
        { CS35L41_GLOBAL_CLK_CTRL,      0x00000003 }, // GLOBAL_FS = 48 kHz
        { CS35L41_SP_ENABLES,           0x00010000 }, // ASP_RX1_EN = 1
        { CS35L41_SP_RATE_CTRL,         0x00000021 }, // ASP_BCLK_FREQ = 3.072 MHz
        { CS35L41_SP_FORMAT,            0x20200200 }, // 32 bits RX/TX slots, I2S, clk consumer
+       { CS35L41_SP_HIZ_CTRL,          0x00000002 }, // Hi-Z unused
+       { CS35L41_SP_TX_WL,             0x00000018 }, // 24 cycles/slot
+       { CS35L41_SP_RX_WL,             0x00000018 }, // 24 cycles/slot
        { CS35L41_DAC_PCM1_SRC,         0x00000008 }, // DACPCM1_SRC = ASPRX1
+       { CS35L41_ASP_TX1_SRC,          0x00000018 }, // ASPTX1 SRC = VMON
+       { CS35L41_ASP_TX2_SRC,          0x00000019 }, // ASPTX2 SRC = IMON
+       { CS35L41_ASP_TX3_SRC,          0x00000032 }, // ASPTX3 SRC = ERRVOL
+       { CS35L41_ASP_TX4_SRC,          0x00000033 }, // ASPTX4 SRC = CLASSH_TGT
+       { CS35L41_DSP1_RX1_SRC,         0x00000008 }, // DSP1RX1 SRC = ASPRX1
+       { CS35L41_DSP1_RX2_SRC,         0x00000009 }, // DSP1RX2 SRC = ASPRX2
+       { CS35L41_DSP1_RX3_SRC,         0x00000018 }, // DSP1RX3 SRC = VMON
+       { CS35L41_DSP1_RX4_SRC,         0x00000019 }, // DSP1RX4 SRC = IMON
+       { CS35L41_DSP1_RX5_SRC,         0x00000020 }, // DSP1RX5 SRC = ERRVOL
        { CS35L41_AMP_DIG_VOL_CTRL,     0x00000000 }, // AMP_VOL_PCM  0.0 dB
        { CS35L41_AMP_GAIN_CTRL,        0x00000084 }, // AMP_GAIN_PCM 4.5 dB
 };