Re: [PATCH] ASoC: ops: Don't modify the driver's plaform_max when reading state

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> On 3. 6. 2022, at 13:25, Mark Brown <broonie@xxxxxxxxxx> wrote:
> 
> Currently snd_soc_info_volsw() will set a platform_max based on the limit
> the control has if one is not already set. This isn't really great, we
> shouldn't be modifying the passed in driver data especially in a path like
> this which may not ever be executed or where we may execute other callbacks
> before this one. Instead make this function leave the data unchanged, and
> clarify things a bit by referring to max rather than platform_max within
> the function. platform_max is now applied as a limit after working out the
> natural maximum value for the control.
> 
> This means that platform_max is no longer treated as a direct register
> value for controls were min is non-zero. The put() callbacks already
> validate on this basis, and there do not appear to be any in tree users
> that would be affected.

At least ‘put_volsw' seem to validate on the other conflicting interpretation
of platform_max [as was introduced in commit 9bdd10d57a88 (“ASoC: ops:
Shift tested values in snd_soc_put_volsw() by +min”)].

Also, the soc.h definitions of SOC_SINGLE_*/SOC_DOUBLE_* set platform_max
to the register maximum, again interpreting platform_max the other way.

> 
> Signed-off-by: Mark Brown <broonie@xxxxxxxxxx>

This commit breaks controls with non-zero minimum.

Best,
Martin





[Index of Archives]     [ALSA User]     [Linux Audio Users]     [Pulse Audio]     [Kernel Archive]     [Asterisk PBX]     [Photo Sharing]     [Linux Sound]     [Video 4 Linux]     [Gimp]     [Yosemite News]

  Powered by Linux