mirror of
https://github.com/torvalds/linux.git
synced 2026-05-13 08:39:31 +02:00
ALSA: hda/realtek - Enable Mute LED for Lenovo platform
Enable SPK Mute Led and Mic Mute Led for Lenovo platform. Signed-off-by: Kailang Yang <kailang@realtek.com> Link: https://patch.msgid.link/8a99edffee044e13b6e348d1b69c2b57@realtek.com Signed-off-by: Takashi Iwai <tiwai@suse.de>
This commit is contained in:
parent
cf077db587
commit
5de5db3535
|
|
@ -1616,6 +1616,20 @@ static void alc295_fixup_hp_mute_led_coefbit11(struct hda_codec *codec,
|
|||
}
|
||||
}
|
||||
|
||||
static void alc233_fixup_lenovo_coef_micmute_led(struct hda_codec *codec,
|
||||
const struct hda_fixup *fix, int action)
|
||||
{
|
||||
struct alc_spec *spec = codec->spec;
|
||||
|
||||
if (action == HDA_FIXUP_ACT_PRE_PROBE) {
|
||||
spec->mic_led_coef.idx = 0x10;
|
||||
spec->mic_led_coef.mask = 1 << 13;
|
||||
spec->mic_led_coef.on = 0;
|
||||
spec->mic_led_coef.off = 1 << 13;
|
||||
snd_hda_gen_add_micmute_led_cdev(codec, coef_micmute_led_set);
|
||||
}
|
||||
}
|
||||
|
||||
static void alc285_fixup_hp_mute_led(struct hda_codec *codec,
|
||||
const struct hda_fixup *fix, int action)
|
||||
{
|
||||
|
|
@ -1906,6 +1920,39 @@ static void alc280_fixup_hp_gpio2_mic_hotkey(struct hda_codec *codec,
|
|||
}
|
||||
}
|
||||
|
||||
/* GPIO2 = mic mute hotkey
|
||||
* GPIO3 = mic mute LED
|
||||
*/
|
||||
static void alc233_fixup_lenovo_gpio2_mic_hotkey(struct hda_codec *codec,
|
||||
const struct hda_fixup *fix, int action)
|
||||
{
|
||||
struct alc_spec *spec = codec->spec;
|
||||
|
||||
alc233_fixup_lenovo_coef_micmute_led(codec, fix, action);
|
||||
if (action == HDA_FIXUP_ACT_PRE_PROBE) {
|
||||
alc_update_coef_idx(codec, 0x10, 1<<2, 1<<2);
|
||||
if (alc_register_micmute_input_device(codec) != 0)
|
||||
return;
|
||||
|
||||
spec->gpio_mask |= 0x04;
|
||||
spec->gpio_dir |= 0x0;
|
||||
snd_hda_codec_write_cache(codec, codec->core.afg, 0,
|
||||
AC_VERB_SET_GPIO_UNSOLICITED_RSP_MASK, 0x04);
|
||||
snd_hda_jack_detect_enable_callback(codec, codec->core.afg,
|
||||
gpio2_mic_hotkey_event);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!spec->kb_dev)
|
||||
return;
|
||||
|
||||
switch (action) {
|
||||
case HDA_FIXUP_ACT_FREE:
|
||||
input_unregister_device(spec->kb_dev);
|
||||
spec->kb_dev = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
/* Line2 = mic mute hotkey
|
||||
* GPIO2 = mic mute LED
|
||||
*/
|
||||
|
|
@ -3791,6 +3838,7 @@ enum {
|
|||
ALC245_FIXUP_HP_TAS2781_I2C_MUTE_LED,
|
||||
ALC288_FIXUP_SURFACE_SWAP_DACS,
|
||||
ALC236_FIXUP_HP_MUTE_LED_MICMUTE_GPIO,
|
||||
ALC233_FIXUP_LENOVO_GPIO2_MIC_HOTKEY,
|
||||
};
|
||||
|
||||
/* A special fixup for Lenovo C940 and Yoga Duet 7;
|
||||
|
|
@ -6256,6 +6304,10 @@ static const struct hda_fixup alc269_fixups[] = {
|
|||
.type = HDA_FIXUP_FUNC,
|
||||
.v.func = alc288_fixup_surface_swap_dacs,
|
||||
},
|
||||
[ALC233_FIXUP_LENOVO_GPIO2_MIC_HOTKEY] = {
|
||||
.type = HDA_FIXUP_FUNC,
|
||||
.v.func = alc233_fixup_lenovo_gpio2_mic_hotkey,
|
||||
},
|
||||
};
|
||||
|
||||
static const struct hda_quirk alc269_fixup_tbl[] = {
|
||||
|
|
@ -7152,7 +7204,12 @@ static const struct hda_quirk alc269_fixup_tbl[] = {
|
|||
SND_PCI_QUIRK(0x17aa, 0x3176, "ThinkCentre Station", ALC283_FIXUP_HEADSET_MIC),
|
||||
SND_PCI_QUIRK(0x17aa, 0x3178, "ThinkCentre Station", ALC283_FIXUP_HEADSET_MIC),
|
||||
SND_PCI_QUIRK(0x17aa, 0x31af, "ThinkCentre Station", ALC623_FIXUP_LENOVO_THINKSTATION_P340),
|
||||
SND_PCI_QUIRK(0x17aa, 0x3341, "Lenovo ThinkCentre M90 Gen4", ALC233_FIXUP_LENOVO_GPIO2_MIC_HOTKEY),
|
||||
SND_PCI_QUIRK(0x17aa, 0x3342, "Lenovo ThinkCentre M90 Gen4", ALC233_FIXUP_LENOVO_GPIO2_MIC_HOTKEY),
|
||||
SND_PCI_QUIRK(0x17aa, 0x3343, "Lenovo ThinkCentre M70 Gen4", ALC233_FIXUP_LENOVO_GPIO2_MIC_HOTKEY),
|
||||
SND_PCI_QUIRK(0x17aa, 0x3344, "Lenovo ThinkCentre M70 Gen4", ALC233_FIXUP_LENOVO_GPIO2_MIC_HOTKEY),
|
||||
SND_PCI_QUIRK(0x17aa, 0x334b, "Lenovo ThinkCentre M70 Gen5", ALC283_FIXUP_HEADSET_MIC),
|
||||
SND_PCI_QUIRK(0x17aa, 0x334f, "Lenovo ThinkCentre M90a Gen5", ALC233_FIXUP_LENOVO_GPIO2_MIC_HOTKEY),
|
||||
SND_PCI_QUIRK(0x17aa, 0x3384, "ThinkCentre M90a PRO", ALC233_FIXUP_LENOVO_L2MH_LOW_ENLED),
|
||||
SND_PCI_QUIRK(0x17aa, 0x3386, "ThinkCentre M90a Gen6", ALC233_FIXUP_LENOVO_L2MH_LOW_ENLED),
|
||||
SND_PCI_QUIRK(0x17aa, 0x3387, "ThinkCentre M70a Gen6", ALC233_FIXUP_LENOVO_L2MH_LOW_ENLED),
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user