* [PATCH] ALSA: hda/realtek: Add quirk for mute LEDs on HP ENVY x360 15-eu0xxx
@ 2023-08-24 15:57 Fabian Vogt
2023-08-24 17:37 ` SungHwan Jung
0 siblings, 1 reply; 5+ messages in thread
From: Fabian Vogt @ 2023-08-24 15:57 UTC (permalink / raw)
To: Jaroslav Kysela, Takashi Iwai; +Cc: alsa-devel, linux-kernel, SungHwan Jung
The LED for the mic mute button is controlled by GPIO2.
The mute button LED is slightly more complex, it's controlled by two bits
in coeff 0x0b. Add a fixup for the mute LED and chain to an existing fixup
for the mic mute LED.
Signed-off-by: Fabian Vogt <fabian@ritter-vogt.de>
---
Applies on top of 89bf6209cad6.
I see that SungHwan Jung (CC'd) recently submitted the same fixup for
a rather similar but different model as
"ALSA: hda/realtek: Add quirk for HP Victus 16-d1xxx to enable mute LED"
Does your HP Victus also need the ALC245_FIXUP_HP_GPIO_LED? Then we could
combine the quirks.
sound/pci/hda/patch_realtek.c | 26 ++++++++++++++++++++++++++
1 file changed, 26 insertions(+)
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
index dc7b7a407638..cac207d7c0b9 100644
--- a/sound/pci/hda/patch_realtek.c
+++ b/sound/pci/hda/patch_realtek.c
@@ -4639,6 +4639,24 @@ static void alc236_fixup_hp_mute_led_coefbit2(struct hda_codec *codec,
}
}
+/* The mute LED is controlled by two bits in coef 0x0b:
+ * To turn on, set bit 3 but clear bit 2.
+ */
+static void alc245_fixup_hp_x360_mute_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->mute_led_polarity = 0;
+ spec->mute_led_coef.idx = 0x0b;
+ spec->mute_led_coef.mask = 0xc;
+ spec->mute_led_coef.on = 0x8;
+ spec->mute_led_coef.off = 0x4;
+ snd_hda_gen_add_mute_led_cdev(codec, coef_mute_led_set);
+ }
+}
+
/* turn on/off mic-mute LED per capture hook by coef bit */
static int coef_micmute_led_set(struct led_classdev *led_cdev,
enum led_brightness brightness)
@@ -7231,6 +7249,7 @@ enum {
ALC295_FIXUP_DELL_INSPIRON_TOP_SPEAKERS,
ALC236_FIXUP_DELL_DUAL_CODECS,
ALC287_FIXUP_CS35L41_I2C_2_THINKPAD_ACPI,
+ ALC245_FIXUP_HP_X360_MUTE_LED,
};
/* A special fixup for Lenovo C940 and Yoga Duet 7;
@@ -9309,6 +9328,12 @@ static const struct hda_fixup alc269_fixups[] = {
.chained = true,
.chain_id = ALC269_FIXUP_THINKPAD_ACPI,
},
+ [ALC245_FIXUP_HP_X360_MUTE_LED] = {
+ .type = HDA_FIXUP_FUNC,
+ .v.func = alc245_fixup_hp_x360_mute_led,
+ .chained = true,
+ .chain_id = ALC245_FIXUP_HP_GPIO_LED
+ },
};
static const struct snd_pci_quirk alc269_fixup_tbl[] = {
@@ -9551,6 +9576,7 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = {
SND_PCI_QUIRK(0x103c, 0x8870, "HP ZBook Fury 15.6 Inch G8 Mobile Workstation PC", ALC285_FIXUP_HP_GPIO_AMP_INIT),
SND_PCI_QUIRK(0x103c, 0x8873, "HP ZBook Studio 15.6 Inch G8 Mobile Workstation PC", ALC285_FIXUP_HP_GPIO_AMP_INIT),
SND_PCI_QUIRK(0x103c, 0x887a, "HP Laptop 15s-eq2xxx", ALC236_FIXUP_HP_MUTE_LED_COEFBIT2),
+ SND_PCI_QUIRK(0x103c, 0x888a, "HP ENVY x360 Convertible 15-eu0xxx", ALC245_FIXUP_HP_X360_MUTE_LED),
SND_PCI_QUIRK(0x103c, 0x888d, "HP ZBook Power 15.6 inch G8 Mobile Workstation PC", ALC236_FIXUP_HP_GPIO_LED),
SND_PCI_QUIRK(0x103c, 0x8895, "HP EliteBook 855 G8 Notebook PC", ALC285_FIXUP_HP_SPEAKERS_MICMUTE_LED),
SND_PCI_QUIRK(0x103c, 0x8896, "HP EliteBook 855 G8 Notebook PC", ALC285_FIXUP_HP_MUTE_LED),
--
2.41.0
^ permalink raw reply related [flat|nested] 5+ messages in thread* Re: [PATCH] ALSA: hda/realtek: Add quirk for mute LEDs on HP ENVY x360 15-eu0xxx
2023-08-24 15:57 [PATCH] ALSA: hda/realtek: Add quirk for mute LEDs on HP ENVY x360 15-eu0xxx Fabian Vogt
@ 2023-08-24 17:37 ` SungHwan Jung
2023-08-24 17:44 ` Takashi Iwai
0 siblings, 1 reply; 5+ messages in thread
From: SungHwan Jung @ 2023-08-24 17:37 UTC (permalink / raw)
To: fabian; +Cc: alsa-devel, linux-kernel, onenowy, perex, tiwai
On Fri, Aug 25, 2023 at 12:57 AM Fabian Vogt <fabian@ritter-vogt.de> wrote:
> I see that SungHwan Jung (CC'd) recently submitted the same fixup for
> a rather similar but different model as
> "ALSA: hda/realtek: Add quirk for HP Victus 16-d1xxx to enable mute LED"
> Does your HP Victus also need the ALC245_FIXUP_HP_GPIO_LED? Then we could
> combine the quirks.
These victus laptops don't need ALC245_FIXUP_HP_GPIO_LED, but we can make
alc245_fixup_hp_x360_mute_led and alc245_fixup_hp_mute_led_coefbit into
one function.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] ALSA: hda/realtek: Add quirk for mute LEDs on HP ENVY x360 15-eu0xxx
2023-08-24 17:37 ` SungHwan Jung
@ 2023-08-24 17:44 ` Takashi Iwai
2023-08-24 18:39 ` [PATCH v2] " Fabian Vogt
0 siblings, 1 reply; 5+ messages in thread
From: Takashi Iwai @ 2023-08-24 17:44 UTC (permalink / raw)
To: SungHwan Jung; +Cc: fabian, alsa-devel, linux-kernel, perex, tiwai
On Thu, 24 Aug 2023 19:37:18 +0200,
SungHwan Jung wrote:
>
> On Fri, Aug 25, 2023 at 12:57 AM Fabian Vogt <fabian@ritter-vogt.de> wrote:
> > I see that SungHwan Jung (CC'd) recently submitted the same fixup for
> > a rather similar but different model as
> > "ALSA: hda/realtek: Add quirk for HP Victus 16-d1xxx to enable mute LED"
> > Does your HP Victus also need the ALC245_FIXUP_HP_GPIO_LED? Then we could
> > combine the quirks.
>
> These victus laptops don't need ALC245_FIXUP_HP_GPIO_LED, but we can make
> alc245_fixup_hp_x360_mute_led and alc245_fixup_hp_mute_led_coefbit into
> one function.
ShungHwan's patch was already merged, so we can just reuse the
function in a new quirk; ALC245_FIXUP_HP_X360_MUTE_LED will be calling
alc245_fixup_hp_mute_led_coefbit and chained to
ALC245_FIXUP_HP_GPIO_LED.
Fabian, could you resubmit such a patch?
thanks,
Takashi
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH v2] ALSA: hda/realtek: Add quirk for mute LEDs on HP ENVY x360 15-eu0xxx
2023-08-24 17:44 ` Takashi Iwai
@ 2023-08-24 18:39 ` Fabian Vogt
2023-08-25 7:49 ` Takashi Iwai
0 siblings, 1 reply; 5+ messages in thread
From: Fabian Vogt @ 2023-08-24 18:39 UTC (permalink / raw)
To: SungHwan Jung, Takashi Iwai; +Cc: alsa-devel, linux-kernel, perex
The LED for the mic mute button is controlled by GPIO2.
The mute button LED is slightly more complex, it's controlled by two bits
in coeff 0x0b.
Signed-off-by: Fabian Vogt <fabian@ritter-vogt.de>
---
Changes since v1:
Rebased on 03b0563c2f35. I've got this laptop for almost two years now and
two days ago decided to dig into the issue with mute LEDs. What amazing timing
that someone else made the exact same fixup for a different model just hours
before I submit...
Renamed quirk to ..._LEDS to distinguish it from the similar quirk which
handles only one of the mute LEDs.
sound/pci/hda/patch_realtek.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
index afc63d367fd5..a07df6f92960 100644
--- a/sound/pci/hda/patch_realtek.c
+++ b/sound/pci/hda/patch_realtek.c
@@ -7318,6 +7318,7 @@ enum {
ALC287_FIXUP_CS35L41_I2C_2_THINKPAD_ACPI,
ALC287_FIXUP_TAS2781_I2C,
ALC245_FIXUP_HP_MUTE_LED_COEFBIT,
+ ALC245_FIXUP_HP_X360_MUTE_LEDS,
};
/* A special fixup for Lenovo C940 and Yoga Duet 7;
@@ -9406,6 +9407,12 @@ static const struct hda_fixup alc269_fixups[] = {
.type = HDA_FIXUP_FUNC,
.v.func = alc245_fixup_hp_mute_led_coefbit,
},
+ [ALC245_FIXUP_HP_X360_MUTE_LEDS] = {
+ .type = HDA_FIXUP_FUNC,
+ .v.func = alc245_fixup_hp_mute_led_coefbit,
+ .chained = true,
+ .chain_id = ALC245_FIXUP_HP_GPIO_LED
+ },
};
static const struct snd_pci_quirk alc269_fixup_tbl[] = {
@@ -9648,6 +9655,7 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = {
SND_PCI_QUIRK(0x103c, 0x8870, "HP ZBook Fury 15.6 Inch G8 Mobile Workstation PC", ALC285_FIXUP_HP_GPIO_AMP_INIT),
SND_PCI_QUIRK(0x103c, 0x8873, "HP ZBook Studio 15.6 Inch G8 Mobile Workstation PC", ALC285_FIXUP_HP_GPIO_AMP_INIT),
SND_PCI_QUIRK(0x103c, 0x887a, "HP Laptop 15s-eq2xxx", ALC236_FIXUP_HP_MUTE_LED_COEFBIT2),
+ SND_PCI_QUIRK(0x103c, 0x888a, "HP ENVY x360 Convertible 15-eu0xxx", ALC245_FIXUP_HP_X360_MUTE_LEDS),
SND_PCI_QUIRK(0x103c, 0x888d, "HP ZBook Power 15.6 inch G8 Mobile Workstation PC", ALC236_FIXUP_HP_GPIO_LED),
SND_PCI_QUIRK(0x103c, 0x8895, "HP EliteBook 855 G8 Notebook PC", ALC285_FIXUP_HP_SPEAKERS_MICMUTE_LED),
SND_PCI_QUIRK(0x103c, 0x8896, "HP EliteBook 855 G8 Notebook PC", ALC285_FIXUP_HP_MUTE_LED),
--
2.41.0
^ permalink raw reply related [flat|nested] 5+ messages in thread* Re: [PATCH v2] ALSA: hda/realtek: Add quirk for mute LEDs on HP ENVY x360 15-eu0xxx
2023-08-24 18:39 ` [PATCH v2] " Fabian Vogt
@ 2023-08-25 7:49 ` Takashi Iwai
0 siblings, 0 replies; 5+ messages in thread
From: Takashi Iwai @ 2023-08-25 7:49 UTC (permalink / raw)
To: Fabian Vogt; +Cc: SungHwan Jung, alsa-devel, linux-kernel, perex
On Thu, 24 Aug 2023 20:39:48 +0200,
Fabian Vogt wrote:
>
> The LED for the mic mute button is controlled by GPIO2.
> The mute button LED is slightly more complex, it's controlled by two bits
> in coeff 0x0b.
>
> Signed-off-by: Fabian Vogt <fabian@ritter-vogt.de>
> ---
> Changes since v1:
> Rebased on 03b0563c2f35. I've got this laptop for almost two years now and
> two days ago decided to dig into the issue with mute LEDs. What amazing timing
> that someone else made the exact same fixup for a different model just hours
> before I submit...
> Renamed quirk to ..._LEDS to distinguish it from the similar quirk which
> handles only one of the mute LEDs.
Applied now. Thanks.
BTW, at the next time you post a v2 patch, it's better to start a new
thread instead of hanging to the old thread.
Takashi
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2023-08-25 7:51 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-08-24 15:57 [PATCH] ALSA: hda/realtek: Add quirk for mute LEDs on HP ENVY x360 15-eu0xxx Fabian Vogt
2023-08-24 17:37 ` SungHwan Jung
2023-08-24 17:44 ` Takashi Iwai
2023-08-24 18:39 ` [PATCH v2] " Fabian Vogt
2023-08-25 7:49 ` Takashi Iwai
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox