|
@@ -182,17 +182,11 @@ static int snd_sbmixer_put_double(struct snd_kcontrol *kcontrol, struct snd_ctl_
|
|
|
|
|
|
static int snd_dt019x_input_sw_info(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo)
|
|
static int snd_dt019x_input_sw_info(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo)
|
|
{
|
|
{
|
|
- static const char *texts[5] = {
|
|
|
|
|
|
+ static const char * const texts[5] = {
|
|
"CD", "Mic", "Line", "Synth", "Master"
|
|
"CD", "Mic", "Line", "Synth", "Master"
|
|
};
|
|
};
|
|
|
|
|
|
- uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED;
|
|
|
|
- uinfo->count = 1;
|
|
|
|
- uinfo->value.enumerated.items = 5;
|
|
|
|
- if (uinfo->value.enumerated.item > 4)
|
|
|
|
- uinfo->value.enumerated.item = 4;
|
|
|
|
- strcpy(uinfo->value.enumerated.name, texts[uinfo->value.enumerated.item]);
|
|
|
|
- return 0;
|
|
|
|
|
|
+ return snd_ctl_enum_info(uinfo, 1, 5, texts);
|
|
}
|
|
}
|
|
|
|
|
|
static int snd_dt019x_input_sw_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
|
|
static int snd_dt019x_input_sw_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
|
|
@@ -275,18 +269,11 @@ static int snd_dt019x_input_sw_put(struct snd_kcontrol *kcontrol, struct snd_ctl
|
|
static int snd_als4k_mono_capture_route_info(struct snd_kcontrol *kcontrol,
|
|
static int snd_als4k_mono_capture_route_info(struct snd_kcontrol *kcontrol,
|
|
struct snd_ctl_elem_info *uinfo)
|
|
struct snd_ctl_elem_info *uinfo)
|
|
{
|
|
{
|
|
- static const char *texts[3] = {
|
|
|
|
|
|
+ static const char * const texts[3] = {
|
|
"L chan only", "R chan only", "L ch/2 + R ch/2"
|
|
"L chan only", "R chan only", "L ch/2 + R ch/2"
|
|
};
|
|
};
|
|
|
|
|
|
- uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED;
|
|
|
|
- uinfo->count = 1;
|
|
|
|
- uinfo->value.enumerated.items = 3;
|
|
|
|
- if (uinfo->value.enumerated.item > 2)
|
|
|
|
- uinfo->value.enumerated.item = 2;
|
|
|
|
- strcpy(uinfo->value.enumerated.name,
|
|
|
|
- texts[uinfo->value.enumerated.item]);
|
|
|
|
- return 0;
|
|
|
|
|
|
+ return snd_ctl_enum_info(uinfo, 1, 3, texts);
|
|
}
|
|
}
|
|
|
|
|
|
static int snd_als4k_mono_capture_route_get(struct snd_kcontrol *kcontrol,
|
|
static int snd_als4k_mono_capture_route_get(struct snd_kcontrol *kcontrol,
|
|
@@ -335,17 +322,11 @@ static int snd_als4k_mono_capture_route_put(struct snd_kcontrol *kcontrol,
|
|
|
|
|
|
static int snd_sb8mixer_info_mux(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo)
|
|
static int snd_sb8mixer_info_mux(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo)
|
|
{
|
|
{
|
|
- static const char *texts[3] = {
|
|
|
|
|
|
+ static const char * const texts[3] = {
|
|
"Mic", "CD", "Line"
|
|
"Mic", "CD", "Line"
|
|
};
|
|
};
|
|
|
|
|
|
- uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED;
|
|
|
|
- uinfo->count = 1;
|
|
|
|
- uinfo->value.enumerated.items = 3;
|
|
|
|
- if (uinfo->value.enumerated.item > 2)
|
|
|
|
- uinfo->value.enumerated.item = 2;
|
|
|
|
- strcpy(uinfo->value.enumerated.name, texts[uinfo->value.enumerated.item]);
|
|
|
|
- return 0;
|
|
|
|
|
|
+ return snd_ctl_enum_info(uinfo, 1, 3, texts);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|