diff options
author | Markus Pargmann <mpa@pengutronix.de> | 2014-01-16 16:02:10 +0100 |
---|---|---|
committer | Nitin Garg <nitin.garg@freescale.com> | 2014-08-27 18:28:48 -0500 |
commit | d5c2a3cfe0aae98ec662089a80ae6db7587c0b18 (patch) | |
tree | a6a744fc2eeb2c497ffae0d44014f6e09bda3319 /include | |
parent | 21e2908712dd5c3f9848241230c99c56f6538369 (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 89d829ae72af..1bb8e304b0db 100644 --- a/include/sound/soc.h +++ b/include/sound/soc.h @@ -1092,6 +1092,7 @@ struct snd_soc_pcm_runtime { struct soc_mixer_control { int min, max, platform_max; unsigned int reg, rreg, shift, rshift, invert; + unsigned int sign_bit; }; struct soc_bytes { |