Alsa-Devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Péter Ujfalusi" <peter.ujfalusi@ti.com>
To: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: alsa-devel@alsa-project.org, Liam Girdwood <lrg@ti.com>,
	Misael Lopez Cruz <misael.lopez@ti.com>
Subject: Re: [PATCH 02/10] ASoC: twl6040: Combine the custom volsw get, and put functions
Date: Tue, 27 Sep 2011 14:21:37 +0300	[thread overview]
Message-ID: <15316585.mj9RxehzRH@barack> (raw)
In-Reply-To: <20110927105625.GF2910@opensource.wolfsonmicro.com>

On Tuesday 27 September 2011 11:56:26 Mark Brown wrote:
> On Tue, Sep 27, 2011 at 09:16:16AM +0300, Péter Ujfalusi wrote:
> > On Monday 26 September 2011 22:21:42 Mark Brown wrote:
> > > Traditionally this would be done by comparing reg and rreg - if
> > > they're
> > > the same they're a mono control.
> > 
> > I'm not looking for the mono/stereo, but looking for the gain value(s)
> > are in the same register, but in different offset VS gain values are at
> > the same offset, but in two different registers.
> 
> That's not what you're actually checking :)  This would generally be
> checked by comparing the shift registers - the basic reason we have the
> two functions at all is that we used to mash everything into a 32 bit
> int rather than using a pointer to struct.

I see what you mean, but..
The thing I'm after here is to select between the snd_soc_put_volsw, and 
snd_soc_put_volsw_2r to make the change in the HW.

In case of SOC_SINGLE_TLV I (will) need to call snd_soc_put_volsw
In case of SOC_DOUBLE_TLV I need to call  snd_soc_put_volsw
In case of SOC_DOUBLE_R_TLV I need to call  snd_soc_put_volsw_2r.

SOC_SINGLE_TLV:
reg =		xreg,
rreg =	0,
shift =	xshift,
rshift = 	xshift,

SOC_DOUBLE_TLV:
reg =		xreg,
rreg =	0,
shift =	left_shift,
rshift = 	right_shift,

SOC_DOUBLE_R_TLV:
reg =		left_reg,
rreg =	right_reg,
shift =	xshift,
rshift = 	xshift,

To pick the correct snd_soc_put_* call it is easier to check if the rreg is 0, 
since in that case I need to use the snd_soc_put_volsw (and 
snd_soc_put_volsw_2r, when we have two registers to configure).

--
Péter

  reply	other threads:[~2011-09-27 11:21 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-26 13:26 [PATCH 00/10] ASoC: twl6040: Gain ramp code cleanups Peter Ujfalusi
2011-09-26 13:26 ` [PATCH 01/10] ASoC: twl6040: Rename pga_event to out_drv_event Peter Ujfalusi
2011-09-26 21:19   ` Mark Brown
2011-09-27  6:17     ` Péter Ujfalusi
2011-09-26 13:26 ` [PATCH 02/10] ASoC: twl6040: Combine the custom volsw get, and put functions Peter Ujfalusi
2011-09-26 21:21   ` Mark Brown
2011-09-27  6:16     ` Péter Ujfalusi
2011-09-27 10:56       ` Mark Brown
2011-09-27 11:21         ` Péter Ujfalusi [this message]
2011-09-27 11:42           ` Mark Brown
2011-09-27 12:55             ` Péter Ujfalusi
2011-09-26 13:26 ` [PATCH 03/10] ASoC: twl6040: Move delayed_work struct inside twl6040_output for HS/HF Peter Ujfalusi
2011-09-26 21:23   ` Mark Brown
2011-09-26 13:26 ` [PATCH 04/10] ASoC: twl6040: Move the delayed_work for HS detection under twl6040_jack_data Peter Ujfalusi
2011-09-26 21:24   ` Mark Brown
2011-09-26 13:26 ` [PATCH 05/10] ASoC: twl6040: One workqueue should be enough Peter Ujfalusi
2011-09-26 14:41   ` Mark Brown
2011-09-26 17:20     ` Ujfalusi, Peter
2011-09-26 21:29       ` Mark Brown
2011-09-27  6:33         ` Péter Ujfalusi
2011-09-26 13:26 ` [PATCH 06/10] ASoC: twl6040: correct loop counters for HS/HF ramp code Peter Ujfalusi
2011-09-26 21:33   ` Mark Brown
2011-09-27  6:21     ` Péter Ujfalusi
2011-09-27 11:12       ` Mark Brown
2011-09-26 13:26 ` [PATCH 07/10] ASoC: twl6040: No need to change delay during HS ramp Peter Ujfalusi
2011-09-26 21:33   ` Mark Brown
2011-09-26 13:26 ` [PATCH 08/10] ASoC: twl6040: No need to change delay during HF ramp Peter Ujfalusi
2011-09-26 21:33   ` Mark Brown
2011-09-26 13:26 ` [PATCH 09/10] ASoC: twl6040: Shift 2 identifies the HS output in out_drv_event Peter Ujfalusi
2011-09-26 13:26 ` [PATCH 10/10] ASoC: twl6040: Simplify code in out_drv_event for pending work check Peter Ujfalusi
2011-09-26 14:30   ` Mark Brown
2011-09-26 17:27     ` Ujfalusi, Peter

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=15316585.mj9RxehzRH@barack \
    --to=peter.ujfalusi@ti.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@opensource.wolfsonmicro.com \
    --cc=lrg@ti.com \
    --cc=misael.lopez@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox