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

ALSA: hda/realtek - Enable Mute LED and Tas2781 for HP platform

Enable SPK Mute Led and Mic Mute Led for HP platform.
It was also integrated with Tas2781 supported.

Signed-off-by: Kailang Yang <kailang@realtek.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>

authored by

Kailang Yang and committed by
Takashi Iwai
9afbbf49 2e90ff54

+56 -10
+56 -10
sound/hda/codecs/realtek/alc269.c
··· 3406 3406 spec->power_hook = alc287_s4_power_gpio3_default; 3407 3407 spec->gen.pcm_playback_hook = alc287_alc1318_playback_pcm_hook; 3408 3408 } 3409 + /* GPIO2: mute led GPIO3: micmute led */ 3410 + static void alc245_tas2781_spi_hp_fixup_muteled(struct hda_codec *codec, 3411 + const struct hda_fixup *fix, int action) 3412 + { 3413 + struct alc_spec *spec = codec->spec; 3414 + static const hda_nid_t conn[] = { 0x02 }; 3409 3415 3416 + switch (action) { 3417 + case HDA_FIXUP_ACT_PRE_PROBE: 3418 + spec->gen.auto_mute_via_amp = 1; 3419 + snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn), conn); 3420 + break; 3421 + } 3422 + 3423 + tas2781_fixup_spi(codec, fix, action); 3424 + alc_fixup_hp_gpio_led(codec, action, 0x04, 0x0); 3425 + alc285_fixup_hp_coef_micmute_led(codec, fix, action); 3426 + } 3427 + /* JD2: mute led GPIO3: micmute led */ 3428 + static void alc245_tas2781_i2c_hp_fixup_muteled(struct hda_codec *codec, 3429 + const struct hda_fixup *fix, int action) 3430 + { 3431 + struct alc_spec *spec = codec->spec; 3432 + static const hda_nid_t conn[] = { 0x02 }; 3433 + 3434 + switch (action) { 3435 + case HDA_FIXUP_ACT_PRE_PROBE: 3436 + spec->gen.auto_mute_via_amp = 1; 3437 + snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn), conn); 3438 + break; 3439 + } 3440 + 3441 + tas2781_fixup_txnw_i2c(codec, fix, action); 3442 + alc245_fixup_hp_mute_led_coefbit(codec, fix, action); 3443 + alc285_fixup_hp_coef_micmute_led(codec, fix, action); 3444 + } 3410 3445 /* 3411 3446 * Clear COEF 0x0d (PCBEEP passthrough) bit 0x40 where BIOS sets it wrongly 3412 3447 * at PM resume ··· 3772 3737 ALC269_FIXUP_POSITIVO_P15X_HEADSET_MIC, 3773 3738 ALC289_FIXUP_ASUS_ZEPHYRUS_DUAL_SPK, 3774 3739 ALC256_FIXUP_VAIO_RPL_MIC_NO_PRESENCE, 3740 + ALC245_FIXUP_HP_TAS2781_SPI_MUTE_LED, 3741 + ALC245_FIXUP_HP_TAS2781_I2C_MUTE_LED, 3775 3742 }; 3776 3743 3777 3744 /* A special fixup for Lenovo C940 and Yoga Duet 7; ··· 6220 6183 }, 6221 6184 .chained = true, 6222 6185 .chain_id = ALC269_FIXUP_LIMIT_INT_MIC_BOOST 6223 - } 6186 + }, 6187 + [ALC245_FIXUP_HP_TAS2781_SPI_MUTE_LED] = { 6188 + .type = HDA_FIXUP_FUNC, 6189 + .v.func = alc245_tas2781_spi_hp_fixup_muteled, 6190 + }, 6191 + [ALC245_FIXUP_HP_TAS2781_I2C_MUTE_LED] = { 6192 + .type = HDA_FIXUP_FUNC, 6193 + .v.func = alc245_tas2781_i2c_hp_fixup_muteled, 6194 + }, 6224 6195 }; 6225 6196 6226 6197 static const struct hda_quirk alc269_fixup_tbl[] = { ··· 6739 6694 SND_PCI_QUIRK(0x103c, 0x8e60, "HP Trekker ", ALC287_FIXUP_CS35L41_I2C_2), 6740 6695 SND_PCI_QUIRK(0x103c, 0x8e61, "HP Trekker ", ALC287_FIXUP_CS35L41_I2C_2), 6741 6696 SND_PCI_QUIRK(0x103c, 0x8e62, "HP Trekker ", ALC287_FIXUP_CS35L41_I2C_2), 6742 - SND_PCI_QUIRK(0x103c, 0x8ed5, "HP Merino13X", ALC245_FIXUP_TAS2781_SPI_2), 6743 - SND_PCI_QUIRK(0x103c, 0x8ed6, "HP Merino13", ALC245_FIXUP_TAS2781_SPI_2), 6744 - SND_PCI_QUIRK(0x103c, 0x8ed7, "HP Merino14", ALC245_FIXUP_TAS2781_SPI_2), 6745 - SND_PCI_QUIRK(0x103c, 0x8ed8, "HP Merino16", ALC245_FIXUP_TAS2781_SPI_2), 6746 - SND_PCI_QUIRK(0x103c, 0x8ed9, "HP Merino14W", ALC245_FIXUP_TAS2781_SPI_2), 6747 - SND_PCI_QUIRK(0x103c, 0x8eda, "HP Merino16W", ALC245_FIXUP_TAS2781_SPI_2), 6748 - SND_PCI_QUIRK(0x103c, 0x8f40, "HP Lampas14", ALC287_FIXUP_TXNW2781_I2C), 6749 - SND_PCI_QUIRK(0x103c, 0x8f41, "HP Lampas16", ALC287_FIXUP_TXNW2781_I2C), 6750 - SND_PCI_QUIRK(0x103c, 0x8f42, "HP LampasW14", ALC287_FIXUP_TXNW2781_I2C), 6697 + SND_PCI_QUIRK(0x103c, 0x8ed5, "HP EliteBook 8 Flip G2i 13", ALC245_FIXUP_HP_TAS2781_SPI_MUTE_LED), 6698 + SND_PCI_QUIRK(0x103c, 0x8ed6, "HP EliteBook 8 G2i 13", ALC245_FIXUP_HP_TAS2781_SPI_MUTE_LED), 6699 + SND_PCI_QUIRK(0x103c, 0x8ed7, "HP EliteBook 8 G2i 14", ALC245_FIXUP_HP_TAS2781_SPI_MUTE_LED), 6700 + SND_PCI_QUIRK(0x103c, 0x8ed8, "HP EliteBook 8 G2i 16", ALC245_FIXUP_HP_TAS2781_SPI_MUTE_LED), 6701 + SND_PCI_QUIRK(0x103c, 0x8ed9, "HP ZBook Firefly 14W", ALC245_FIXUP_HP_TAS2781_SPI_MUTE_LED), 6702 + SND_PCI_QUIRK(0x103c, 0x8eda, "HP ZBook Firefly 16W", ALC245_FIXUP_HP_TAS2781_SPI_MUTE_LED), 6703 + SND_PCI_QUIRK(0x103c, 0x8f40, "HP ZBook 8 G2a 14", ALC245_FIXUP_HP_TAS2781_I2C_MUTE_LED), 6704 + SND_PCI_QUIRK(0x103c, 0x8f41, "HP ZBook 8 G2a 16", ALC245_FIXUP_HP_TAS2781_I2C_MUTE_LED), 6705 + SND_PCI_QUIRK(0x103c, 0x8f42, "HP ZBook 8 G2a 14W", ALC245_FIXUP_HP_TAS2781_I2C_MUTE_LED), 6706 + SND_PCI_QUIRK(0x103c, 0x8f62, "HP ZBook 8 G2a 16W", ALC245_FIXUP_HP_TAS2781_I2C_MUTE_LED), 6751 6707 SND_PCI_QUIRK(0x1043, 0x1032, "ASUS VivoBook X513EA", ALC256_FIXUP_ASUS_MIC_NO_PRESENCE), 6752 6708 SND_PCI_QUIRK(0x1043, 0x1034, "ASUS GU605C", ALC285_FIXUP_ASUS_GU605_SPI_SPEAKER2_TO_DAC1), 6753 6709 SND_PCI_QUIRK(0x1043, 0x103e, "ASUS X540SA", ALC256_FIXUP_ASUS_MIC),