summaryrefslogtreecommitdiff
path: root/sound/pci/oxygen/oxygen_mixer.c
diff options
context:
space:
mode:
authorClemens Ladisch <clemens@ladisch.de>2011-01-10 18:25:44 +0300
committerTakashi Iwai <tiwai@suse.de>2011-01-10 18:46:53 +0300
commit9600732b6caba595f34acf2abd930098ec9a0b2b (patch)
tree7474e1b11894623186a2acd47a388aa87fdd002e /sound/pci/oxygen/oxygen_mixer.c
parentb532d6b8d3aa163e1dc143bc729e9ee92f75baf5 (diff)
downloadlinux-9600732b6caba595f34acf2abd930098ec9a0b2b.tar.xz
ALSA: core, oxygen, virtuoso: add an enum control info helper
Introduce the helper function snd_ctl_enum_info() to fill out the elem_info fields for an enumerated control. Signed-off-by: Clemens Ladisch <clemens@ladisch.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci/oxygen/oxygen_mixer.c')
-rw-r--r--sound/pci/oxygen/oxygen_mixer.c15
1 files changed, 2 insertions, 13 deletions
diff --git a/sound/pci/oxygen/oxygen_mixer.c b/sound/pci/oxygen/oxygen_mixer.c
index d327c36fbddf..821df1c9d1d0 100644
--- a/sound/pci/oxygen/oxygen_mixer.c
+++ b/sound/pci/oxygen/oxygen_mixer.c
@@ -119,13 +119,7 @@ static int upmix_info(struct snd_kcontrol *ctl, struct snd_ctl_elem_info *info)
struct oxygen *chip = ctl->private_data;
unsigned int count = upmix_item_count(chip);
- info->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED;
- info->count = 1;
- info->value.enumerated.items = count;
- if (info->value.enumerated.item >= count)
- info->value.enumerated.item = count - 1;
- strcpy(info->value.enumerated.name, names[info->value.enumerated.item]);
- return 0;
+ return snd_ctl_enum_info(info, 1, count, names);
}
static int upmix_get(struct snd_kcontrol *ctl, struct snd_ctl_elem_value *value)
@@ -659,12 +653,7 @@ static int mic_fmic_source_info(struct snd_kcontrol *ctl,
{
static const char *const names[] = { "Mic Jack", "Front Panel" };
- info->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED;
- info->count = 1;
- info->value.enumerated.items = 2;
- info->value.enumerated.item &= 1;
- strcpy(info->value.enumerated.name, names[info->value.enumerated.item]);
- return 0;
+ return snd_ctl_enum_info(info, 1, 2, names);
}
static int mic_fmic_source_get(struct snd_kcontrol *ctl,