ALSA: hda - reverse the setting value in the micmute_led_set
diff mbox series

Message ID 20200811122430.6546-1-hui.wang@canonical.com
State New
Headers show
Series
  • ALSA: hda - reverse the setting value in the micmute_led_set
Related show

Commit Message

Hui Wang Aug. 11, 2020, 12:24 p.m. UTC
Before the micmute_led_set() is introduced, the function of
alc_gpio_micmute_update() will set the gpio value with the
!micmute_led.led_value, and the machines have the correct micmute led
status. After the micmute_led_set() is introduced, it sets the gpio
value with !!micmute_led.led_value, so the led status is not correct
anymore, we need to set micmute_led_polarity = 1 to workaround it.

Now we fix the micmute_led_set() and remove micmute_led_polarity = 1.

Fixes: 87dc36482cab ("ALSA: hda/realtek - Add LED class support for micmute LED")
Reported-and-suggested-by: Kai-Heng Feng <kai.heng.feng@canonical.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Hui Wang <hui.wang@canonical.com>
---
 sound/pci/hda/patch_realtek.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

Comments

Takashi Iwai Aug. 11, 2020, 12:51 p.m. UTC | #1
On Tue, 11 Aug 2020 14:24:30 +0200,
Hui Wang wrote:
> 
> Before the micmute_led_set() is introduced, the function of
> alc_gpio_micmute_update() will set the gpio value with the
> !micmute_led.led_value, and the machines have the correct micmute led
> status. After the micmute_led_set() is introduced, it sets the gpio
> value with !!micmute_led.led_value, so the led status is not correct
> anymore, we need to set micmute_led_polarity = 1 to workaround it.
> 
> Now we fix the micmute_led_set() and remove micmute_led_polarity = 1.
> 
> Fixes: 87dc36482cab ("ALSA: hda/realtek - Add LED class support for micmute LED")
> Reported-and-suggested-by: Kai-Heng Feng <kai.heng.feng@canonical.com>
> Cc: <stable@vger.kernel.org>
> Signed-off-by: Hui Wang <hui.wang@canonical.com>

Thanks, applied.


Takashi

Patch
diff mbox series

diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
index 09d93dd88713..073029aeaf3c 100644
--- a/sound/pci/hda/patch_realtek.c
+++ b/sound/pci/hda/patch_realtek.c
@@ -4125,7 +4125,7 @@  static int micmute_led_set(struct led_classdev *led_cdev,
 	struct alc_spec *spec = codec->spec;
 
 	alc_update_gpio_led(codec, spec->gpio_mic_led_mask,
-			    spec->micmute_led_polarity, !!brightness);
+			    spec->micmute_led_polarity, !brightness);
 	return 0;
 }
 
@@ -4162,8 +4162,6 @@  static void alc285_fixup_hp_gpio_led(struct hda_codec *codec,
 {
 	struct alc_spec *spec = codec->spec;
 
-	spec->micmute_led_polarity = 1;
-
 	alc_fixup_hp_gpio_led(codec, action, 0x04, 0x01);
 }
 
@@ -4414,7 +4412,6 @@  static void alc233_fixup_lenovo_line2_mic_hotkey(struct hda_codec *codec,
 {
 	struct alc_spec *spec = codec->spec;
 
-	spec->micmute_led_polarity = 1;
 	alc_fixup_hp_gpio_led(codec, action, 0, 0x04);
 	if (action == HDA_FIXUP_ACT_PRE_PROBE) {
 		spec->init_amp = ALC_INIT_DEFAULT;