diff options
Diffstat (limited to 'sound/pci/ice1712/aureon.c')
-rw-r--r-- | sound/pci/ice1712/aureon.c | 46 |
1 files changed, 8 insertions, 38 deletions
diff --git a/sound/pci/ice1712/aureon.c b/sound/pci/ice1712/aureon.c index 3b3cf4ac9060..c9411dfff5a4 100644 --- a/sound/pci/ice1712/aureon.c +++ b/sound/pci/ice1712/aureon.c | |||
@@ -205,13 +205,7 @@ static int aureon_universe_inmux_info(struct snd_kcontrol *kcontrol, | |||
205 | static const char * const texts[3] = | 205 | static const char * const texts[3] = |
206 | {"Internal Aux", "Wavetable", "Rear Line-In"}; | 206 | {"Internal Aux", "Wavetable", "Rear Line-In"}; |
207 | 207 | ||
208 | uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED; | 208 | return snd_ctl_enum_info(uinfo, 1, 3, texts); |
209 | uinfo->count = 1; | ||
210 | uinfo->value.enumerated.items = 3; | ||
211 | if (uinfo->value.enumerated.item >= uinfo->value.enumerated.items) | ||
212 | uinfo->value.enumerated.item = uinfo->value.enumerated.items - 1; | ||
213 | strcpy(uinfo->value.enumerated.name, texts[uinfo->value.enumerated.item]); | ||
214 | return 0; | ||
215 | } | 209 | } |
216 | 210 | ||
217 | static int aureon_universe_inmux_get(struct snd_kcontrol *kcontrol, | 211 | static int aureon_universe_inmux_get(struct snd_kcontrol *kcontrol, |
@@ -1106,20 +1100,10 @@ static int wm_adc_mux_info(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_in | |||
1106 | }; | 1100 | }; |
1107 | struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol); | 1101 | struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol); |
1108 | 1102 | ||
1109 | uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED; | 1103 | if (ice->eeprom.subvendor == VT1724_SUBDEVICE_AUREON71_UNIVERSE) |
1110 | uinfo->count = 2; | 1104 | return snd_ctl_enum_info(uinfo, 2, 8, universe_texts); |
1111 | if (ice->eeprom.subvendor == VT1724_SUBDEVICE_AUREON71_UNIVERSE) { | 1105 | else |
1112 | uinfo->value.enumerated.items = 8; | 1106 | return snd_ctl_enum_info(uinfo, 2, 5, texts); |
1113 | if (uinfo->value.enumerated.item >= uinfo->value.enumerated.items) | ||
1114 | uinfo->value.enumerated.item = uinfo->value.enumerated.items - 1; | ||
1115 | strcpy(uinfo->value.enumerated.name, universe_texts[uinfo->value.enumerated.item]); | ||
1116 | } else { | ||
1117 | uinfo->value.enumerated.items = 5; | ||
1118 | if (uinfo->value.enumerated.item >= uinfo->value.enumerated.items) | ||
1119 | uinfo->value.enumerated.item = uinfo->value.enumerated.items - 1; | ||
1120 | strcpy(uinfo->value.enumerated.name, texts[uinfo->value.enumerated.item]); | ||
1121 | } | ||
1122 | return 0; | ||
1123 | } | 1107 | } |
1124 | 1108 | ||
1125 | static int wm_adc_mux_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) | 1109 | static int wm_adc_mux_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) |
@@ -1167,16 +1151,10 @@ static int aureon_cs8415_mux_info(struct snd_kcontrol *kcontrol, struct snd_ctl_ | |||
1167 | "CD", | 1151 | "CD", |
1168 | "Coax" | 1152 | "Coax" |
1169 | }; | 1153 | }; |
1170 | uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED; | ||
1171 | uinfo->count = 1; | ||
1172 | uinfo->value.enumerated.items = 2; | ||
1173 | if (uinfo->value.enumerated.item >= uinfo->value.enumerated.items) | ||
1174 | uinfo->value.enumerated.item = uinfo->value.enumerated.items - 1; | ||
1175 | if (ice->eeprom.subvendor == VT1724_SUBDEVICE_PRODIGY71) | 1154 | if (ice->eeprom.subvendor == VT1724_SUBDEVICE_PRODIGY71) |
1176 | strcpy(uinfo->value.enumerated.name, prodigy_texts[uinfo->value.enumerated.item]); | 1155 | return snd_ctl_enum_info(uinfo, 1, 2, prodigy_texts); |
1177 | else | 1156 | else |
1178 | strcpy(uinfo->value.enumerated.name, aureon_texts[uinfo->value.enumerated.item]); | 1157 | return snd_ctl_enum_info(uinfo, 1, 2, aureon_texts); |
1179 | return 0; | ||
1180 | } | 1158 | } |
1181 | 1159 | ||
1182 | static int aureon_cs8415_mux_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) | 1160 | static int aureon_cs8415_mux_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) |
@@ -1392,15 +1370,7 @@ static int aureon_oversampling_info(struct snd_kcontrol *k, struct snd_ctl_elem_ | |||
1392 | { | 1370 | { |
1393 | static const char * const texts[2] = { "128x", "64x" }; | 1371 | static const char * const texts[2] = { "128x", "64x" }; |
1394 | 1372 | ||
1395 | uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED; | 1373 | return snd_ctl_enum_info(uinfo, 1, 2, texts); |
1396 | uinfo->count = 1; | ||
1397 | uinfo->value.enumerated.items = 2; | ||
1398 | |||
1399 | if (uinfo->value.enumerated.item >= uinfo->value.enumerated.items) | ||
1400 | uinfo->value.enumerated.item = uinfo->value.enumerated.items - 1; | ||
1401 | strcpy(uinfo->value.enumerated.name, texts[uinfo->value.enumerated.item]); | ||
1402 | |||
1403 | return 0; | ||
1404 | } | 1374 | } |
1405 | 1375 | ||
1406 | static int aureon_oversampling_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) | 1376 | static int aureon_oversampling_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) |