Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a9e455e1 authored by Gopikrishnaiah Anandan's avatar Gopikrishnaiah Anandan Committed by Stephen Boyd
Browse files

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.

Change-Id: Ibea7c500b11653674b2eab1ed8a21646dcca9996
Signed-off-by: default avatarGopikrishnaiah Anandan <agopik@codeaurora.org>
parent 5d240b1e
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -2638,6 +2638,9 @@ int snd_soc_info_volsw(struct snd_kcontrol *kcontrol,

	uinfo->count = snd_soc_volsw_is_stereo(mc) ? 2 : 1;
	uinfo->value.integer.min = 0;
	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;
}