Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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>

authored by

Kailang Yang and committed by
Takashi Iwai
5de5db35 cf077db5

+57
+57
sound/hda/codecs/realtek/alc269.c
··· 1616 1616 } 1617 1617 } 1618 1618 1619 + static void alc233_fixup_lenovo_coef_micmute_led(struct hda_codec *codec, 1620 + const struct hda_fixup *fix, int action) 1621 + { 1622 + struct alc_spec *spec = codec->spec; 1623 + 1624 + if (action == HDA_FIXUP_ACT_PRE_PROBE) { 1625 + spec->mic_led_coef.idx = 0x10; 1626 + spec->mic_led_coef.mask = 1 << 13; 1627 + spec->mic_led_coef.on = 0; 1628 + spec->mic_led_coef.off = 1 << 13; 1629 + snd_hda_gen_add_micmute_led_cdev(codec, coef_micmute_led_set); 1630 + } 1631 + } 1632 + 1619 1633 static void alc285_fixup_hp_mute_led(struct hda_codec *codec, 1620 1634 const struct hda_fixup *fix, int action) 1621 1635 { ··· 1903 1889 spec->gpio_mask |= 0x06; 1904 1890 spec->gpio_dir |= 0x02; 1905 1891 spec->gpio_data |= 0x02; 1892 + snd_hda_codec_write_cache(codec, codec->core.afg, 0, 1893 + AC_VERB_SET_GPIO_UNSOLICITED_RSP_MASK, 0x04); 1894 + snd_hda_jack_detect_enable_callback(codec, codec->core.afg, 1895 + gpio2_mic_hotkey_event); 1896 + return; 1897 + } 1898 + 1899 + if (!spec->kb_dev) 1900 + return; 1901 + 1902 + switch (action) { 1903 + case HDA_FIXUP_ACT_FREE: 1904 + input_unregister_device(spec->kb_dev); 1905 + spec->kb_dev = NULL; 1906 + } 1907 + } 1908 + 1909 + /* GPIO2 = mic mute hotkey 1910 + * GPIO3 = mic mute LED 1911 + */ 1912 + static void alc233_fixup_lenovo_gpio2_mic_hotkey(struct hda_codec *codec, 1913 + const struct hda_fixup *fix, int action) 1914 + { 1915 + struct alc_spec *spec = codec->spec; 1916 + 1917 + alc233_fixup_lenovo_coef_micmute_led(codec, fix, action); 1918 + if (action == HDA_FIXUP_ACT_PRE_PROBE) { 1919 + alc_update_coef_idx(codec, 0x10, 1<<2, 1<<2); 1920 + if (alc_register_micmute_input_device(codec) != 0) 1921 + return; 1922 + 1923 + spec->gpio_mask |= 0x04; 1924 + spec->gpio_dir |= 0x0; 1906 1925 snd_hda_codec_write_cache(codec, codec->core.afg, 0, 1907 1926 AC_VERB_SET_GPIO_UNSOLICITED_RSP_MASK, 0x04); 1908 1927 snd_hda_jack_detect_enable_callback(codec, codec->core.afg, ··· 3838 3791 ALC245_FIXUP_HP_TAS2781_I2C_MUTE_LED, 3839 3792 ALC288_FIXUP_SURFACE_SWAP_DACS, 3840 3793 ALC236_FIXUP_HP_MUTE_LED_MICMUTE_GPIO, 3794 + ALC233_FIXUP_LENOVO_GPIO2_MIC_HOTKEY, 3841 3795 }; 3842 3796 3843 3797 /* A special fixup for Lenovo C940 and Yoga Duet 7; ··· 6304 6256 .type = HDA_FIXUP_FUNC, 6305 6257 .v.func = alc288_fixup_surface_swap_dacs, 6306 6258 }, 6259 + [ALC233_FIXUP_LENOVO_GPIO2_MIC_HOTKEY] = { 6260 + .type = HDA_FIXUP_FUNC, 6261 + .v.func = alc233_fixup_lenovo_gpio2_mic_hotkey, 6262 + }, 6307 6263 }; 6308 6264 6309 6265 static const struct hda_quirk alc269_fixup_tbl[] = { ··· 7204 7152 SND_PCI_QUIRK(0x17aa, 0x3176, "ThinkCentre Station", ALC283_FIXUP_HEADSET_MIC), 7205 7153 SND_PCI_QUIRK(0x17aa, 0x3178, "ThinkCentre Station", ALC283_FIXUP_HEADSET_MIC), 7206 7154 SND_PCI_QUIRK(0x17aa, 0x31af, "ThinkCentre Station", ALC623_FIXUP_LENOVO_THINKSTATION_P340), 7155 + SND_PCI_QUIRK(0x17aa, 0x3341, "Lenovo ThinkCentre M90 Gen4", ALC233_FIXUP_LENOVO_GPIO2_MIC_HOTKEY), 7156 + SND_PCI_QUIRK(0x17aa, 0x3342, "Lenovo ThinkCentre M90 Gen4", ALC233_FIXUP_LENOVO_GPIO2_MIC_HOTKEY), 7157 + SND_PCI_QUIRK(0x17aa, 0x3343, "Lenovo ThinkCentre M70 Gen4", ALC233_FIXUP_LENOVO_GPIO2_MIC_HOTKEY), 7158 + SND_PCI_QUIRK(0x17aa, 0x3344, "Lenovo ThinkCentre M70 Gen4", ALC233_FIXUP_LENOVO_GPIO2_MIC_HOTKEY), 7207 7159 SND_PCI_QUIRK(0x17aa, 0x334b, "Lenovo ThinkCentre M70 Gen5", ALC283_FIXUP_HEADSET_MIC), 7160 + SND_PCI_QUIRK(0x17aa, 0x334f, "Lenovo ThinkCentre M90a Gen5", ALC233_FIXUP_LENOVO_GPIO2_MIC_HOTKEY), 7208 7161 SND_PCI_QUIRK(0x17aa, 0x3384, "ThinkCentre M90a PRO", ALC233_FIXUP_LENOVO_L2MH_LOW_ENLED), 7209 7162 SND_PCI_QUIRK(0x17aa, 0x3386, "ThinkCentre M90a Gen6", ALC233_FIXUP_LENOVO_L2MH_LOW_ENLED), 7210 7163 SND_PCI_QUIRK(0x17aa, 0x3387, "ThinkCentre M70a Gen6", ALC233_FIXUP_LENOVO_L2MH_LOW_ENLED),