From: Guenter Roeck <linux@roeck-us.net>
To: Stephen Warren <swarren@wwwdotorg.org>
Cc: Mark Brown <broonie@kernel.org>, Wei Ni <wni@nvidia.com>,
"khali@linux-fr.org" <khali@linux-fr.org>,
"lm-sensors@lm-sensors.org" <lm-sensors@lm-sensors.org>,
"linux-tegra@vger.kernel.org" <linux-tegra@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v3 1/2] hwmon: (lm90) Add power control
Date: Tue, 10 Sep 2013 11:07:47 -0700 [thread overview]
Message-ID: <20130910180747.GA8164@roeck-us.net> (raw)
In-Reply-To: <522F5A65.8040907@wwwdotorg.org>
On Tue, Sep 10, 2013 at 11:44:05AM -0600, Stephen Warren wrote:
> On 09/10/2013 11:04 AM, Mark Brown wrote:
> > On Tue, Sep 10, 2013 at 09:07:43AM -0600, Stephen Warren wrote:
> >> On 09/10/2013 04:09 AM, Mark Brown wrote:
> >
> >>> No. There are a couple of issues here. One is that we don't want
> >>> to litter all drivers with conditional code to check if they
> >>> actually got the regulator and so on, that's just pointless make
> >>> work on the part of consumers.
> >
> >> So that's exactly the difference between (a) and (b) above.
> >
> > Right, but the idea is that we just only ignore a failure to get a
> > supply if we can usefully run without that supply being present and
> > there's more code there than simply ignoring the error - if the driver
> > can genuinely just ignore all errors and otherwise not do anything
> > different then requesting the regulator in the first place is clearly a
> > waste of time and enabling it would be a waste of power.
> >
> > A driver should only be carrying code for a missing regulator if it can
> > usefully work without it, like the cases where devices can use an
> > internal reference if one is not available.
>
> OK, so I believe you're saying that the case of a chip with just a
> single power source, which absolutely must be present in HW for the chip
> to be powered, isn't appropriate for regulator_get_optional(). Something
> must always define a regulator for that power source, even if there is
> no external SW control over that power source.
>
I think you are supposed to use a dummy regulator in that case.
Guenter
> If so, how does a driver (or binding) that's been written without any
> support for a regulator (since so far all boards have had no SW control
> over that power source; it's always on) get enhanced to support boards
> where there is SW control over the power source?
>
> We either allow the regulator to be optional (since SW control over the
> regulator is optional), or go back to every board file and DT and add a
> dummy regulator in (which then breaks DT ABI, and even ignoring that is
> a pain).
>
> And note that when I say "optional" at the start of the previous
> paragraph, I'm talking about probe-time regulator_get() operations and
> DT content. Clearly as far as the rest of the driver is concerned,
> something can always provide a dummy regulator so that e.g.
> regulator_enable/disable() elsewhere always have something to operate
> on. However, probe() either needs to call an API that automatically
> provides such a dummy regulator, or open-code that itself. I'm still not
> clear which option you think should be used.
>
next prev parent reply other threads:[~2013-09-10 18:07 UTC|newest]
Thread overview: 45+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-09-09 10:29 [PATCH v3 0/2] Add power control for lm90 Wei Ni
2013-09-09 10:29 ` [PATCH v3 1/2] hwmon: (lm90) Add power control Wei Ni
2013-09-09 11:12 ` Mark Brown
2013-09-09 11:34 ` Guenter Roeck
2013-09-09 13:50 ` Mark Brown
2013-09-09 15:50 ` Guenter Roeck
2013-09-09 16:02 ` Mark Brown
2013-09-09 16:17 ` Guenter Roeck
2013-09-09 20:39 ` Mark Brown
2013-09-10 4:05 ` Wei Ni
2013-09-10 4:50 ` Guenter Roeck
2013-09-10 5:39 ` Wei Ni
2013-09-10 5:54 ` Guenter Roeck
2013-09-10 6:30 ` Wei Ni
2013-09-10 10:13 ` Mark Brown
2013-09-10 11:29 ` Wei Ni
2013-09-10 12:11 ` Mark Brown
2013-09-11 9:40 ` Wei Ni
2013-09-10 3:22 ` Wei Ni
2013-09-10 3:36 ` Guenter Roeck
2013-09-10 3:40 ` Stephen Warren
2013-09-10 3:53 ` Guenter Roeck
2013-09-10 4:12 ` Wei Ni
2013-09-10 4:13 ` Stephen Warren
2013-09-10 4:44 ` Guenter Roeck
2013-09-10 10:09 ` Mark Brown
2013-09-10 15:07 ` Stephen Warren
2013-09-10 17:04 ` Mark Brown
2013-09-10 17:44 ` Stephen Warren
2013-09-10 18:07 ` Guenter Roeck [this message]
2013-09-10 18:18 ` Mark Brown
2013-09-10 18:37 ` Stephen Warren
2013-09-10 18:52 ` Mark Brown
2013-09-11 11:35 ` Wei Ni
2013-09-10 17:05 ` Mark Brown
2013-09-09 10:29 ` [PATCH v3 2/2] Documentation: dt: hwmon: add OF document for LM90 Wei Ni
2013-09-09 10:52 ` Guenter Roeck
2013-09-09 22:14 ` Stephen Warren
2013-09-10 4:25 ` Wei Ni
2013-09-09 10:57 ` Ramkumar Ramachandra
2013-09-10 4:35 ` Wei Ni
2013-09-10 4:36 ` Wei Ni
2013-09-09 22:15 ` Stephen Warren
2013-09-09 22:23 ` Guenter Roeck
2013-09-10 4:25 ` Wei Ni
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=20130910180747.GA8164@roeck-us.net \
--to=linux@roeck-us.net \
--cc=broonie@kernel.org \
--cc=khali@linux-fr.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tegra@vger.kernel.org \
--cc=lm-sensors@lm-sensors.org \
--cc=swarren@wwwdotorg.org \
--cc=wni@nvidia.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
Powered by JetHome