alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
From: Peter Ujfalusi <peter.ujfalusi@nokia.com>
To: alsa-devel@alsa-project.org
Cc: ext Mark Brown <broonie@opensource.wolfsonmicro.com>,
	"lrg@slimlogic.co.uk" <lrg@slimlogic.co.uk>
Subject: Re: [PATCH] ASoC: TWL4030: PM fix for output amplifiers
Date: Tue, 23 Mar 2010 09:59:13 +0200	[thread overview]
Message-ID: <201003230959.14186.peter.ujfalusi@nokia.com> (raw)
In-Reply-To: <201003230905.39319.peter.ujfalusi@nokia.com>

On Tuesday 23 March 2010 09:05:39 Ujfalusi Peter (Nokia-D/Tampere) wrote:
> In any ways the output gains has to be handled with custom code no matter
> if the core has support for binding the volume controls to DAPM widget or
> not. The root of the problem is how the amplifiers are working:
> bit 4-5: Gain
> 0x0 - power down (mute)
> 0x1 - 6dB
> 0x2 - 0dB
> 0x3 - -6dB
> 
> I don't have separate power bit.
> I can not just invert the range.
> I need to do the following:
> If 0 is coming, than I write that (mute, power down)
> If 2, than write two
> For 1 I write 3
> For 3 I write 1
> This gives nice gain range for the user space.
> 0x0 - power down (mute)
> 0x1 - -6dB
> 0x2 - 0dB
> 0x3 - 6dB

I just wonder, would something like this work:

Instead of the custom SOC_DOUBLE_R_TLV_TWL4030, which handles the output gains:

/*
 * Gain controls tied to outputs
 * -6 dB to 6 dB in 6 dB steps (mute instead of -12)
 */
static const unsigned int output_tlv[] = {
	TLV_DB_RANGE_HEAD(4),
	0, 0, TLV_DB_SCALE_ITEM(-1200, 0,  1),
	3, 3, TLV_DB_SCALE_ITEM(-600, 0, 0),
	2, 2, TLV_DB_SCALE_ITEM(0, 0, 0),
	1, 1, TLV_DB_SCALE_ITEM(600, 0, 0),
};

SOC_DOUBLE_R_TLV("PreDriv Playback Volume",
	TWL4030_REG_PREDL_CTL, TWL4030_REG_PREDR_CTL,
	4, 3, 0, output_tvl),

I'm not sure about the tlv declaration, but is there a way to actually map the 
gain/power control in the TWL in a standard way?

-- 
Péter

  reply	other threads:[~2010-03-23  7:59 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-22 13:36 [PATCH] ASoC: TWL4030: PM fix for output amplifiers Peter Ujfalusi
2010-03-22 13:47 ` Mark Brown
2010-03-22 14:04   ` Peter Ujfalusi
2010-03-22 14:15     ` Mark Brown
2010-03-22 14:46       ` Peter Ujfalusi
2010-03-22 15:06         ` Mark Brown
2010-03-22 15:31           ` Peter Ujfalusi
2010-03-22 16:19             ` Mark Brown
2010-03-22 16:48               ` Liam Girdwood
2010-03-22 17:00                 ` Mark Brown
2010-03-23  7:05               ` Peter Ujfalusi
2010-03-23  7:59                 ` Peter Ujfalusi [this message]
2010-03-23 10:02                   ` Mark Brown
2010-03-23 12:29                     ` Peter 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=201003230959.14186.peter.ujfalusi@nokia.com \
    --to=peter.ujfalusi@nokia.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@opensource.wolfsonmicro.com \
    --cc=lrg@slimlogic.co.uk \
    /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;
as well as URLs for NNTP newsgroup(s).