ASoC: Remove unused snd_soc_info_volsw_ext()
PATCH 1/2 ASoC: Remove unused snd_soc_info_volsw_ext()
The SOC_SINGLE_EXT control has been using snd_soc_info_volsw() for its info callback since commit 1c433fb ("[ALSA] soc - 0.13 ASoC headers"). The snd_soc_info_volsw_ext() function has been unused ever since then, so remove it.
--- include/sound/soc.h | 2 -- sound/soc/soc-core.c | 26 -------------------------- 2 files changed, 28 deletions(-)
include/sound/soc.h +0 -2
@@ -499,8 +499,6 @@ int snd_soc_put_value_enum_double(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol);int snd_soc_info_volsw (struct snd_kcontrol *kcontrol,struct snd_ctl_elem_info *uinfo); -int snd_soc_info_volsw_ext (struct snd_kcontrol *kcontrol, -struct snd_ctl_elem_info *uinfo);#define snd_soc_info_bool_ext snd_ctl_boolean_mono_infoint snd_soc_get_volsw (struct snd_kcontrol *kcontrol,struct snd_ctl_elem_value *ucontrol);
sound/soc/soc-core.c +0 -26
@@ -2594,32 +2594,6 @@ int snd_soc_info_enum_ext(struct snd_kcontrol *kcontrol,EXPORT_SYMBOL_GPL (snd_soc_info_enum_ext);/** -* snd_soc_info_volsw_ext - external single mixer info callback -* @kcontrol: mixer control -* @uinfo: control element information -* -* Callback to provide information about a single external mixer control. -* -* Returns 0 for success. -*/ -int snd_soc_info_volsw_ext (struct snd_kcontrol *kcontrol, -struct snd_ctl_elem_info *uinfo) -{ -int max = kcontrol->private_value; - -if (max ==1 && !strstr (kcontrol->id.name," Volume" )) - uinfo->type =SNDRV_CTL_ELEM_TYPE_BOOLEAN ; -else - uinfo->type =SNDRV_CTL_ELEM_TYPE_INTEGER ; - - uinfo->count =1 ; - uinfo->value.integer.min =0 ; - uinfo->value.integer.max = max; -return 0 ; -} -EXPORT_SYMBOL_GPL (snd_soc_info_volsw_ext); - -/** * snd_soc_info_volsw - single mixer info callback * @kcontrol: mixer control * @uinfo: control element information
Signature · 1 line
1.8.0
PATCH 2/2 ASoC: Use snd_soc_info_enum_double() for SOC_ENUM_EXT controls
snd_soc_info_enum_ext() and snd_soc_info_enum_double() are almost identical. The only difference is that snd_soc_info_enum_double() is also able to handle stereo controls. Using snd_soc_info_enum double() instead of snd_soc_info_enum_ext() for the SOC_ENUM_EXT control's info callback allows us to remove snd_soc_info_enum_ext().
--- include/sound/soc.h | 4 +--- sound/soc/soc-core.c | 27 --------------------------- 2 files changed, 1 insertion(+), 30 deletions(-)
include/sound/soc.h +1 -3
@@ -234,7 +234,7 @@ .private_value = xdata }#define SOC_ENUM_EXT (xname, xenum, xhandler_get, xhandler_put) \ { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \ - .info = snd_soc_info_enum_ext, \ + .info = snd_soc_info_enum_double, \ .get = xhandler_get, .put = xhandler_put, \ .private_value = (unsigned long)&xenum }
@@ -487,8 +487,6 @@ int snd_soc_add_dai_controls(struct snd_soc_dai *dai, const struct snd_kcontrol_new *controls, int num_controls);int snd_soc_info_enum_double (struct snd_kcontrol *kcontrol,struct snd_ctl_elem_info *uinfo); -int snd_soc_info_enum_ext (struct snd_kcontrol *kcontrol, -struct snd_ctl_elem_info *uinfo);int snd_soc_get_enum_double (struct snd_kcontrol *kcontrol,struct snd_ctl_elem_value *ucontrol); int snd_soc_put_enum_double(struct snd_kcontrol *kcontrol,
sound/soc/soc-core.c +0 -27
@@ -2567,33 +2567,6 @@ int snd_soc_put_value_enum_double(struct snd_kcontrol *kcontrol,EXPORT_SYMBOL_GPL (snd_soc_put_value_enum_double);/** -* snd_soc_info_enum_ext - external enumerated single mixer info callback -* @kcontrol: mixer control -* @uinfo: control element information -* -* Callback to provide information about an external enumerated -* single mixer. -* -* Returns 0 for success. -*/ -int snd_soc_info_enum_ext (struct snd_kcontrol *kcontrol, -struct snd_ctl_elem_info *uinfo) -{ -struct soc_enum *e = (struct soc_enum *)kcontrol->private_value; - - uinfo->type =SNDRV_CTL_ELEM_TYPE_ENUMERATED ; - uinfo->count =1 ; - uinfo->value.enumerated.items = e->max; - -if (uinfo->value.enumerated.item > e->max -1 ) - uinfo->value.enumerated.item = e->max -1 ; -strcpy (uinfo->value.enumerated.name, - e->texts[uinfo->value.enumerated.item]); -return 0 ; -} -EXPORT_SYMBOL_GPL (snd_soc_info_enum_ext); - -/** * snd_soc_info_volsw - single mixer info callback * @kcontrol: mixer control * @uinfo: control element information
Signature · 1 line
1.8.0
Quoted 3 lines · Lars-Peter Clausen
The
SOC_SINGLE_EXTcontrol has been usingsnd_soc_info_volsw()for its info callback since commit 1c433fb ("[ALSA] soc - 0.13 ASoC headers"). Thesnd_soc_info_volsw_ext()function has been unused ever since then, so remove it.
Applied both, thanks.