Skip to content

Commit 2143c8a

Browse files
KailangYangtiwai
authored andcommitted
ALSA: hda/realtek - update set GPIO3 to default for Thinkpad with ALC1318
If user no update BIOS, the speaker will no sound. This patch support old BIOS to have sound from speaker. Fixes: 1e70776 ("ALSA: hda/realtek - Set GPIO3 to default at S4 state for Thinkpad with ALC1318") Signed-off-by: Kailang Yang <kailang@realtek.com> Cc: <stable@vger.kernel.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
1 parent 96409ee commit 2143c8a

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

sound/pci/hda/patch_realtek.c

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7450,7 +7450,6 @@ static void alc287_alc1318_playback_pcm_hook(struct hda_pcm_stream *hinfo,
74507450
struct snd_pcm_substream *substream,
74517451
int action)
74527452
{
7453-
alc_write_coef_idx(codec, 0x10, 0x8806); /* Change MLK to GPIO3 */
74547453
switch (action) {
74557454
case HDA_GEN_PCM_ACT_OPEN:
74567455
alc_write_coefex_idx(codec, 0x5a, 0x00, 0x954f); /* write gpio3 to high */
@@ -7464,7 +7463,6 @@ static void alc287_alc1318_playback_pcm_hook(struct hda_pcm_stream *hinfo,
74647463
static void alc287_s4_power_gpio3_default(struct hda_codec *codec)
74657464
{
74667465
if (is_s4_suspend(codec)) {
7467-
alc_write_coef_idx(codec, 0x10, 0x8806); /* Change MLK to GPIO3 */
74687466
alc_write_coefex_idx(codec, 0x5a, 0x00, 0x554f); /* write gpio3 as default value */
74697467
}
74707468
}
@@ -7473,9 +7471,17 @@ static void alc287_fixup_lenovo_thinkpad_with_alc1318(struct hda_codec *codec,
74737471
const struct hda_fixup *fix, int action)
74747472
{
74757473
struct alc_spec *spec = codec->spec;
7474+
static const struct coef_fw coefs[] = {
7475+
WRITE_COEF(0x24, 0x0013), WRITE_COEF(0x25, 0x0000), WRITE_COEF(0x26, 0xC300),
7476+
WRITE_COEF(0x28, 0x0001), WRITE_COEF(0x29, 0xb023),
7477+
WRITE_COEF(0x24, 0x0013), WRITE_COEF(0x25, 0x0000), WRITE_COEF(0x26, 0xC301),
7478+
WRITE_COEF(0x28, 0x0001), WRITE_COEF(0x29, 0xb023),
7479+
};
74767480

74777481
if (action != HDA_FIXUP_ACT_PRE_PROBE)
74787482
return;
7483+
alc_update_coef_idx(codec, 0x10, 1<<11, 1<<11);
7484+
alc_process_coef_fw(codec, coefs);
74797485
spec->power_hook = alc287_s4_power_gpio3_default;
74807486
spec->gen.pcm_playback_hook = alc287_alc1318_playback_pcm_hook;
74817487
}

0 commit comments

Comments
 (0)