Skip to content

Commit 24164f4

Browse files
KailangYangtiwai
authored andcommitted
ALSA: hda/realtek - Add HP new mute led supported for ALC236
HP new platform has new mute led feature. COEF index 0x34 bit 5 to control playback mute led. COEF index 0x35 bit 2 and bit 3 to control Mic mute led. [ corrected typos by tiwai ] Signed-off-by: Kailang Yang <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Takashi Iwai <[email protected]>
1 parent 431e76c commit 24164f4

File tree

1 file changed

+44
-0
lines changed

1 file changed

+44
-0
lines changed

sound/pci/hda/patch_realtek.c

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4219,6 +4219,23 @@ static void alc285_fixup_hp_mute_led_coefbit(struct hda_codec *codec,
42194219
}
42204220
}
42214221

4222+
static void alc236_fixup_hp_mute_led_coefbit(struct hda_codec *codec,
4223+
const struct hda_fixup *fix,
4224+
int action)
4225+
{
4226+
struct alc_spec *spec = codec->spec;
4227+
4228+
if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4229+
spec->mute_led_polarity = 0;
4230+
spec->mute_led_coef_idx = 0x34;
4231+
spec->mute_led_coefbit_mask = 1<<5;
4232+
spec->mute_led_coefbit_on = 0;
4233+
spec->mute_led_coefbit_off = 1<<5;
4234+
spec->gen.vmaster_mute.hook = alc_fixup_mute_led_coefbit_hook;
4235+
spec->gen.vmaster_mute_enum = 1;
4236+
}
4237+
}
4238+
42224239
/* turn on/off mic-mute LED per capture hook by coef bit */
42234240
static void alc_hp_cap_micmute_update(struct hda_codec *codec)
42244241
{
@@ -4246,13 +4263,34 @@ static void alc285_fixup_hp_coef_micmute_led(struct hda_codec *codec,
42464263
}
42474264
}
42484265

4266+
static void alc236_fixup_hp_coef_micmute_led(struct hda_codec *codec,
4267+
const struct hda_fixup *fix, int action)
4268+
{
4269+
struct alc_spec *spec = codec->spec;
4270+
4271+
if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4272+
spec->mic_led_coef_idx = 0x35;
4273+
spec->mic_led_coefbit_mask = 3<<2;
4274+
spec->mic_led_coefbit_on = 2<<2;
4275+
spec->mic_led_coefbit_off = 1<<2;
4276+
snd_hda_gen_add_micmute_led(codec, alc_hp_cap_micmute_update);
4277+
}
4278+
}
4279+
42494280
static void alc285_fixup_hp_mute_led(struct hda_codec *codec,
42504281
const struct hda_fixup *fix, int action)
42514282
{
42524283
alc285_fixup_hp_mute_led_coefbit(codec, fix, action);
42534284
alc285_fixup_hp_coef_micmute_led(codec, fix, action);
42544285
}
42554286

4287+
static void alc236_fixup_hp_mute_led(struct hda_codec *codec,
4288+
const struct hda_fixup *fix, int action)
4289+
{
4290+
alc236_fixup_hp_mute_led_coefbit(codec, fix, action);
4291+
alc236_fixup_hp_coef_micmute_led(codec, fix, action);
4292+
}
4293+
42564294
#if IS_REACHABLE(CONFIG_INPUT)
42574295
static void gpio2_mic_hotkey_event(struct hda_codec *codec,
42584296
struct hda_jack_callback *event)
@@ -6040,6 +6078,7 @@ enum {
60406078
ALC294_FIXUP_ASUS_HPE,
60416079
ALC285_FIXUP_HP_GPIO_LED,
60426080
ALC285_FIXUP_HP_MUTE_LED,
6081+
ALC236_FIXUP_HP_MUTE_LED,
60436082
};
60446083

60456084
static const struct hda_fixup alc269_fixups[] = {
@@ -7169,6 +7208,10 @@ static const struct hda_fixup alc269_fixups[] = {
71697208
.type = HDA_FIXUP_FUNC,
71707209
.v.func = alc285_fixup_hp_mute_led,
71717210
},
7211+
[ALC236_FIXUP_HP_MUTE_LED] = {
7212+
.type = HDA_FIXUP_FUNC,
7213+
.v.func = alc236_fixup_hp_mute_led,
7214+
},
71727215
};
71737216

71747217
static const struct snd_pci_quirk alc269_fixup_tbl[] = {
@@ -7315,6 +7358,7 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = {
73157358
SND_PCI_QUIRK(0x103c, 0x84e7, "HP Pavilion 15", ALC269_FIXUP_HP_MUTE_LED_MIC3),
73167359
SND_PCI_QUIRK(0x103c, 0x8736, "HP", ALC285_FIXUP_HP_GPIO_LED),
73177360
SND_PCI_QUIRK(0x103c, 0x877a, "HP", ALC285_FIXUP_HP_MUTE_LED),
7361+
SND_PCI_QUIRK(0x103c, 0x877d, "HP", ALC236_FIXUP_HP_MUTE_LED),
73187362
SND_PCI_QUIRK(0x1043, 0x103e, "ASUS X540SA", ALC256_FIXUP_ASUS_MIC),
73197363
SND_PCI_QUIRK(0x1043, 0x103f, "ASUS TX300", ALC282_FIXUP_ASUS_TX300),
73207364
SND_PCI_QUIRK(0x1043, 0x106d, "Asus K53BE", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),

0 commit comments

Comments
 (0)