All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mark Brown <broonie@opensource.wolfsonmicro.com>
To: Peter Ujfalusi <peter.ujfalusi@ti.com>
Cc: alsa-devel@alsa-project.org, Liam Girdwood <lrg@ti.com>
Subject: Re: [RFC 07/12] ASoC: core: Change SOC_SINGLE/DOUBLE_VALUE representation
Date: Tue, 4 Oct 2011 16:37:06 +0100	[thread overview]
Message-ID: <20111004153705.GP6934@opensource.wolfsonmicro.com> (raw)
In-Reply-To: <1317728389-22062-8-git-send-email-peter.ujfalusi@ti.com>

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.

  reply	other threads:[~2011-10-04 15:37 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-04 11:39 [RFC 00/12] Combining snd_soc_*_volsw/volsw_2r Peter Ujfalusi
2011-10-04 11:39 ` [RFC 01/12] ASoC: core: Introduce SOC_DOUBLE_VALUE macro Peter Ujfalusi
2011-10-04 11:39 ` [RFC 02/12] ASoC: core: Introduce SOC_DOUBLE_R_VALUE macro Peter Ujfalusi
2011-10-04 11:39 ` [RFC 03/12] ASoC: Consolidate use of controls with custom get/put function Peter Ujfalusi
2011-10-04 15:30   ` Mark Brown
2011-10-04 16:36     ` Ujfalusi, Peter
2011-10-04 11:39 ` [RFC 04/12] ASoC: twl6040: Simplify custom get_volsw callback Peter Ujfalusi
2011-10-04 15:31   ` Mark Brown
2011-10-04 11:39 ` [RFC 05/12] ASoC: twl6040: Simplify custom put_volsw callback Peter Ujfalusi
2011-10-04 15:26   ` Mark Brown
2011-10-04 16:34     ` Ujfalusi, Peter
2011-10-04 11:39 ` [RFC 06/12] ASoC: twl6040: Prepare for core put_volsw/volsw_2r merger Peter Ujfalusi
2011-10-04 15:34   ` Mark Brown
2011-10-04 11:39 ` [RFC 07/12] ASoC: core: Change SOC_SINGLE/DOUBLE_VALUE representation Peter Ujfalusi
2011-10-04 15:37   ` Mark Brown [this message]
2011-10-04 11:39 ` [RFC 08/12] ASoC: core: Combine snd_soc_info_volsw/info_volsw_2r functions Peter Ujfalusi
2011-10-04 11:39 ` [RFC 09/12] ASoC: core: Combine snd_soc_get_volsw/get_volsw_2r functions Peter Ujfalusi
2011-10-04 11:39 ` [RFC 10/12] ASoC: core: Combine snd_soc_out_volsw/put_volsw_2r functions Peter Ujfalusi
2011-10-04 11:39 ` [RFC 11/12] ASoC: twl6040: Simply call snd_soc_put_volsw form the custom code Peter Ujfalusi
2011-10-04 11:39 ` [RFC 12/12] ASoC: core: Remove snd_soc_put_volsw_2r definition Peter Ujfalusi
2011-10-04 15:39 ` [RFC 00/12] Combining snd_soc_*_volsw/volsw_2r Mark Brown
2011-10-04 16:06   ` Péter Ujfalusi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20111004153705.GP6934@opensource.wolfsonmicro.com \
    --to=broonie@opensource.wolfsonmicro.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=lrg@ti.com \
    --cc=peter.ujfalusi@ti.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.