All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mark Brown <broonie@opensource.wolfsonmicro.com>
To: Peter Ujfalusi <peter.ujfalusi@nokia.com>
Cc: "Valentin Eduardo (Nokia-D/Helsinki)"
	<eduardo.valentin@nokia.com>,
	ext Tony Lindgren <tony@atomide.com>,
	"Nurkkala Eero.An (EXT-Offcode/Oulu)"
	<ext-Eero.Nurkkala@nokia.com>, Jarkko Nikula <jhnikula@GMAIL.COM>,
	Linux-OMAP <linux-omap@vger.kernel.org>,
	ALSA-Devel <alsa-devel@vger.kernel.org>
Subject: Re: [PATCH 1/8] ASoC: TPA6130A2 amplifier driver
Date: Thu, 8 Oct 2009 14:53:42 +0100	[thread overview]
Message-ID: <20091008135342.GJ29176@rakim.wolfsonmicro.main> (raw)
In-Reply-To: <200910081638.24229.peter.ujfalusi@nokia.com>

On Thu, Oct 08, 2009 at 04:38:24PM +0300, Peter Ujfalusi wrote:
> On Thursday 08 October 2009 15:52:13 ext Mark Brown wrote:
> > On Thu, Oct 08, 2009 at 02:58:50PM +0300, Eduardo Valentin wrote:
> > > +struct tpa6130a2_platform_data {
> > > +	int (*set_power)(int state);
> > > +};

> > Why is this a callback and not just a GPIO number?  That'd seem simpler
> > for users.

> Well, same amount of code, but in different place if the power is enabled 

Until someone adds a second board, at which point they need to copy the
code to acquire and release the GPIO.

> through a GPIO. But if the power is controlled via different means (nothing 
> comes to mind, but there are exotic systems out there), in this way it is simple 
> to handle

I suspect we can deal with that adequately when it crops up, for example
by having the driver set up a default callback function if a GPIO is
specified instead of a callback.

> > > +	pdata = (struct tpa6130a2_platform_data *)client->dev.platform_data;
> > > +	/* Set default register values */
> > > +	data->regs[TPA6130A2_REG_CONTROL] = TPA6130A2_SWS |
> > > +					    TPA6130A2_HP_EN_R |
> > > +					    TPA6130A2_HP_EN_L;

> > This looks like you could implement stereo paths with individual power
> > control?

> Can we put something in between DAPM_OUTPUT and DAPM_HP to handle the stereo 
> path correctly?

Yes.

> We could have two paths from codec to the "TPA6130A2 Headphone", which is needed 
> to actually control the power of the amplifier.

Or make "TPA6130A2 Headphone" be a SND_SOC_DAPM_SUPPLY() connected to
the individual channels for the headphone outputs, which should do the
right thing.

> At the end we are not really gaining much, but one more level of switch on the 
> path.
> We could have simple mute alsa controls in tpa6130a2_controls for the amplifier 
> itself...

It'd mean that mono outputs would only need to enable one of the
channels.  Depending on the hardware feeding the amp this may behave
better - there may be some noise or leakage on the idle channel which
it'd be better to avoid amplifying - and it should certainly use a
little less power.

> > > +	err = tpa6130a2_i2c_read(TPA6130A2_REG_VERSION) &
> > > +				 TPA6130A2_VERSION_MASK;
> > > +	if ((err != 1) && (err != 2)) {
> > > +		dev_err(dev, "Unexpected headphone amplifier chip version "
> > > +		       "of 0x%02x, was expecting 0x01 or 0x02\n", err);
> > > +		err = -ENODEV;

> > This seems a bit excessive - is it really likely that the register map
> > would be changed incompatibly in a future version?

> Hmm, we have only seen these versions of the chip, and we know that the driver 
> works with these. Also we don't have any information on different versions, but 
> I would think that the register map is not changing (the reset values for some 
> registers are different)

It's fairly common to see some incompatible changes in early silicon
revisions but once things get properly launched it's fairly unusual.
I'd be more inclined to print a warning here rather than fail - chances
are that the driver will work fine with any new revisions that are
produced.

  reply	other threads:[~2009-10-08 13:54 UTC|newest]

Thread overview: 93+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-10-08 11:58 [PATCH 0/8] RX-51 audio drivers Eduardo Valentin
2009-10-08 11:58 ` [PATCH 1/8] ASoC: TPA6130A2 amplifier driver Eduardo Valentin
2009-10-08 11:58 ` Eduardo Valentin
2009-10-08 12:30   ` Eero Nurkkala
2009-10-08 13:07     ` Peter Ujfalusi
2009-10-08 13:07     ` Peter Ujfalusi
2009-10-08 12:30   ` Eero Nurkkala
2009-10-08 12:52   ` Mark Brown
2009-10-08 13:38     ` Peter Ujfalusi
2009-10-08 13:38     ` Peter Ujfalusi
2009-10-08 13:53       ` Mark Brown [this message]
2009-10-09  6:53         ` Peter Ujfalusi
2009-10-09  6:53         ` Peter Ujfalusi
2009-10-09 10:36           ` Mark Brown
2009-10-08 13:53       ` Mark Brown
2009-10-08 12:52   ` Mark Brown
2009-10-08 11:58 ` [PATCH 2/8] ASoC: OMAP: RX-51 Machine driver and AIC34b_dummy driver Eduardo Valentin
2009-10-08 11:58 ` Eduardo Valentin
2009-10-08 12:31   ` Eero Nurkkala
2009-10-08 12:31   ` Eero Nurkkala
2009-10-08 13:18     ` Eduardo Valentin
2009-10-08 13:18     ` Eduardo Valentin
2009-10-08 13:11   ` Mark Brown
2009-10-08 13:11   ` Mark Brown
2009-10-09  5:44     ` Jarkko Nikula
2009-10-09  6:37       ` Eduardo Valentin
2009-10-09  6:37       ` Eduardo Valentin
2009-10-09 12:19         ` Mark Brown
2009-10-09  5:44     ` Jarkko Nikula
2009-10-08 11:58 ` [PATCH 3/8] McBSP: OMAP3: Add Sidetone feature Eduardo Valentin
2009-10-08 11:58 ` Eduardo Valentin
2009-10-08 13:17   ` Mark Brown
2009-10-08 13:17   ` Mark Brown
2009-10-08 13:23     ` Eduardo Valentin
2009-10-08 13:27       ` Mark Brown
2009-10-09  5:09     ` Eero Nurkkala
2009-10-09 10:44       ` [alsa-devel] " Mark Brown
2009-10-12  6:17         ` Eero Nurkkala
2009-10-12  9:12           ` Mark Brown
2009-10-12  9:28             ` Eero Nurkkala
2009-10-12  9:32               ` Mark Brown
2009-10-12 10:28                 ` Eero Nurkkala
2009-10-12 10:33                   ` Mark Brown
2009-10-08 11:58 ` [PATCH 4/8] OMAP: RX51: Add audio board file Eduardo Valentin
2009-10-08 11:58 ` Eduardo Valentin
2009-10-08 11:58 ` [PATCH 5/8] board-rx51-peripherals: split vaux3 and vmmc2 supplies Eduardo Valentin
2009-10-08 13:21   ` Mark Brown
2009-10-09  6:45     ` Eduardo Valentin
2009-10-09  6:45     ` Eduardo Valentin
2009-10-09 11:03       ` Mark Brown
2009-10-12  8:08         ` Eduardo Valentin
2009-10-12  9:18           ` Mark Brown
2009-10-14 17:15             ` Tony Lindgren
2009-10-15  9:01               ` Mark Brown
2009-10-16 16:14                 ` Tony Lindgren
2009-10-08 13:21   ` Mark Brown
2009-10-08 11:58 ` Eduardo Valentin
2009-10-08 11:58 ` [PATCH 6/8] RX-51: Audio: Add usage of regulator framework to control VMMC2 Eduardo Valentin
2009-10-08 13:26   ` Mark Brown
2009-10-12  9:04     ` Eduardo Valentin
2009-10-12  9:04     ` Eduardo Valentin
2009-10-12  9:21       ` Mark Brown
2009-10-19  9:13         ` Eduardo Valentin
2009-10-19  9:13         ` Eduardo Valentin
2009-10-19  9:23           ` Mark Brown
2009-10-19  9:23           ` Mark Brown
2009-10-19  9:24             ` Mark Brown
2009-10-19  9:24             ` Mark Brown
2009-10-12  9:21       ` Mark Brown
2009-10-08 11:58 ` Eduardo Valentin
2009-10-08 11:58 ` [PATCH 7/8] ASoC: tlv320aic3x: add initial usage of regulator framework to control avdd_dac Eduardo Valentin
2009-10-08 12:17   ` Eero Nurkkala
2009-10-08 12:17   ` Eero Nurkkala
2009-10-08 13:17     ` Eduardo Valentin
2009-10-08 13:40     ` Mark Brown
2009-10-08 13:40     ` Mark Brown
2009-10-08 15:44       ` ext-Eero.Nurkkala
2009-10-08 16:01         ` Mark Brown
2009-10-09  4:28           ` Eero Nurkkala
2009-10-09  4:28           ` Eero Nurkkala
2009-10-09 10:19             ` Mark Brown
2009-10-09 10:19             ` Mark Brown
2009-10-08 16:01         ` Mark Brown
2009-10-08 15:44       ` ext-Eero.Nurkkala
2009-10-08 13:38   ` Mark Brown
2009-10-08 13:38   ` Mark Brown
2009-10-08 11:58 ` Eduardo Valentin
2009-10-08 11:58 ` [PATCH 8/8] ASoC: tpa6130a2: Control vdd using regulator framework Eduardo Valentin
2009-10-08 11:58 ` Eduardo Valentin
2009-10-08 13:43   ` Mark Brown
2009-10-08 13:56     ` Eduardo Valentin
2009-10-08 14:41       ` Mark Brown
2009-10-08 14:41       ` Mark Brown

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=20091008135342.GJ29176@rakim.wolfsonmicro.main \
    --to=broonie@opensource.wolfsonmicro.com \
    --cc=alsa-devel@vger.kernel.org \
    --cc=eduardo.valentin@nokia.com \
    --cc=ext-Eero.Nurkkala@nokia.com \
    --cc=jhnikula@GMAIL.COM \
    --cc=linux-omap@vger.kernel.org \
    --cc=peter.ujfalusi@nokia.com \
    --cc=tony@atomide.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.