lkml.org 
[lkml]   [2016]   [Sep]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] usb: phy: generic: request regulator optionally
On 2016-09-06 01:22, Mark Brown wrote:
> On Tue, Sep 06, 2016 at 10:45:19AM +0300, Felipe Balbi wrote:
>> Stefan Agner <stefan@agner.ch> writes:
>
>> > According to the device tree bindings the vcc-supply is optional.
>
> This is nonsense unless the device can work without this supply. Given
> that the supply is called VCC that doesn't seem entirely likely.

Afaik it is kind of a generic device tree binding, I guess the physical
device can have various appearances and properties...

A quick survey showed several device trees which do not specify
vcc-supply...

That said, I checked the device at hand, and it actually has a USB PHY
power supply inputs, but the device tree does not model them.

>> > + nop->vcc = devm_regulator_get_optional(dev, "vcc");
>> > if (IS_ERR(nop->vcc)) {
>> > dev_dbg(dev, "Error getting vcc regulator: %ld\n",
>> > PTR_ERR(nop->vcc));
>> > - if (needs_vcc)
>> > - return -EPROBE_DEFER;
>> > + if (needs_vcc || PTR_ERR(nop->vcc) == -EPROBE_DEFER)
>> > + return PTR_ERR(nop->vcc);
>
>> does this look okay from a regulator API perspective?
>
> That's how to use _get_optional() but it's really unusual that you
> should be using _get_optional().

Despite the above findings, I still think it is the right thing to do as
long as we specify vcc-supply to be optional.

--
Stefan

\
 
 \ /
  Last update: 2016-09-17 09:58    [W:0.060 / U:0.592 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site