[alsa-devel] ASoC: Defining "signed integer" mixer controls?

James Courtier-Dutton james.dutton at gmail.com
Thu Jun 3 17:52:24 CEST 2010


On 3 June 2010 11:33, Stuart Longland <redhatter at gentoo.org> wrote:
> On Thu, Jun 03, 2010 at 10:25:16AM +0200, Clemens Ladisch wrote:
>> Stuart Longland wrote:
>>
>> >     SOC_DOUBLE_R_TLV("PCM Playback Volume",
>> >                      AIC3204_LDACVOL, AIC3204_RDACVOL,
>> >                      0, 127, 0, dac_tlv),
>> >
>> > However; it treats the bitfield as unsigned, which is wrong in this
>> > case.  The bitfield is a signed integer in two's complement format.  How
>> > do I convince ALSA that these integers have a sign bit?
>>
>> ALSA's controls use signed values, it's the SOC_ macros that assume
>> bitfields.  You should be able to define a control with your own
>> callbacks like in a non-ASoC driver.
>
> Ahh okay... makes sense... I'll have a closer look; perhaps some
> additional macros could be written to allow use of signed integer
> bitfields as well.  I'm sure the TLV320AIC3204 is not the only CODEC
> that uses such beasts.

I am not aware of any codec that uses signed bitfields. (My experience
is with AC97, HD-Audio, DSPs and various ADC and DACs.)
Your TLV320AIC3204 might be the first!!!

Kind Regards

James


More information about the Alsa-devel mailing list