mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Wei Ni <wni@nvidia.com>
To: Guenter Roeck <linux@roeck-us.net>
Cc: Stephen Warren <swarren@wwwdotorg.org>,
	Mark Brown <broonie@kernel.org>,
	"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 12:12:46 +0800	[thread overview]
Message-ID: <522E9C3E.7080209@nvidia.com> (raw)
In-Reply-To: <522E97CE.4070300@roeck-us.net>

On 09/10/2013 11:53 AM, Guenter Roeck wrote:
> On 09/09/2013 08:40 PM, Stephen Warren wrote:
>> On 09/09/2013 09:36 PM, Guenter Roeck wrote:
>>> On 09/09/2013 08:22 PM, Wei Ni wrote:
>>>> On 09/09/2013 11:50 PM, Guenter Roeck wrote:
>>>>> On Mon, Sep 09, 2013 at 02:50:22PM +0100, Mark Brown wrote:
>>>>>> On Mon, Sep 09, 2013 at 04:34:43AM -0700, Guenter Roeck wrote:
>>>>>>> On 09/09/2013 04:12 AM, Mark Brown wrote:
>>>>>>>> On Mon, Sep 09, 2013 at 06:29:11PM +0800, Wei Ni wrote:
>>>>>>
>>>>>>>> This doesn't look good, it is going to ignore actual errors - I
>>>>>>>> *really*
>>>>>>>> doubt that vcc is optional, it looks like it's the main power
>>>>>>>> supply for
>>>>>>>> the device.  You should use normal regulator_get(), _optional() is
>>>>>>>> for
>>>>>>>> supplies which could physically not be provided in a system (eg,
>>>>>>>> if the
>>>>>>>> device can generate them internally if required).
>>>>>>
>>>>>>> Then he'll have to make sure that all devicetree files in the system
>>>>>>> contain references to this regulator.
>>>>>>
>>>>>> Or get the patches applied on top of the code that'll be going in this
>>>>>> cycle implementing get_optional() properly - when that's done the
>>>>>> default will be to provide a dummy supply for regulator_get().  If you
>>>>>> ack the patch I'd be happy to carry it.
>>>>>>
>>>>> Jean will have to ack it.
>>>>>
>>>> I think it's better to use get_optional(), and ignore the errors except
>>>> -EPROBE_DEFER. Because many platform may always power on this device,
>>>> and will not provide regulator for it, so if we get errors from
>>>> regulator subsystem and return it directly, then the probe() can't be
>>>> implemented, this driver can't work properly, even though it can work
>>>> without regulator support.
>>>> Mark, do you mean you have patches for regulator_get_optional() and
>>>> regulator_get()?
>>>>
>>>
>>> My understanding is that by adding regulator support you essentially
>>> committed to adding regulators (if necessary dummy ones) for this driver
>>> to all those platforms. This is quite similar to other drivers in the
>>> same situation. Once you start along that route, you'll have to go it
>>> all the way.
>>
>> By using regulator_get_optional(), the regulator should be optional,
>> hence you only have to add it to platforms that need it.
>>
> 
> Earlier comments suggest that this is not the intended use case for
> regulator_get_optional().

So I just need to use the regulator_get() instead, is it right?

> 
> Guenter
> 


  reply	other threads:[~2013-09-10  4:12 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 [this message]
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
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=522E9C3E.7080209@nvidia.com \
    --to=wni@nvidia.com \
    --cc=broonie@kernel.org \
    --cc=khali@linux-fr.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tegra@vger.kernel.org \
    --cc=linux@roeck-us.net \
    --cc=lm-sensors@lm-sensors.org \
    --cc=swarren@wwwdotorg.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

Powered by JetHome