diff options
| author | Sudheer Papothi <spapothi@codeaurora.org> | 2016-01-29 01:37:55 +0530 |
|---|---|---|
| committer | David Keitel <dkeitel@codeaurora.org> | 2016-03-23 20:10:03 -0700 |
| commit | 42152f3e366c0945abd92efa687ecb02f183a3d6 (patch) | |
| tree | 4814bdacea43064fe19a8fc16ac7a22c025b7361 | |
| parent | de4a23322718d9233310b6e8ee4b1a25905624f6 (diff) | |
ASoC: Update the Max value of integer controls.
When control value is queried framework is returning the
min value as zero even if min is negative.
This change will make sure that frame work will update
the max value in cases where min is negative.
Signed-off-by: Gopikrishnaiah Anandan <agopik@codeaurora.org>
Signed-off-by: Banajit Goswami <bgoswami@codeaurora.org>
Signed-off-by: Sudheer Papothi <spapothi@codeaurora.org>
| -rw-r--r-- | sound/soc/soc-ops.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/sound/soc/soc-ops.c b/sound/soc/soc-ops.c index 2f67ba6d7a8f..b2dd69055927 100644 --- a/sound/soc/soc-ops.c +++ b/sound/soc/soc-ops.c @@ -201,7 +201,10 @@ int snd_soc_info_volsw(struct snd_kcontrol *kcontrol, uinfo->count = snd_soc_volsw_is_stereo(mc) ? 2 : 1; uinfo->value.integer.min = 0; - uinfo->value.integer.max = platform_max - mc->min; + if (mc->min < 0 && (uinfo->type == SNDRV_CTL_ELEM_TYPE_INTEGER)) + uinfo->value.integer.max = platform_max - mc->min; + else + uinfo->value.integer.max = platform_max; return 0; } EXPORT_SYMBOL_GPL(snd_soc_info_volsw); |
