summaryrefslogtreecommitdiffstats
path: root/include/sound/soc.h
diff options
context:
space:
mode:
authorMarkus Pargmann2014-01-16 16:02:10 +0100
committerMark Brown2014-02-03 13:44:50 +0100
commitf227b88f0fce5f9b82aa934f8829a741c2e06d82 (patch)
tree79d3aa04bf8075f5611ff1ee30ad9238a5c0d4f8 /include/sound/soc.h
parentLinus 3.14-rc1 (diff)
downloadkernel-qcow2-linux-f227b88f0fce5f9b82aa934f8829a741c2e06d82.tar.gz
kernel-qcow2-linux-f227b88f0fce5f9b82aa934f8829a741c2e06d82.tar.xz
kernel-qcow2-linux-f227b88f0fce5f9b82aa934f8829a741c2e06d82.zip
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>
Diffstat (limited to 'include/sound/soc.h')
-rw-r--r--include/sound/soc.h1
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;
};