ALSA: hda/realtek: Unify LED helper code
authorTakashi Iwai <tiwai@suse.de>
Thu, 18 Jun 2020 11:08:41 +0000 (13:08 +0200)
committerTakashi Iwai <tiwai@suse.de>
Thu, 18 Jun 2020 11:24:21 +0000 (13:24 +0200)
commit766538ac4af8c833990a563ed98a04a6ea5f6407
treef10145f1199a2c2809369edd9efbff752b7c27a7
parentd1d37c572cf0a10a3046e6df76f65486dc2a8ee8
ALSA: hda/realtek: Unify LED helper code

Both mute and mic-mute LED callbacks do almost similar tasks with just
different bits.  Factor out the common code and use them from the
callbacks for simplification.

This ended up with covering the forgotten stuff, too; e.g. VREF LED
handling required the temporary power up/down that was missing for the
mute LED, or some forgotten polarity checks are added.

Tested-by: Kai-Heng Feng <kai.heng.feng@canonical.com>
Link: https://lore.kernel.org/r/20200618110842.27238-13-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/pci/hda/patch_realtek.c