diff options
| author | Sudheer Papothi <spapothi@codeaurora.org> | 2016-01-29 00:22:14 +0530 |
|---|---|---|
| committer | David Keitel <dkeitel@codeaurora.org> | 2016-03-23 20:09:50 -0700 |
| commit | 7ed3e4477179ea3db0639f740d191840a9a8b9f8 (patch) | |
| tree | 675e717bc7f5a7e737d44dbd209304c06da0281a /sound/soc/soc-core.c | |
| parent | ac913a4be3ee77329d15e3323f1a577077940edc (diff) | |
ASoC: core: Introduce macro SOC_SINGLE_MULTI_EXT
For some of the mixer controls client would like to register
count as a parameter. Macro adds support to specify the count.
Signed-off-by: Banajit Goswami <bgoswami@codeaurora.org>
Signed-off-by: Sudheer Papothi <spapothi@codeaurora.org>
Diffstat (limited to 'sound/soc/soc-core.c')
| -rw-r--r-- | sound/soc/soc-core.c | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index a1305f827a98..24cb33a9f5c8 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c @@ -3587,6 +3587,39 @@ static int snd_soc_get_dai_name(struct of_phandle_args *args, return ret; } +/** + * snd_soc_info_multi_ext - external single mixer info callback + * @kcontrol: mixer control + * @uinfo: control element information + * + * Callback to provide information about a single external mixer control. + * that accepts multiple input. + * + * Returns 0 for success. + */ +int snd_soc_info_multi_ext(struct snd_kcontrol *kcontrol, + struct snd_ctl_elem_info *uinfo) +{ + struct soc_multi_mixer_control *mc = + (struct soc_multi_mixer_control *)kcontrol->private_value; + int platform_max; + + if (!mc->platform_max) + mc->platform_max = mc->max; + platform_max = mc->platform_max; + + if (platform_max == 1 && !strnstr(kcontrol->id.name, " Volume", 30)) + uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN; + else + uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER; + + uinfo->count = mc->count; + uinfo->value.integer.min = 0; + uinfo->value.integer.max = platform_max; + return 0; +} +EXPORT_SYMBOL_GPL(snd_soc_info_multi_ext); + int snd_soc_of_get_dai_name(struct device_node *of_node, const char **dai_name) { |
