summaryrefslogtreecommitdiffstats
path: root/include/sound
diff options
context:
space:
mode:
authorMarkus Pargmann <mpa@pengutronix.de>2014-01-16 16:02:10 +0100
committerMark Brown <broonie@linaro.org>2014-02-03 12:44:50 +0000
commitf227b88f0fce5f9b82aa934f8829a741c2e06d82 (patch)
tree79d3aa04bf8075f5611ff1ee30ad9238a5c0d4f8 /include/sound
parent38dbfb59d1175ef458d006556061adeaa8751b72 (diff)
downloadop-kernel-dev-f227b88f0fce5f9b82aa934f8829a741c2e06d82.zip
op-kernel-dev-f227b88f0fce5f9b82aa934f8829a741c2e06d82.tar.gz
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')
-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 9a00147..a25f3cc 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;
};
OpenPOWER on IntegriCloud