ASoC: Add info callback for SX_TLV controls
authorCharles Keepax <ckeepax@opensource.wolfsonmicro.com>
Wed, 14 Oct 2015 12:31:24 +0000 (13:31 +0100)
committerMark Brown <broonie@kernel.org>
Fri, 16 Oct 2015 15:17:25 +0000 (16:17 +0100)
commit34198710f55b5f359f43e67d9a08fe5aadfbca1b
treed919662036a8a712283dc8246f1977988418bff8
parent6ff33f3902c3b1c5d0db6b1e2c70b6d76fba357f
ASoC: Add info callback for SX_TLV controls

SX_TLV controls are intended for situations where the register behind
the control has some non-zero value indicating the minimum gain
and then gains increasing from there and eventually overflowing through
zero.

Currently every CODEC implementing these controls specifies the minimum
as the non-zero value for the minimum and the maximum as the number of
gain settings available.

This means when the info callback subtracts the minimum value from the
maximum value to calculate the number of gain levels available it is
actually under reporting the available levels. This patch fixes this
issue by adding a new snd_soc_info_volsw_sx callback that does not
subtract the minimum value.

Fixes: 1d99f2436d0d ("ASoC: core: Rework SOC_DOUBLE_R_SX_TLV add SOC_SINGLE_SX_TLV")
Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Acked-by: Brian Austin <brian.austin@cirrus.com>
Tested-by: Brian Austin <brian.austin@cirrus.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Cc: stable@vger.kernel.org
include/sound/soc.h
sound/soc/soc-ops.c