[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <201112261330.22783.jkrzyszt@tis.icnet.pl>
Date: Mon, 26 Dec 2011 13:30:22 +0100
From: Janusz Krzysztofik <jkrzyszt@....icnet.pl>
To: Mark Brown <broonie@...nsource.wolfsonmicro.com>
Cc: Tony Lindgren <tony@...mide.com>,
Jarkko Nikula <jarkko.nikula@...mer.com>,
Liam Girdwood <lrg@...com>, linux-omap@...r.kernel.org,
linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org,
alsa-devel@...a-project.org
Subject: Re: [PATCH 4/4] ASoC: OMAP: ams-delta: drop .set_bias_level callback
On Monday 26 of December 2011 at 12:03:49, Mark Brown wrote:
> On Sat, Dec 24, 2011 at 12:12:24AM +0100, Janusz Krzysztofik wrote:
>
> > +struct regulator_consumer_data {
> > + struct mutex lock;
> > + struct regulator *regulator;
> > + bool enabled;
> > +};
> > +
> > +static int regulator_toggle(struct regulator_consumer_data *consumer,
> > + bool enable)
> > +{
> > + int err = 0;
> > +
> > + if (!consumer->regulator)
> > + return -ENODEV;
> > +
> > + mutex_lock(&consumer->lock);
> > + if (IS_ERR(consumer->regulator)) {
> > + err = PTR_ERR(consumer->regulator);
> > + } else if (enable) {
> > + if (!consumer->enabled) {
> > + err = regulator_enable(consumer->regulator);
> > + consumer->enabled = true;
> > + }
> > + } else {
> > + if (consumer->enabled) {
> > + err = regulator_disable(consumer->regulator);
> > + consumer->enabled = false;
> > + }
> > + }
> > + mutex_unlock(&consumer->lock);
> > +
> > + return err;
> > +}
> > +
>
> Why's this code not been dropped and what is it for?
It is, and will be, used by another regulator consumer, the modem. The
device is controlled by the generic serial8250 driver, extended with a
custom .pm hook which enables/disables the regulator. The above code,
temporarily shared with the ASoC device before updated, is now just
moved down the board file where the modem related bits are located (see
patch 3/4).
Any hints like that for the codec driver?
Thanks,
Janusz
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists