From: Stuart Longland Date: Fri, 18 Jun 2010 02:56:10 +0000 (+1000) Subject: ASoC: Fix overflow bug in SOC_DOUBLE_R_SX_TLV X-Git-Tag: v2.6.36-rc1~493^2~1^2~69 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=20630c7f5966419dd6a1f00b669a7771e228510a;p=pandora-kernel.git ASoC: Fix overflow bug in SOC_DOUBLE_R_SX_TLV When SX_TLV widgets are read, if the gain is set to a value below 0dB, the mixer control is erroniously read as being at maximum volume. The value read out of the CODEC register is never sign-extended, and when the minimum value is subtracted (read; added, since the minimum is negative) the result is a number greater than the maximum allowed value for the control, and hence it saturates. Solution: Mask the result so that it "wraps around", emulating sign-extension. Signed-off-by: Stuart Longland Acked-by: Liam Girdwood Signed-off-by: Mark Brown --- Reading git-diff-tree failed