[alsa-devel] Mixer control for signed gain value

Mark Brown broonie at opensource.wolfsonmicro.com
Tue Jun 28 18:32:39 CEST 2011

On Tue, Jun 28, 2011 at 09:21:31AM -0700, Patrick Lai wrote:

> Yes, CODEC in question takes byte-long signed gain value and would like
> to reuse snd_soc_xxx_volsw_xx mixer callback functions in soc-core.c.
> The only functions I see handle signed value are
> snd_soc_info_volsw_s8, snd_soc_get_volsw_s8, snd_soc_get_volsw_s8
> Unless I am mistaken, these functions deal with two signed byte-long
> values which get concatenated into 16-bit value. Perhaps, original

No, they shouldn't do that - they should handle stereo pairs in a single
register.  Looks like they just need a little massaging to cope with
mono controls.

> So, my question is whether I should reuse volsw_s8 mixer control
> functions and have mixer application ignore integer.value[1] to suit my
> purpose or redefine new set of mixer control functions i.e
> snd_soc_set_volsw_single_s8. Otherwise, is there existing alternative
> to handle set/put byte-long signed value?

Make the current controls handle mono.

More information about the Alsa-devel mailing list