diff options
author | Clemens Ladisch <clemens@ladisch.de> | 2011-01-10 10:25:44 -0500 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2011-01-10 10:46:53 -0500 |
commit | 9600732b6caba595f34acf2abd930098ec9a0b2b (patch) | |
tree | 7474e1b11894623186a2acd47a388aa87fdd002e /sound/pci/oxygen/oxygen.c | |
parent | b532d6b8d3aa163e1dc143bc729e9ee92f75baf5 (diff) |
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.c')
-rw-r--r-- | sound/pci/oxygen/oxygen.c | 16 |
1 files changed, 2 insertions, 14 deletions
diff --git a/sound/pci/oxygen/oxygen.c b/sound/pci/oxygen/oxygen.c index b59aeefd14db..45427d85045e 100644 --- a/sound/pci/oxygen/oxygen.c +++ b/sound/pci/oxygen/oxygen.c | |||
@@ -415,13 +415,7 @@ static int rolloff_info(struct snd_kcontrol *ctl, | |||
415 | "Sharp Roll-off", "Slow Roll-off" | 415 | "Sharp Roll-off", "Slow Roll-off" |
416 | }; | 416 | }; |
417 | 417 | ||
418 | info->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED; | 418 | return snd_ctl_enum_info(info, 1, 2, names); |
419 | info->count = 1; | ||
420 | info->value.enumerated.items = 2; | ||
421 | if (info->value.enumerated.item >= 2) | ||
422 | info->value.enumerated.item = 1; | ||
423 | strcpy(info->value.enumerated.name, names[info->value.enumerated.item]); | ||
424 | return 0; | ||
425 | } | 419 | } |
426 | 420 | ||
427 | static int rolloff_get(struct snd_kcontrol *ctl, | 421 | static int rolloff_get(struct snd_kcontrol *ctl, |
@@ -473,13 +467,7 @@ static int hpf_info(struct snd_kcontrol *ctl, struct snd_ctl_elem_info *info) | |||
473 | "None", "High-pass Filter" | 467 | "None", "High-pass Filter" |
474 | }; | 468 | }; |
475 | 469 | ||
476 | info->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED; | 470 | return snd_ctl_enum_info(info, 1, 2, names); |
477 | info->count = 1; | ||
478 | info->value.enumerated.items = 2; | ||
479 | if (info->value.enumerated.item >= 2) | ||
480 | info->value.enumerated.item = 1; | ||
481 | strcpy(info->value.enumerated.name, names[info->value.enumerated.item]); | ||
482 | return 0; | ||
483 | } | 471 | } |
484 | 472 | ||
485 | static int hpf_get(struct snd_kcontrol *ctl, struct snd_ctl_elem_value *value) | 473 | static int hpf_get(struct snd_kcontrol *ctl, struct snd_ctl_elem_value *value) |