From: broonie@opensource.wolfsonmicro.com (Mark Brown)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 2/2] regulator: Add support for MAX77686.
Date: Wed, 16 May 2012 14:08:01 +0100 [thread overview]
Message-ID: <20120516130800.GC26337@opensource.wolfsonmicro.com> (raw)
In-Reply-To: <CAKew6eVZuOUH8RHQbffCGX7i=6dM-qOJXojoKrOsM3V5ugEjHA@mail.gmail.com>
On Tue, May 15, 2012 at 07:17:11PM +0530, Yadwinder Singh Brar wrote:
> On Thu, May 10, 2012 at 12:17 AM, Mark Brown
> > On Wed, May 09, 2012 at 09:54:55PM +0530, Yadwinder Singh wrote:
> >> + ? ? if (iodev->dev->of_node) {
> >> + ? ? ? ? ? ? ret = max77686_pmic_dt_parse_pdata(iodev, pdata);
> >> + ? ? ? ? ? ? if (ret)
> >> + ? ? ? ? ? ? ? ? ? ? return ret;
> > This ought to use of_regulator_match().
> While using it I am seeing that though it reduces few lines of code in
> our driver , it adds a huge array(of_regulator_match[])in which we
> have to populate the strings(name) which we already have in
> regulator_desc[ ], Isn't it overhead ?
Well, I think half the problem here is that you're only instantiating
things you find in the device tree. If you were unconditionally
instantiating all the regulators then suddenly this becomes a lot
neater.
> >> + ? ? ? ? ? ? rdev[i] = regulator_register(®ulators[id], max77686->dev,
> >> + ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?pdata->regulators[i].initdata,
> >> + ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?max77686, NULL);
> > No, you should unconditionally register all regulators the device
> > physically has. ?This is useful for debug and simplifies the code.
> If we have to use only 2 or 3 regulators on our board out off 36 or
> lets take a case if our chip supports 50/100 regulators, I think i
> will a overhead to register all unused regulators as well as
> populating all the regulators in DT or platform data.
This isn't really a terribly realistic situation - if there are were
that many unused regulators the part selection is clearly not
appropriate to the system and most hardware engineers just wouldn't do
it.
Having information about all the regulators also allows us to do things
like power off any unused regulators which were left on after boot (eg,
due to bootloader or the PMIC defaults).
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20120516/19a52f25/attachment.sig>
next prev parent reply other threads:[~2012-05-16 13:08 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-05-09 16:24 [PATCH 0/2] regulator: add initial suport for max77686 Yadwinder Singh
2012-05-09 16:24 ` [PATCH 1/2] mfd: Add support for MAX77686 Yadwinder Singh
2012-05-09 18:27 ` Mark Brown
2012-05-09 23:42 ` Chanwoo Choi
2012-05-10 7:30 ` Yadwinder Singh Brar
2012-05-09 16:24 ` [PATCH 2/2] regulator: " Yadwinder Singh
2012-05-09 18:47 ` Mark Brown
2012-05-10 7:24 ` Yadwinder Singh Brar
2012-05-10 9:34 ` Mark Brown
2012-05-10 10:56 ` Yadwinder Singh Brar
2012-05-15 13:47 ` Yadwinder Singh Brar
2012-05-16 13:08 ` Mark Brown [this message]
2012-05-09 19:54 ` Sylwester Nawrocki
2012-05-10 7:31 ` Yadwinder Singh Brar
2012-05-09 18:23 ` [PATCH 0/2] regulator: add initial suport for max77686 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=20120516130800.GC26337@opensource.wolfsonmicro.com \
--to=broonie@opensource.wolfsonmicro.com \
--cc=linux-arm-kernel@lists.infradead.org \
/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).