diff options
author | Markus Pargmann <mpa@pengutronix.de> | 2014-01-16 16:02:10 +0100 |
---|---|---|
committer | Nitin Garg <nitin.garg@freescale.com> | 2015-01-15 21:16:44 -0600 |
commit | 4c0e9bc2f9a9e91010fc4b9c2829d67628e24e9f (patch) | |
tree | 96af46b6ec0d99fcfe9e871b83e64b94c2ef1508 /include | |
parent | 63d995870aa756c4755ab3a7cfdfbfdd474eb7c6 (diff) |
ASoC: core: Add signed register volume control logic
Some codecs use signed volume control representation with non standard
register sizes, e.g. 6 or 7 bit signed integers.
This patch adds generic signed register volume control logic to
soc-core. Instead of a fixed width signed register control, this
implementation uses a 'min' value and the signed bit location to translate
it to an absolute volume. Using the 'sign_bit' we can calculate a
correct mask for the register values and translate it back into signed
integers of standard size.
Signed-off-by: Markus Pargmann <mpa@pengutronix.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
(cherry picked from commit f227b88f0fce5f9b82aa934f8829a741c2e06d82)
Diffstat (limited to 'include')
-rw-r--r-- | include/sound/soc.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/include/sound/soc.h b/include/sound/soc.h index 9a001472b96a..a25f3ccb3fde 100644 --- a/include/sound/soc.h +++ b/include/sound/soc.h @@ -1067,6 +1067,7 @@ struct soc_mixer_control { int min, max, platform_max; int reg, rreg; unsigned int shift, rshift; + unsigned int sign_bit; unsigned int invert:1; unsigned int autodisable:1; }; |