Skip to contentSkip to conversation

ALSA: hda/realtek: Add mic-mute LED quirk for the HP 245 14 inch G10

PATCH Applied Keane Mbae 2 participants 2 messages Oct 17 – Oct 18 Sound

lore
Share & tools
lore

Keane Mbae

author
#0 lore raw

PATCH 1/1 ALSA: hda/realtek: Add mic-mute LED quirk for the HP 245 14 inch G10

The HP 245 14 inch G10 Notebook PC (codec SSID 103c:8ba4, ALC236) is not listed in alc269_fixup_tbl[], so the codec falls back to the vendor-wide HP entry (ALC269_FIXUP_HP_MUTE_LED). That entry only registers a speaker mute LED (hda::mute); no microphone mute LED class device (hda::micmute) is created, so muting the microphone never lights the LED on the F8 key.

On this model the microphone mute LED is wired to COEF 0x35 bits 2-3 (the same register as ALC236_FIXUP_HP_MUTE_LED), but with the opposite sense:
1 << 2 lights the LED and 2 << 2 turns it off. Setting micmute_led_polarity = 1 makes alc_update_coef_led() write the level that matches the hardware.

The speaker mute LED (F5) keeps being driven through the HP_Mute_LED DMI string, exactly as the current fallback does.

Add ALC236_FIXUP_HP_MUTE_LED_MICMUTE_COEF_INV for 103c:8ba4.

---
 sound/hda/codecs/realtek/alc269.c | 26 ++++++++++++++++++++++++++
 1 file changed, 26 insertions(+)
sound/hda/codecs/realtek/alc269.c +26 -0
index 1623cf9..25f5b51 100644
@@ -1754,6 +1754,25 @@ static void alc295_fixup_hp_pavilion_mute_led_1b(struct hda_codec *codec,
 		spec->mute_led_nid = 0x1b;
 }
 
+/*
+ * HP 245 14 inch G10 Notebook PC (SSID 103c:8ba4): the speaker mute LED is
+ * controlled through the HP_Mute_LED DMI string (NID 0x1a), same as the
+ * ALC269_FIXUP_HP_MUTE_LED fallback, but the microphone mute LED is wired to
+ * COEF 0x35 bits 2-3 with an inverted sense.
+ */
+static void alc236_fixup_hp_mute_led_micmute_coef_inv(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->micmute_led_polarity = 1;
+
+	alc269_fixup_hp_mute_led(codec, fix, action);
+	alc236_fixup_hp_coef_micmute_led(codec, fix, action);
+}
+
 static void alc233_fixup_lenovo_coef_micmute_led(struct hda_codec *codec,
 				const struct hda_fixup *fix, int action)
 {
@@ -4237,6 +4256,7 @@ enum {
 	ALC236_FIXUP_HP_MUTE_LED_COEFBIT2,
 	ALC236_FIXUP_HP_GPIO_LED,
 	ALC236_FIXUP_HP_MUTE_LED,
+	ALC236_FIXUP_HP_MUTE_LED_MICMUTE_COEF_INV,
 	ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF,
 	ALC236_FIXUP_HP_15_FD0XXX,
 	ALC236_FIXUP_LENOVO_INV_DMIC,
@@ -6033,6 +6053,10 @@ static const struct hda_fixup alc269_fixups[] = {
 		.type = HDA_FIXUP_FUNC,
 		.v.func = alc236_fixup_hp_mute_led_micmute_vref,
 	},
+	[ALC236_FIXUP_HP_MUTE_LED_MICMUTE_COEF_INV] = {
+		.type = HDA_FIXUP_FUNC,
+		.v.func = alc236_fixup_hp_mute_led_micmute_coef_inv,
+	},
 	[ALC236_FIXUP_HP_MUTE_LED_MICMUTE_GPIO] = {
 		.type = HDA_FIXUP_FUNC,
 		.v.func = alc236_fixup_hp_mute_led_micmute_gpio,
@@ -7622,6 +7646,8 @@ static const struct hda_quirk alc269_fixup_tbl[] = {
 	SND_PCI_QUIRK(0x103c, 0x8b92, "HP", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
 	SND_PCI_QUIRK(0x103c, 0x8b96, "HP", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
 	SND_PCI_QUIRK(0x103c, 0x8b97, "HP", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
+	SND_PCI_QUIRK(0x103c, 0x8ba4, "HP 245 14 inch G10 Notebook PC",
+		      ALC236_FIXUP_HP_MUTE_LED_MICMUTE_COEF_INV),
 	SND_PCI_QUIRK(0x103c, 0x8ba9, "HP Omen 16-wd0xxx", ALC245_FIXUP_HP_MUTE_LED_V1_COEFBIT),
 	SND_PCI_QUIRK(0x103c, 0x8bb1, "HP Victus 15-fa1xxx (MB 8BB1)", ALC245_FIXUP_HP_MUTE_LED_COEFBIT),
 	SND_PCI_QUIRK(0x103c, 0x8bb3, "HP Slim OMEN", ALC287_FIXUP_CS35L41_I2C_2),
Signature · 1 line
2.56.0
Applied
#1 lore raw
Quoted 13 lines · Keane Mbae

The HP 245 14 inch G10 Notebook PC (codec SSID 103c:8ba4, ALC236) is not listed in alc269_fixup_tbl[], so the codec falls back to the vendor-wide HP entry (ALC269_FIXUP_HP_MUTE_LED). That entry only registers a speaker mute LED (hda::mute); no microphone mute LED class device (hda::micmute) is created, so muting the microphone never lights the LED on the F8 key.

On this model the microphone mute LED is wired to COEF 0x35 bits 2-3 (the same register as ALC236_FIXUP_HP_MUTE_LED), but with the opposite sense:
1 << 2 lights the LED and 2 << 2 turns it off. Setting micmute_led_polarity = 1 makes alc_update_coef_led() write the level that matches the hardware.

Quoted 7 lines

The speaker mute LED (F5) keeps being driven through the HP_Mute_LED DMI string, exactly as the current fallback does.

Add ALC236_FIXUP_HP_MUTE_LED_MICMUTE_COEF_INV for 103c:8ba4.

Applied to for-next branch. Thanks.

Takashi