ALSA: hda - Introduce snd_hda_set_pin_ctl*() helper functions
authorTakashi Iwai <tiwai@suse.de>
Fri, 20 Apr 2012 10:34:50 +0000 (12:34 +0200)
committerTakashi Iwai <tiwai@suse.de>
Fri, 20 Apr 2012 10:38:48 +0000 (12:38 +0200)
commitcdd03cedc5b55da017fcdeff7d47cac2639cded8
treeb0b8b8360eb22f79b81ded6ef9981639be15010d
parentd39801105722c9aef9eae180656190c399c576a9
ALSA: hda - Introduce snd_hda_set_pin_ctl*() helper functions

For setting the pin-control values more safely to match with the
actual pin capability bits, a copule of new helper functions,
snd_hda_set_pin_ctl() and snd_hda_set_pin_ctl_cache(), are
introduced.  These are simple replacement of the codec verb write with
AC_VERB_SET_PIN_WIDGET but do more sanity checks and filter out
superfluous pin-control bits if they don't fit with the corresponding
pin capabilities.

Some codecs are screwed up or ignore the command when such a wrong bit
is set.  These helpers will avoid such secret errors.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/pci/hda/hda_codec.c
sound/pci/hda/hda_local.h
sound/pci/hda/patch_analog.c
sound/pci/hda/patch_ca0110.c
sound/pci/hda/patch_ca0132.c
sound/pci/hda/patch_cirrus.c
sound/pci/hda/patch_conexant.c
sound/pci/hda/patch_realtek.c
sound/pci/hda/patch_sigmatel.c
sound/pci/hda/patch_via.c