From 42152f3e366c0945abd92efa687ecb02f183a3d6 Mon Sep 17 00:00:00 2001 From: Sudheer Papothi Date: Fri, 29 Jan 2016 01:37:55 +0530 Subject: 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 Signed-off-by: Banajit Goswami Signed-off-by: Sudheer Papothi --- sound/soc/soc-ops.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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); -- cgit v1.2.3