From: Mark Brown <broonie@opensource.wolfsonmicro.com>
To: Onkalo Samu <samu.p.onkalo@nokia.com>
Cc: ext Alan Cox <alan@lxorguk.ukuu.org.uk>,
ext Dmitry Torokhov <dmitry.torokhov@gmail.com>,
"linux-i2c@vger.kernel.org" <linux-i2c@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"akpm@linux-foundation.org" <akpm@linux-foundation.org>,
"linux-input@vger.kernel.org" <linux-input@vger.kernel.org>
Subject: Re: [PATCH 1/3] drivers: misc: ak8974 / ami305 magnetometer driver
Date: Fri, 27 Aug 2010 19:53:44 +0100 [thread overview]
Message-ID: <20100827185343.GA6626@opensource.wolfsonmicro.com> (raw)
In-Reply-To: <1282928353.2194.27.camel@noppispoppis.nmp.nokia.com>
On Fri, Aug 27, 2010 at 07:59:13PM +0300, Onkalo Samu wrote:
> On Fri, 2010-08-27 at 14:31 +0200, ext Alan Cox wrote:
> > > +static int ak8974_regulators_on(struct ak8974_chip *chip)
> > > +{
> > > + int ret;
> > > + ret = regulator_bulk_enable(ARRAY_SIZE(chip->regs), chip->regs);
> > That bit seems platform specific but in generic code ?
> If the regulator frame work is not configured, this code does nothing.
> I have understood (hopefully correctly) that if the frame work is in use
> drivers could support that directly assuming that regulators are
> configured for that platform. If that is not the case, this should be
> platform specific.
Your understanding is correct - the regulator API provides separation
between the driver and the platform so that the driver code can work
with any platform. The driver requests supplies in terms of the
physical supplies the chip has (using the struct device and the supply
names from the datasheet). The regulator API them matches this with
actual regulators on a given system using data provied separately by the
code specific to that machine so that the regulator and the consumer
using it don't need to know about each other.
If the regulator API is disabled then the basic regulator API calls
compile to inline stubs that report success, and there's a facility for
optionally automatically stubbing out missing supplies when the API is
enabled.
next prev parent reply other threads:[~2010-08-27 18:53 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1282910083-8629-1-git-send-email-samu.p.onkalo@nokia.com>
[not found] ` <1282910083-8629-2-git-send-email-samu.p.onkalo@nokia.com>
[not found] ` <1282910083-8629-2-git-send-email-samu.p.onkalo-xNZwKgViW5gAvxtiuMwx3w@public.gmane.org>
2010-08-27 12:31 ` [PATCH 1/3] drivers: misc: ak8974 / ami305 magnetometer driver Alan Cox
[not found] ` <20100827133109.1eb974ed-qBU/x9rampVanCEyBjwyrvXRex20P6io@public.gmane.org>
2010-08-27 16:59 ` Onkalo Samu
[not found] ` <1282928353.2194.27.camel-Vo7XL3ix0D0UEupzmRo7jhl4MBrZKKet0E9HWUfgJXw@public.gmane.org>
2010-08-27 18:08 ` Dmitry Torokhov
2010-08-28 13:44 ` Jonathan Cameron
2010-08-27 18:53 ` Mark Brown [this message]
[not found] ` <20100827185343.GA6626-yzvPICuk2AATkU/dhu1WVueM+bqZidxxQQ4Iyu8u01E@public.gmane.org>
2010-08-30 6:55 ` Onkalo Samu
2010-08-31 11:11 ` 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=20100827185343.GA6626@opensource.wolfsonmicro.com \
--to=broonie@opensource.wolfsonmicro.com \
--cc=akpm@linux-foundation.org \
--cc=alan@lxorguk.ukuu.org.uk \
--cc=dmitry.torokhov@gmail.com \
--cc=linux-i2c@vger.kernel.org \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=samu.p.onkalo@nokia.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;
as well as URLs for NNTP newsgroup(s).