Skip to content

Commit 856ce89

Browse files
rfvirgilbroonie
authored andcommitted
ALSA: hda: cs35l56: Initialize all ASP1 registers
Add ASP1_FRAME_CONTROL1, ASP1_FRAME_CONTROL5 and the ASP1_TX?_INPUT registers to the sequence used to initialize the ASP configuration. Write this sequence to the cache and directly to the registers to ensure that they match. A system-specific firmware can patch these registers to values that are not the silicon default, so that the CS35L56 boots already in the configuration used by Windows or by "driverless" Windows setups such as factory tuning. These may not match how Linux is configuring the HDA codec. And anyway on Linux the ALSA controls are used to configure routing options. Signed-off-by: Richard Fitzgerald <[email protected]> Fixes: 73cfbfa ("ALSA: hda/cs35l56: Add driver for Cirrus Logic CS35L56 amplifier") Link: https://msgid.link/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
1 parent 782e6c5 commit 856ce89

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

sound/pci/hda/cs35l56_hda.c

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,23 @@
3030
* ASP1_RX_WL = 24 bits per sample
3131
* ASP1_TX_WL = 24 bits per sample
3232
* ASP1_RXn_EN 1..3 and ASP1_TXn_EN 1..4 disabled
33+
*
34+
* Override any Windows-specific mixer settings applied by the firmware.
3335
*/
3436
static const struct reg_sequence cs35l56_hda_dai_config[] = {
3537
{ CS35L56_ASP1_CONTROL1, 0x00000021 },
3638
{ CS35L56_ASP1_CONTROL2, 0x20200200 },
3739
{ CS35L56_ASP1_CONTROL3, 0x00000003 },
40+
{ CS35L56_ASP1_FRAME_CONTROL1, 0x03020100 },
41+
{ CS35L56_ASP1_FRAME_CONTROL5, 0x00020100 },
3842
{ CS35L56_ASP1_DATA_CONTROL5, 0x00000018 },
3943
{ CS35L56_ASP1_DATA_CONTROL1, 0x00000018 },
4044
{ CS35L56_ASP1_ENABLES1, 0x00000000 },
45+
{ CS35L56_ASP1TX1_INPUT, 0x00000018 },
46+
{ CS35L56_ASP1TX2_INPUT, 0x00000019 },
47+
{ CS35L56_ASP1TX3_INPUT, 0x00000020 },
48+
{ CS35L56_ASP1TX4_INPUT, 0x00000028 },
49+
4150
};
4251

4352
static void cs35l56_hda_play(struct cs35l56_hda *cs35l56)
@@ -133,6 +142,10 @@ static int cs35l56_hda_runtime_resume(struct device *dev)
133142
}
134143
}
135144

145+
ret = cs35l56_force_sync_asp1_registers_from_cache(&cs35l56->base);
146+
if (ret)
147+
goto err;
148+
136149
return 0;
137150

138151
err:
@@ -976,6 +989,9 @@ int cs35l56_hda_common_probe(struct cs35l56_hda *cs35l56, int id)
976989

977990
regmap_multi_reg_write(cs35l56->base.regmap, cs35l56_hda_dai_config,
978991
ARRAY_SIZE(cs35l56_hda_dai_config));
992+
ret = cs35l56_force_sync_asp1_registers_from_cache(&cs35l56->base);
993+
if (ret)
994+
goto err;
979995

980996
/*
981997
* By default only enable one ASP1TXn, where n=amplifier index,

0 commit comments

Comments
 (0)