Semantics for _SX controls

David Rhodes david.rhodes at cirrus.com
Wed Jun 1 21:47:28 CEST 2022


On 6/1/22 10:24, Mark Brown wrote:
> For the Cirrus case 34198710f55b5f ("ASoC: Add info callback for
> SX_TLV controls") says that the intended semantic is
> 
>      Currently every CODEC implementing these controls specifies the minimum
>      as the non-zero value for the minimum and the maximum as the number of
>      gain settings available.
> 
> which was from Charles at Cirrus so hopefully that's the semantic
> used by Cirrus drivers.

The Cirrus parts have volume fields with a signed value. Typically this 
is a large negative attenuation and a smaller amount of gain (-102dB / 
+12dB for example). The goal for the control is to map this to a 
continuous range and in a way that understands the signed bit field.

 From my review, all of the Cirrus drivers are providing the minimum and 
number of gain settings to SOC_SINGLE_SX_TLV as Charles described, with 
the exception of cs53l30. The cs53l30 driver uses the minimum (negative) 
and maximum (positive) values of the bit field.

At the very least, cs53l30 should be patched. For the other drivers, 
using a macro that is more explicit about the signed bit field and 
removes the max/#-steps confusion would be an improvement. Something 
similar to SOC_DOUBLE_R_S_TLV could work.

Thanks,
David


More information about the Alsa-devel mailing list