[PATCH 10/16] ASoC: codecs: rx-macro: fix tlv min max range

Mark Brown broonie at kernel.org
Tue Feb 22 19:04:53 CET 2022


On Tue, Feb 22, 2022 at 11:59:27AM +0000, Srinivas Kandagatla wrote:
> on Qualcomm codecs gain tlv control specifies min max range as both
> negative to positive numbers like
> 
> SOC_SINGLE_S8_TLV("... Volume", ..,  -84, 40, gain)
> 
> However with recent boundary checks added in commit 817f7c9335ec0
> ("ASoC: ops: Reject out of bounds values in snd_soc_put_volsw())
> setting a value above 40 gain will fail.
> 
> So fix this min max range correctly to
> SOC_SINGLE_S8_TLV("... Volume", ..,  0, 124, gain)
> so that users can now set gain correctly

Are you sure this isn't a bug in the core?  -84..40 should be a valid
range for a signed control.  See Marek's fix in 9bdd10d57a ("ASoC: ops:
Shift tested values in snd_soc_put_volsw() by +min") though that only
kicks in for systems with a platform_max.  I can't immediately spot any
other issues for S8 but I could be missing something.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
URL: <http://mailman.alsa-project.org/pipermail/alsa-devel/attachments/20220222/6bc44147/attachment.sig>


More information about the Alsa-devel mailing list