Skip to content

Commit edca7cc

Browse files
tuxedo-wsetiwai
authored andcommitted
ALSA: hda/realtek: Fix quirk for Clevo NJ51CU
The Clevo NJ51CU comes either with the ALC293 or the ALC256 codec, but uses the 0x8686 subproduct id in both cases. The ALC256 codec needs a different quirk for the headset microphone working and and edditional quirk for sound working after suspend and resume. When waking up from s3 suspend the Coef 0x10 is set to 0x0220 instead of 0x0020 on the ALC256 codec. Setting the value manually makes the sound work again. This patch does this automatically. [ minor coding style fix by tiwai ] Signed-off-by: Werner Sembach <wse@tuxedocomputers.com> Fixes: b5acfe1 ("ALSA: hda/realtek: Add some Clove SSID in the ALC293(ALC1220)") Cc: <stable@vger.kernel.org> Link: https://lore.kernel.org/r/20211215191646.844644-1-wse@tuxedocomputers.com Signed-off-by: Takashi Iwai <tiwai@suse.de>
1 parent 39a8fc4 commit edca7cc

1 file changed

Lines changed: 25 additions & 1 deletion

File tree

sound/pci/hda/patch_realtek.c

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6546,6 +6546,23 @@ static void alc233_fixup_no_audio_jack(struct hda_codec *codec,
65466546
alc_process_coef_fw(codec, alc233_fixup_no_audio_jack_coefs);
65476547
}
65486548

6549+
static void alc256_fixup_mic_no_presence_and_resume(struct hda_codec *codec,
6550+
const struct hda_fixup *fix,
6551+
int action)
6552+
{
6553+
/*
6554+
* The Clevo NJ51CU comes either with the ALC293 or the ALC256 codec,
6555+
* but uses the 0x8686 subproduct id in both cases. The ALC256 codec
6556+
* needs an additional quirk for sound working after suspend and resume.
6557+
*/
6558+
if (codec->core.vendor_id == 0x10ec0256) {
6559+
alc_update_coef_idx(codec, 0x10, 1<<9, 0);
6560+
snd_hda_codec_set_pincfg(codec, 0x19, 0x04a11120);
6561+
} else {
6562+
snd_hda_codec_set_pincfg(codec, 0x1a, 0x04a1113c);
6563+
}
6564+
}
6565+
65496566
enum {
65506567
ALC269_FIXUP_GPIO2,
65516568
ALC269_FIXUP_SONY_VAIO,
@@ -6766,6 +6783,7 @@ enum {
67666783
ALC256_FIXUP_SET_COEF_DEFAULTS,
67676784
ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE,
67686785
ALC233_FIXUP_NO_AUDIO_JACK,
6786+
ALC256_FIXUP_MIC_NO_PRESENCE_AND_RESUME,
67696787
};
67706788

67716789
static const struct hda_fixup alc269_fixups[] = {
@@ -8490,6 +8508,12 @@ static const struct hda_fixup alc269_fixups[] = {
84908508
.type = HDA_FIXUP_FUNC,
84918509
.v.func = alc233_fixup_no_audio_jack,
84928510
},
8511+
[ALC256_FIXUP_MIC_NO_PRESENCE_AND_RESUME] = {
8512+
.type = HDA_FIXUP_FUNC,
8513+
.v.func = alc256_fixup_mic_no_presence_and_resume,
8514+
.chained = true,
8515+
.chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
8516+
},
84938517
};
84948518

84958519
static const struct snd_pci_quirk alc269_fixup_tbl[] = {
@@ -8831,7 +8855,7 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = {
88318855
SND_PCI_QUIRK(0x1558, 0x8562, "Clevo NH[57][0-9]RZ[Q]", ALC269_FIXUP_DMIC),
88328856
SND_PCI_QUIRK(0x1558, 0x8668, "Clevo NP50B[BE]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
88338857
SND_PCI_QUIRK(0x1558, 0x8680, "Clevo NJ50LU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8834-
SND_PCI_QUIRK(0x1558, 0x8686, "Clevo NH50[CZ]U", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8858+
SND_PCI_QUIRK(0x1558, 0x8686, "Clevo NH50[CZ]U", ALC256_FIXUP_MIC_NO_PRESENCE_AND_RESUME),
88358859
SND_PCI_QUIRK(0x1558, 0x8a20, "Clevo NH55DCQ-Y", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
88368860
SND_PCI_QUIRK(0x1558, 0x8a51, "Clevo NH70RCQ-Y", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
88378861
SND_PCI_QUIRK(0x1558, 0x8d50, "Clevo NH55RCQ-M", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),

0 commit comments

Comments
 (0)