[alsa-devel] [RFC 07/12] ASoC: core: Change SOC_SINGLE/DOUBLE_VALUE representation
Mark Brown
broonie at opensource.wolfsonmicro.com
Tue Oct 4 17:37:06 CEST 2011
On Tue, Oct 04, 2011 at 02:39:44PM +0300, Peter Ujfalusi wrote:
> SOC_SINGLE/DOUBLE_VALUE is used for mixer controls, where the
> bits are within one register.
> Assign .rreg to be the same as .reg for these types.
Just a general note about your changelogs - the indentation is really
random, normally we have a blank line between paragraphs and have
similar line lengths within paragraphs.
> With this change we can tell if the mixer in question:
> is mono:
> mc->reg == mc->rreg && mc->shift == mc->rshift
> is stereo, within single register:
> mc->reg == mc->rreg && mc->shift != mc->rshift
> is stereo, in two registers:
> mc->reg != mc->rreg && mc->shift == mc->rshift
reg != rreg should be enough.
> +static inline int snd_soc_volsw_is_stereo(struct soc_mixer_control *mc)
> +{
> + if (mc->reg == mc->rreg && mc->shift == mc->rshift)
> + return 0;
> + /*
> + * mc->reg == mc->rreg && mc->shift != mc->rshift, or
> + * mc->reg != mc->rreg && mc->shift == mc->rshift means that the control
> + * is stereo (bits in one register or in two registers)
> + */
> + return 1;
> +}
bool.
More information about the Alsa-devel
mailing list