From: Stefan Agner <stefan@agner.ch>
To: Mark Brown <broonie@kernel.org>, Felipe Balbi <balbi@kernel.org>
Cc: gregkh@linuxfoundation.org, fabio.estevam@nxp.com,
linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] usb: phy: generic: request regulator optionally
Date: Wed, 07 Sep 2016 13:32:11 -0700 [thread overview]
Message-ID: <fe8b9b05e5604953092e1387c7759f87@agner.ch> (raw)
In-Reply-To: <20160907185325.GC3950@sirena.org.uk>
On 2016-09-07 11:53, Mark Brown wrote:
> On Tue, Sep 06, 2016 at 11:01:15AM -0700, Stefan Agner wrote:
>> On 2016-09-06 01:22, Mark Brown wrote:
>
>> > 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...
>
> Is it really realistic that a meaningful proportion of them will work
> without power?
>
No IP in a SoC runs without power, but still we don't model the supply
to every IP....
I would have guessed that there are SoCs with an internal USB PHY which
are powered implicitly by the SoC, and/or it is unclear how they exactly
get powered... If we make the supply mandatory, we can only guess how it
is wired up and probably end up to assign some "global" SoC supply
regulator.
>> A quick survey showed several device trees which do not specify
>> vcc-supply...
>
> The regulator framework will attempt to be forgiving in what it accepts,
> the absence of a mandatory supply is sadly not a good indication that
> the supply does not physically exist...
>
>> 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.
>
> ...like here.
>
>> > 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.
>
> I disagree, and bear in mind that it is more complex all round to handle
> optional supples - the reason they exist is that on devices where
> supplies may be omitted you usually have to do some kind of special case
> handling (like enabling internal regulators or something). If you don't
> have any such special case handling but instead simply omit enables and
> disables then that's a fairly clear abuse of the API.
Note that in this case the code already supports an optional supply e.g.
when it has not specified via platform data. The code does not do any
special in that case, it is assumed to be implicitly powered.
I am not really a USB PHY experts and don't have a good overview of what
is out there, I just did a short survey across the device trees we have,
and found some which were lacking the vcc-supply. I guess Felipe has a
better overview and just should make a call on that matter.
In case we decide to make vcc-supply mandatory for the device tree case,
I will send a new patch altering the bindings documentation accordingly
and get rid of the needs_vcc = of_property_read_bool(node,
"vcc-supply");. This should not break existing device trees since
devm_regulator_get returns the dummy regulators.
--
Stefan
prev parent reply other threads:[~2016-09-07 20:43 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-09-04 4:04 Stefan Agner
2016-09-06 7:45 ` Felipe Balbi
2016-09-06 8:22 ` Mark Brown
2016-09-06 18:01 ` Stefan Agner
2016-09-07 7:25 ` Roger Quadros
2016-09-07 8:03 ` Felipe Balbi
2016-09-07 18:53 ` Mark Brown
2016-09-07 20:32 ` Stefan Agner [this message]
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=fe8b9b05e5604953092e1387c7759f87@agner.ch \
--to=stefan@agner.ch \
--cc=balbi@kernel.org \
--cc=broonie@kernel.org \
--cc=fabio.estevam@nxp.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.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