ALSA: azt3328: Use snd_ctl_enum_info()
... and reduce the open codes. Signed-off-by: Takashi Iwai <tiwai@suse.de>
This commit is contained in:
parent
4d765e48c5
commit
9b311a0ad9
@ -1034,11 +1034,6 @@ snd_azf3328_info_mixer_enum(struct snd_kcontrol *kcontrol,
|
|||||||
const char * const *p = NULL;
|
const char * const *p = NULL;
|
||||||
|
|
||||||
snd_azf3328_mixer_reg_decode(®, kcontrol->private_value);
|
snd_azf3328_mixer_reg_decode(®, kcontrol->private_value);
|
||||||
uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED;
|
|
||||||
uinfo->count = (reg.reg == IDX_MIXER_REC_SELECT) ? 2 : 1;
|
|
||||||
uinfo->value.enumerated.items = reg.enum_c;
|
|
||||||
if (uinfo->value.enumerated.item > reg.enum_c - 1U)
|
|
||||||
uinfo->value.enumerated.item = reg.enum_c - 1U;
|
|
||||||
if (reg.reg == IDX_MIXER_ADVCTL2) {
|
if (reg.reg == IDX_MIXER_ADVCTL2) {
|
||||||
switch(reg.lchan_shift) {
|
switch(reg.lchan_shift) {
|
||||||
case 8: /* modem out sel */
|
case 8: /* modem out sel */
|
||||||
@ -1051,12 +1046,12 @@ snd_azf3328_info_mixer_enum(struct snd_kcontrol *kcontrol,
|
|||||||
p = texts4;
|
p = texts4;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
} else
|
} else if (reg.reg == IDX_MIXER_REC_SELECT)
|
||||||
if (reg.reg == IDX_MIXER_REC_SELECT)
|
|
||||||
p = texts3;
|
p = texts3;
|
||||||
|
|
||||||
strcpy(uinfo->value.enumerated.name, p[uinfo->value.enumerated.item]);
|
return snd_ctl_enum_info(uinfo,
|
||||||
return 0;
|
(reg.reg == IDX_MIXER_REC_SELECT) ? 2 : 1,
|
||||||
|
reg.enum_c, p);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
|
Loading…
x
Reference in New Issue
Block a user