ASoC: core: Fix for the volume limiting when invert is in use
authorPeter Ujfalusi <peter.ujfalusi@nokia.com>
Mon, 10 May 2010 11:39:24 +0000 (14:39 +0300)
committerMark Brown <broonie@opensource.wolfsonmicro.com>
Tue, 11 May 2010 08:34:11 +0000 (09:34 +0100)
commitd11bb4a925613fa814ed4ae350440eb24ebff336
tree45332b4ea11ef84f6f33a7eb5a7957453de379a7
parent896060c76bdfd8a45eb33b3dd1a8307fe37f6c04
ASoC: core: Fix for the volume limiting when invert is in use

If the register for the volume needs invert, than the inversion
need to be done from the chip maximum, and not from the platform
dependent limit.
Introduce soc_mixer_control.platform_max value, which initially
equals to chip maximum.
The snd_soc_limit_volume function only modify the platform_max,
all volsw_info call returns this as well.
The .max value holds the chip default (maximum), and it is used
for the inversion, if it is needed.

Additional check in the volsw_info call has been added to check
the validity of the platform_max in case, when custom macros
used by codec drivers are not initializing it correctly.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@nokia.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
include/sound/soc.h
sound/soc/soc-core.c