Skip to content

Commit ebd59ac

Browse files
ypadlyakgregkh
authored andcommitted
ALSA: hda/realtek: Fix speaker silence after S3 resume on Xiaomi Mi Laptop Pro 15
commit 92a8b5e upstream. The Xiaomi Mi Laptop Pro 15 (TM1905, subsystem 1d72:1905) ships with the Realtek ALC256 codec on Intel Comet Lake PCH-LP. After S3 resume the codec sets coefficient register 0x10 to 0x0220 instead of 0x0020 — bit 9 is erroneously set, which silences the internal speaker. Bluetooth and HDMI audio are unaffected because they use different paths. This is the same mechanism fixed for Clevo NJ51CU by commit edca7cc ("ALSA: hda/realtek: Fix quirk for Clevo NJ51CU"), but the existing ALC256_FIXUP_MIC_NO_PRESENCE_AND_RESUME also reconfigures pin 0x19 as a front mic, which is wrong for this Xiaomi where pin 0x19 default is 0x411111f0 (disabled). Add a minimal fixup that only clears the stuck coef bit, and add the Xiaomi SSID to the quirk table. Verified by reading coef 0x10 with hda-verb after resume (returns 0x0220), writing 0x0020, and confirming the internal speaker resumes output. With this fixup applied the bit is cleared on every codec init, including post-resume. Signed-off-by: Yuriy Padlyak <yuriypadlyak@gmail.com> Cc: <stable@vger.kernel.org> Tested-by: Yuriy Padlyak <yuriypadlyak@gmail.com> Link: https://patch.msgid.link/20260429220903.14918-1-yuriypadlyak@gmail.com Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 6b01c1b commit ebd59ac

1 file changed

Lines changed: 19 additions & 0 deletions

File tree

sound/hda/codecs/realtek/alc269.c

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3397,6 +3397,19 @@ static void alc256_fixup_mic_no_presence_and_resume(struct hda_codec *codec,
33973397
}
33983398
}
33993399

3400+
static void alc256_fixup_xiaomi_pro15_resume(struct hda_codec *codec,
3401+
const struct hda_fixup *fix,
3402+
int action)
3403+
{
3404+
/*
3405+
* On the Xiaomi Mi Laptop Pro 15 (TM1905, SSID 1d72:1905) the ALC256
3406+
* codec sets coefficient 0x10 bit 9 to 1 after S3 resume, silencing
3407+
* the internal speaker. Bluetooth and HDMI audio are unaffected.
3408+
* Clear the bit so the speaker keeps working across suspend cycles.
3409+
*/
3410+
alc_update_coef_idx(codec, 0x10, 1<<9, 0);
3411+
}
3412+
34003413
static void alc256_decrease_headphone_amp_val(struct hda_codec *codec,
34013414
const struct hda_fixup *fix, int action)
34023415
{
@@ -4054,6 +4067,7 @@ enum {
40544067
ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE,
40554068
ALC233_FIXUP_NO_AUDIO_JACK,
40564069
ALC256_FIXUP_MIC_NO_PRESENCE_AND_RESUME,
4070+
ALC256_FIXUP_XIAOMI_PRO15_RESUME,
40574071
ALC285_FIXUP_LEGION_Y9000X_SPEAKERS,
40584072
ALC285_FIXUP_LEGION_Y9000X_AUTOMUTE,
40594073
ALC287_FIXUP_LEGION_16ACHG6,
@@ -6241,6 +6255,10 @@ static const struct hda_fixup alc269_fixups[] = {
62416255
.chained = true,
62426256
.chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
62436257
},
6258+
[ALC256_FIXUP_XIAOMI_PRO15_RESUME] = {
6259+
.type = HDA_FIXUP_FUNC,
6260+
.v.func = alc256_fixup_xiaomi_pro15_resume,
6261+
},
62446262
[ALC287_FIXUP_LEGION_16ACHG6] = {
62456263
.type = HDA_FIXUP_FUNC,
62466264
.v.func = alc287_fixup_legion_16achg6_speakers,
@@ -7751,6 +7769,7 @@ static const struct hda_quirk alc269_fixup_tbl[] = {
77517769
SND_PCI_QUIRK(0x1d72, 0x1602, "RedmiBook", ALC255_FIXUP_XIAOMI_HEADSET_MIC),
77527770
SND_PCI_QUIRK(0x1d72, 0x1701, "XiaomiNotebook Pro", ALC298_FIXUP_DELL1_MIC_NO_PRESENCE),
77537771
SND_PCI_QUIRK(0x1d72, 0x1901, "RedmiBook 14", ALC256_FIXUP_ASUS_HEADSET_MIC),
7772+
SND_PCI_QUIRK(0x1d72, 0x1905, "Xiaomi Mi Laptop Pro 15", ALC256_FIXUP_XIAOMI_PRO15_RESUME),
77547773
SND_PCI_QUIRK(0x1d72, 0x1945, "Redmi G", ALC256_FIXUP_ASUS_HEADSET_MIC),
77557774
SND_PCI_QUIRK(0x1d72, 0x1947, "RedmiBook Air", ALC255_FIXUP_XIAOMI_HEADSET_MIC),
77567775
SND_PCI_QUIRK(0x1e39, 0xca14, "MEDION NM14LNL", ALC233_FIXUP_MEDION_MTL_SPK),

0 commit comments

Comments
 (0)