• Markus Pargmann's avatar
    ASoC: core: Add signed register volume control logic · f227b88f
    Markus Pargmann authored
    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: default avatarMarkus Pargmann <mpa@pengutronix.de>
    Signed-off-by: default avatarMark Brown <broonie@linaro.org>
    f227b88f
soc.h 40.3 KB