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)
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>

No differences found