[alsa-devel] [PATCH] ASoC: core: Support for limiting the volume

Peter Ujfalusi peter.ujfalusi at nokia.com
Mon May 10 09:07:58 CEST 2010

On Friday 07 May 2010 18:41:20 ext Mark Brown wrote:
> On Fri, May 07, 2010 at 02:05:49PM +0300, Peter Ujfalusi wrote:
> > Add support for the core to limit the maximum volume on an
> > existing control.
> > The function will modify the soc_mixer_control.max value
> > of the given control.
> > The new value must be lower than the original one (chip maximum)
> Applied, thanks.

however it seams that if the control has invert enabled this is going to break.
In case of invert we need to invert from the chip maximum, and not from the 
platform dependent limit.
The only way I can think of to solve this is to introduce new variable in 
soc_mixer_control struct. It can be called platform_max.
The snd_soc_limit_volume would modify the platform_max leaving the max as 
configured by the drivers (chip maximum).
In volsw_info calls than we return the platform_max instead of max.
If in the _info call the platform_max is 0, than we take the max to report (some 
custom kcontrol macro might not aware of the change in codec drivers).

What do you think?


More information about the Alsa-devel mailing list