mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Naresh Solanki <naresh.solanki@9elements.com>
To: Rob Herring <robh@kernel.org>
Cc: zev@bewilderbeest.net, Liam Girdwood <lgirdwood@gmail.com>,
	Mark Brown <broonie@kernel.org>,
	Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
	linux-kernel@vger.kernel.org, devicetree@vger.kernel.org
Subject: Re: [PATCH v2 1/2] dt-bindings: regulator: Add support for multiple supplies
Date: Wed, 3 May 2023 13:33:11 +0530	[thread overview]
Message-ID: <228e9d1d-47fc-e62b-b0dc-013b36ba2c9e@9elements.com> (raw)
In-Reply-To: <fa096963-c173-dacc-647f-21a367c772b0@9elements.com>

Hi Rob,

On 24-04-2023 02:22 pm, Naresh Solanki wrote:
> Hi Rob,
> 
> On 22-04-2023 03:06 am, Rob Herring wrote:
>> On Thu, Apr 20, 2023 at 09:24:01PM +0200, Naresh Solanki wrote:
>>> Add optional DT property 'regulator-supplies' to handle connectors with
>>> multiple supplies.
>>> If this property is present, it will determine all regulator supplies.
>>> Otherwise, the 'vout' supply will be used as a fallback.
>>>
>>> This change improves support for connector like PCIe connectors on
>>> mainboards that can be powered by 12V and 3.3V supplies.
>>>
>>> Signed-off-by: Naresh Solanki <Naresh.Solanki@9elements.com>
>>> ...
>>> Change in V2:
>>> - Added example
>>> - Update property type & description.
>>> - Improve commit message
>>> ---
>>>   .../bindings/regulator/regulator-output.yaml  | 21 ++++++++++++++++---
>>>   1 file changed, 18 insertions(+), 3 deletions(-)
>>>
>>> diff --git 
>>> a/Documentation/devicetree/bindings/regulator/regulator-output.yaml 
>>> b/Documentation/devicetree/bindings/regulator/regulator-output.yaml
>>> index 078b37a1a71a..a9dce26991ff 100644
>>> --- a/Documentation/devicetree/bindings/regulator/regulator-output.yaml
>>> +++ b/Documentation/devicetree/bindings/regulator/regulator-output.yaml
>>> @@ -21,13 +21,22 @@ properties:
>>>     compatible:
>>>       const: regulator-output
>>> -  vout-supply:
>>> +  regulator-supplies:
>>> +    $ref: /schemas/types.yaml#/definitions/string-array
>>>       description:
>>> -      Phandle of the regulator supplying the output.
>>> +      Optional property that specifies supply names provided by
>>> +      the regulator. Defaults to "vout" if not specified. The
>>> +      array contains a list of supply names.
>>> +      Each supply name corresponds to a phandle in the
>>> +      patternProperties.
>>> +
>>> +patternProperties:
>>> +  ".*-supply":
>>> +    description:
>>> +      Specifies the phandle for various supplies
>>
>> While you say use 'vout-supply' for a single supply, nothing enforces
>> that anymore.
>>
>>>   required:
>>>     - compatible
>>> -  - vout-supply
>>>   additionalProperties: false
>>> @@ -37,3 +46,9 @@ examples:
>>>             compatible = "regulator-output";
>>>             vout-supply = <&output_reg>;
>>>         };
>>> +      out2 {
>>> +          compatible = "regulator-output";
>>> +          regulator-supplies = "sw0", "sw1";
>>> +          sw0-supply = <&out2_sw0>;
>>> +          sw1-supply = <&out2_sw1>;
>>
>> Names in the consumer are relative to the consumer. You appear to be
>> naming these by the supplier. Just add vout[0-9]-supply and iterate over
>> that name in the driver. Then you don't need "regulator-supplies".
>> Really, you never did. You could just find all properties ending in
>> "-supply".
> Please correct me if I have misunderstood anything
> What I understood is:
> 1. Use 'for_each_property_of_node' & iterate each property,
> 2. String compare each property name ending with '-supply',
> 3. If there is match then initialize accordingly.
> This way all *-supply property are also included including vout-supply.
> This way, regulator-supplies isn't needed.
> Shall I go ahead in this way ?
I wanted to follow up on our previous discussion regarding the naming of 
properties in the consumer. Based on your feedback, I believe that I 
should use 'for_each_property_of_node' to iterate over each property and 
then string compare each property name to find those that end with 
'-supply'. This way, all *-supply properties will be included, including 
vout-supply, and the 'regulator-supplies' won't be needed.
Can you please confirm if my understanding is correct?
Thank you.
> 
>>
>> Rob
> Regards,
> Naresh

      reply	other threads:[~2023-05-03  8:04 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-20 19:24 Naresh Solanki
2023-04-20 19:24 ` [PATCH v2 2/2] regulator: userspace-consumer: Support multiple supplies in DT Naresh Solanki
2023-04-21 21:36 ` [PATCH v2 1/2] dt-bindings: regulator: Add support for multiple supplies Rob Herring
2023-04-24  8:52   ` Naresh Solanki
2023-05-03  8:03     ` Naresh Solanki [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=228e9d1d-47fc-e62b-b0dc-013b36ba2c9e@9elements.com \
    --to=naresh.solanki@9elements.com \
    --cc=broonie@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=lgirdwood@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --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

all inboxes | Powered by JetHome®