diff options
author | Takashi Iwai <tiwai@suse.de> | 2012-11-30 18:34:38 +0100 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2012-11-30 18:34:38 +0100 |
commit | dda415d41882449f841f88d829dd65b6ee1c374c (patch) | |
tree | dde9f520ddf3466235bf60d610f54383a4d76f9c /sound/pci/hda/patch_via.c | |
parent | 475c3d21e8e1fe7cbec76b0f3e8d9f4dea66acd8 (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.c | 13 |
1 files changed, 1 insertions, 12 deletions
diff --git a/sound/pci/hda/patch_via.c b/sound/pci/hda/patch_via.c index 274644f6bd4..dd8cd6af5d6 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, static int via_pin_power_ctl_info(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo) { - static const char * const texts[] = { - "Disabled", "Enabled" - }; - - uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED; - uinfo->count = 1; - uinfo->value.enumerated.items = 2; - if (uinfo->value.enumerated.item >= uinfo->value.enumerated.items) - uinfo->value.enumerated.item = uinfo->value.enumerated.items - 1; - strcpy(uinfo->value.enumerated.name, - texts[uinfo->value.enumerated.item]); - return 0; + return snd_hda_enum_bool_helper_info(kcontrol, uinfo); } static int via_pin_power_ctl_get(struct snd_kcontrol *kcontrol, |