ASoC: ops: add snd_soc_get_volsw_clamped
Quoted 5 lines
From: Mark Brown <[email protected]>
Sent: Friday, September 12, 2025 12:02 AM
Subject: Re: [EXTERNAL] Re: [PATCH v4 2/6] ASoC: ops: addsnd_soc_get_volsw_clamped
Quoted 7 lines
Quoted 5 lines · Niranjan
Quoted 1 line
From: Mark Brown <[email protected]>
Since few of the drivers as still using the original API, and was not sure if
everyone wanted to clamp the register value, did not want to disturb the original APIsnd_soc_get_volsw. Per my analysis, if register read fails due toIn what situation would anything want to report an invalid value?
I am not sure if I fully follow. But in my case, for one of the cases,
valid amp volume is 0x0 to 0x14 with mask 0x1f - so if the register value read is 0x15 to 0x1f, it is invalid. But in the next patch, I will add the logic to clamp the value.
Quoted 4 lines
Quoted 2 lines
Are you thinking that this patch could be dropped and clamp the value to max in '
soc_get_volsw' (as in 1st patch) and use the same API ? Please suggest.Yes, everything should report valid values. I/O errors should be propagated as errors.
I will update the next patch accordingly.
Thanks
Niranjan H Y