diff options
author | Takashi Iwai <tiwai@suse.de> | 2014-10-20 12:16:13 -0400 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2014-10-21 02:53:54 -0400 |
commit | 9b311a0ad9ec0df9f010bcadd19193b1cee593f6 (patch) | |
tree | fbff5d6fdb1f4024ac98b034e5171367bc9539b7 /sound/pci/azt3328.c | |
parent | 4d765e48c5edb2090b82e97680b2d1ddf6d18c31 (diff) |
ALSA: azt3328: Use snd_ctl_enum_info()
... and reduce the open codes.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci/azt3328.c')
-rw-r--r-- | sound/pci/azt3328.c | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/sound/pci/azt3328.c b/sound/pci/azt3328.c index 5a69e26cb2fb..fdbb9c05c77b 100644 --- a/sound/pci/azt3328.c +++ b/sound/pci/azt3328.c | |||
@@ -1034,11 +1034,6 @@ snd_azf3328_info_mixer_enum(struct snd_kcontrol *kcontrol, | |||
1034 | const char * const *p = NULL; | 1034 | const char * const *p = NULL; |
1035 | 1035 | ||
1036 | snd_azf3328_mixer_reg_decode(®, kcontrol->private_value); | 1036 | snd_azf3328_mixer_reg_decode(®, kcontrol->private_value); |
1037 | uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED; | ||
1038 | uinfo->count = (reg.reg == IDX_MIXER_REC_SELECT) ? 2 : 1; | ||
1039 | uinfo->value.enumerated.items = reg.enum_c; | ||
1040 | if (uinfo->value.enumerated.item > reg.enum_c - 1U) | ||
1041 | uinfo->value.enumerated.item = reg.enum_c - 1U; | ||
1042 | if (reg.reg == IDX_MIXER_ADVCTL2) { | 1037 | if (reg.reg == IDX_MIXER_ADVCTL2) { |
1043 | switch(reg.lchan_shift) { | 1038 | switch(reg.lchan_shift) { |
1044 | case 8: /* modem out sel */ | 1039 | case 8: /* modem out sel */ |
@@ -1051,12 +1046,12 @@ snd_azf3328_info_mixer_enum(struct snd_kcontrol *kcontrol, | |||
1051 | p = texts4; | 1046 | p = texts4; |
1052 | break; | 1047 | break; |
1053 | } | 1048 | } |
1054 | } else | 1049 | } else if (reg.reg == IDX_MIXER_REC_SELECT) |
1055 | if (reg.reg == IDX_MIXER_REC_SELECT) | ||
1056 | p = texts3; | 1050 | p = texts3; |
1057 | 1051 | ||
1058 | strcpy(uinfo->value.enumerated.name, p[uinfo->value.enumerated.item]); | 1052 | return snd_ctl_enum_info(uinfo, |
1059 | return 0; | 1053 | (reg.reg == IDX_MIXER_REC_SELECT) ? 2 : 1, |
1054 | reg.enum_c, p); | ||
1060 | } | 1055 | } |
1061 | 1056 | ||
1062 | static int | 1057 | static int |