From: Sascha Hauer <s.hauer@pengutronix.de>
To: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: Fabio Estevam <festevam@gmail.com>,
robert.marklund@stericsson.com, netdev@vger.kernel.org,
Sascha Hauer <kernel@pengutronix.de>
Subject: Re: Regulator support for smsc911x
Date: Wed, 8 Feb 2012 09:31:41 +0100 [thread overview]
Message-ID: <20120208083141.GM3852@pengutronix.de> (raw)
In-Reply-To: <20120207193914.GA31557@opensource.wolfsonmicro.com>
On Tue, Feb 07, 2012 at 07:39:14PM +0000, Mark Brown wrote:
> On Tue, Feb 07, 2012 at 05:25:48PM -0200, Fabio Estevam wrote:
> > On Fri, Feb 3, 2012 at 9:11 AM, Mark Brown
>
> > > There's also options c) set up the regulators for the board and d) don't
> > > enable the regulator API if the board doesn't use regulators.
>
> > Option c would require that we change every single board.
>
> Well, yes.
>
> > The patch below does option d.
>
> > What do you think?
>
> Absolutely not. Putting conditional code like this in drivers is nuts,
> you would have to do the same thing in every single driver which is not
> a useful use of anyone's time. This is *clearly* a generic thing and
> should therefore be handled in generic code for the same reason we don't
> have driver specific platform data for actual usage of the API.
>
> Really, anyone who wants this sort of thing should just enable dummy
> regulators - it's exactly what you're implementing. I'm pretty sure
> your board does actually have power supplies for the chip, you've just
> not told software about them.
Yes, my board also has a supply for the smc911x, it's the same as used
for the CPU...
There is also option e), something I've been thinking about for a while.
Implement a list of resources which can be attached to a device. By
resources I mean regulators, clocks and pinmux for example. A device
would then just call a make_me_work(state) function which iterates over
this list and enables/disables all resources as necessary. This way we
could attach everything we need to a device without cluttering the
driver code like we do today.
Sascha
--
Pengutronix e.K. | |
Industrial Linux Solutions | http://www.pengutronix.de/ |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
next prev parent reply other threads:[~2012-02-08 8:31 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-02-03 1:02 Regulator support for smsc911x Fabio Estevam
2012-02-03 3:17 ` Fabio Estevam
2012-02-03 7:44 ` Sascha Hauer
2012-02-03 11:11 ` Mark Brown
2012-02-07 19:25 ` Fabio Estevam
2012-02-07 19:39 ` Mark Brown
2012-02-07 20:29 ` Fabio Estevam
2012-02-08 8:31 ` Sascha Hauer [this message]
2012-02-08 11:35 ` 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=20120208083141.GM3852@pengutronix.de \
--to=s.hauer@pengutronix.de \
--cc=broonie@opensource.wolfsonmicro.com \
--cc=festevam@gmail.com \
--cc=kernel@pengutronix.de \
--cc=netdev@vger.kernel.org \
--cc=robert.marklund@stericsson.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).