aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/hda/patch_via.c
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2012-11-30 12:34:38 -0500
committerTakashi Iwai <tiwai@suse.de>2012-11-30 12:34:38 -0500
commitdda415d41882449f841f88d829dd65b6ee1c374c (patch)
treedde9f520ddf3466235bf60d610f54383a4d76f9c /sound/pci/hda/patch_via.c
parent475c3d21e8e1fe7cbec76b0f3e8d9f4dea66acd8 (diff)
ALSA: hda - Add a helper function for simple enum kcontrols
The same type of code is being used in multiple places in various codec drivers, so put it as a core library. Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci/hda/patch_via.c')
-rw-r--r--sound/pci/hda/patch_via.c13
1 files changed, 1 insertions, 12 deletions
diff --git a/sound/pci/hda/patch_via.c b/sound/pci/hda/patch_via.c
index 274644f6bd48..dd8cd6af5d66 100644
--- a/sound/pci/hda/patch_via.c
+++ b/sound/pci/hda/patch_via.c
@@ -739,18 +739,7 @@ static void set_pin_power_state(struct hda_codec *codec, hda_nid_t nid,
739static int via_pin_power_ctl_info(struct snd_kcontrol *kcontrol, 739static int via_pin_power_ctl_info(struct snd_kcontrol *kcontrol,
740 struct snd_ctl_elem_info *uinfo) 740 struct snd_ctl_elem_info *uinfo)
741{ 741{
742 static const char * const texts[] = { 742 return snd_hda_enum_bool_helper_info(kcontrol, uinfo);
743 "Disabled", "Enabled"
744 };
745
746 uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED;
747 uinfo->count = 1;
748 uinfo->value.enumerated.items = 2;
749 if (uinfo->value.enumerated.item >= uinfo->value.enumerated.items)
750 uinfo->value.enumerated.item = uinfo->value.enumerated.items - 1;
751 strcpy(uinfo->value.enumerated.name,
752 texts[uinfo->value.enumerated.item]);
753 return 0;
754} 743}
755 744
756static int via_pin_power_ctl_get(struct snd_kcontrol *kcontrol, 745static int via_pin_power_ctl_get(struct snd_kcontrol *kcontrol,