]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commit
ALSA: hda: generic: Fix the micmute led init state
authorHui Wang <hui.wang@canonical.com>
Fri, 12 Mar 2021 04:14:08 +0000 (12:14 +0800)
committerSeth Forshee <seth.forshee@canonical.com>
Thu, 8 Apr 2021 20:42:09 +0000 (15:42 -0500)
commit163518131048d81d450339dfa3ccc9e94296b822
treed1fc086a35a390bc3c238ba09f29afd44b302cf8
parent93f6a67e71195e4a4e42b3c9b1c5db3d5f82bf56
ALSA: hda: generic: Fix the micmute led init state

BugLink: https://bugs.launchpad.net/bugs/1921712
commit 2bf44e0ee95f39cc54ea1b942f0a027e0181ca4e upstream.

Recently we found the micmute led init state is not correct after
freshly installing the ubuntu linux on a Lenovo AIO machine. The
internal mic is not muted, but the micmute led is on and led mode is
'follow mute'. If we mute internal mic, the led is keeping on, then
unmute the internal mic, the led is off. And from then on, the
micmute led will work correctly.

So the micmute led init state is not correct. The led is controlled
by codec gpio (ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY), in the
patch_realtek, the gpio data is set to 0x4 initially and the led is
on with this data. In the hda_generic, the led_value is set to
0 initially, suppose users set the 'capture switch' to on from
user space and the micmute led should change to be off with this
operation, but the check "if (val == spec->micmute_led.led_value)" in
the call_micmute_led_update() will skip the led setting.

To guarantee the led state will be set by the 1st time of changing
"Capture Switch", set -1 to the init led_value.

Cc: <stable@vger.kernel.org>
Signed-off-by: Hui Wang <hui.wang@canonical.com>
Link: https://lore.kernel.org/r/20210312041408.3776-1-hui.wang@canonical.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
sound/pci/hda/hda_generic.c