From: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
To: Zev Weiss <zev@bewilderbeest.net>, Rob Herring <robh@kernel.org>
Cc: Mark Brown <broonie@kernel.org>,
Liam Girdwood <lgirdwood@gmail.com>,
Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
Naresh Solanki <naresh.solanki@9elements.com>,
Patrick Rudolph <patrick.rudolph@9elements.com>,
Laxman Dewangan <ldewangan@nvidia.com>,
openbmc@lists.ozlabs.org
Subject: Re: [PATCH 2/3] dt-bindings: regulator: Add regulator-output binding
Date: Thu, 27 Oct 2022 21:22:10 -0400 [thread overview]
Message-ID: <ee37b5a1-5afc-71b3-f777-add295d9ce17@linaro.org> (raw)
In-Reply-To: <Y1rRCq9Kdd2zPPkw@hatter.bewilderbeest.net>
On 27/10/2022 14:42, Zev Weiss wrote:
> On Thu, Sep 29, 2022 at 02:27:20PM PDT, Zev Weiss wrote:
>> On Thu, Sep 29, 2022 at 02:07:14PM PDT, Rob Herring wrote:
>>> On Sun, Sep 25, 2022 at 03:03:18PM -0700, Zev Weiss wrote:
>>>> This describes a power output supplied by a regulator, such as a
>>>> power outlet on a power distribution unit (PDU).
>>>>
>>>> Signed-off-by: Zev Weiss <zev@bewilderbeest.net>
>>>> ---
>>>> .../bindings/regulator/regulator-output.yaml | 47 +++++++++++++++++++
>>>> 1 file changed, 47 insertions(+)
>>>> create mode 100644 Documentation/devicetree/bindings/regulator/regulator-output.yaml
>>>>
>>>> diff --git a/Documentation/devicetree/bindings/regulator/regulator-output.yaml b/Documentation/devicetree/bindings/regulator/regulator-output.yaml
>>>> new file mode 100644
>>>> index 000000000000..40953ec48e9e
>>>> --- /dev/null
>>>> +++ b/Documentation/devicetree/bindings/regulator/regulator-output.yaml
>>>> @@ -0,0 +1,47 @@
>>>> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
>>>> +%YAML 1.2
>>>> +---
>>>> +
>>>> +$id: http://devicetree.org/schemas/regulator/regulator-output.yaml#
>>>> +$schema: http://devicetree.org/meta-schemas/core.yaml#
>>>> +
>>>> +title: Regulator output connector
>>>> +
>>>> +maintainers:
>>>> + - Zev Weiss <zev@bewilderbeest.net>
>>>> +
>>>> +description: |
>>>> + This describes a power output connector supplied by a regulator,
>>>> + such as a power outlet on a power distribution unit (PDU). The
>>>> + connector may be standalone or merely one channel or set of pins
>>>> + within a ganged physical connector carrying multiple independent
>>>> + power outputs.
>>>> +
>>>> +properties:
>>>> + compatible:
>>>> + const: regulator-output
>>>> +
>>>> + vout-supply:
>>>> + description:
>>>> + Phandle of the regulator supplying the output.
>>>> +
>>>> + regulator-leave-on:
>>>> + description: |
>>>> + If the regulator is enabled when software relinquishes control
>>>> + of it (such as when shutting down) it should be left enabled
>>>> + instead of being turned off.
>>>> + type: boolean
>>>
>>> I'm not too sure about this one as there could be various times when
>>> control is relinquished. It is userspace closing its access?
>>> driver unbind? module unload? Does a bootloader pay attention to this?
>>>
>>> Rob
>>
>> Thanks for the feedback, Rob -- I'll admit I was a bit unsure how to
>> approach that, and this may well not be the right answer. What I'm
>> really aiming for is an appropriate way to express that regulator
>> on/off state should only ever be changed by explicit (external, e.g.
>> userspace) request, never as any sort of default/automatic action.
>> The two obvious things to guard against there seem to be automatic
>> enablement during initialization and automatic disablement on de-init
>> (shutdown, unbind, etc.). The former I think can be avoided by simply
>> not setting regulator-boot-on, so I added this as a corresponding
>> property to avoid the latter.
>>
>> I'm definitely open to suggestions for a better approach though.
>>
>
> Ping...
>
> Would something like this be preferable as a more direct description of
> that?
>
> regulator-manually-controlled:
> description: |
> The regulator should never be enabled or disabled automatically,
> only when explicitly requested by an external actor (e.g.
> userspace).
> type: boolean
This looks like putting policy and OS behavior into DT. I guess it easy
to understand in case of Linux which disables unclaimed regulators
during. But what if other system/firmware does not behave like that?
And what is the "external actor"? OS is not an external actor?
I could not get the problem you want to solve with this property - I
looked at cover letter and at commit msg.
I can only imagine that you want to keep regulator on, after last its
user disappears... but for what purpose? Do you expect that after system
shutdown the pin will stay high so regulator will be also on? If so, you
need hardware design, e.g. with some pull up (if control is over GPIO).
>
> That would leave the question of which property takes priority if both
> regulator-manually-controlled and regulator-boot-on are set -- should
> the binding document the answer to that? (I personally don't have a
> strong opinion on which it should be.)
Best regards,
Krzysztof
next prev parent reply other threads:[~2022-10-28 1:22 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-09-25 22:03 [PATCH 0/3] regulator: Add DT support for regulator-output connectors Zev Weiss
2022-09-25 22:03 ` [PATCH 1/3] regulator: devres: Add devm_regulator_bulk_get_exclusive() Zev Weiss
2022-09-25 22:03 ` [PATCH 2/3] dt-bindings: regulator: Add regulator-output binding Zev Weiss
2022-09-29 21:07 ` Rob Herring
2022-09-29 21:27 ` Zev Weiss
2022-10-27 18:42 ` Zev Weiss
2022-10-28 1:22 ` Krzysztof Kozlowski [this message]
2022-10-28 4:12 ` [PATCH 2/3] dt-bindings: regulator: Add regulator-output bindingg Zev Weiss
2022-10-28 15:51 ` Mark Brown
2022-10-28 19:44 ` Zev Weiss
2022-10-31 15:45 ` Mark Brown
2022-10-31 18:50 ` Zev Weiss
2022-10-27 18:54 ` [PATCH 2/3] dt-bindings: regulator: Add regulator-output binding Mark Brown
2022-09-25 22:03 ` [PATCH 3/3] regulator: userspace-consumer: Handle regulator-output DT nodes Zev Weiss
2022-09-29 6:29 ` [PATCH 0/3] regulator: Add DT support for regulator-output connectors Patrick Rudolph
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=ee37b5a1-5afc-71b3-f777-add295d9ce17@linaro.org \
--to=krzysztof.kozlowski@linaro.org \
--cc=broonie@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=krzysztof.kozlowski+dt@linaro.org \
--cc=ldewangan@nvidia.com \
--cc=lgirdwood@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=naresh.solanki@9elements.com \
--cc=openbmc@lists.ozlabs.org \
--cc=patrick.rudolph@9elements.com \
--cc=robh@kernel.org \
--cc=zev@bewilderbeest.net \
/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).