All of lore.kernel.org
 help / color / mirror / Atom feed
* Voltage and current regulator: usage of 'regulators' parent node in device tree
@ 2021-08-23 12:53 embedded (VIVAVIS AG)
       [not found] ` <809518e1649a469cb4fc6fffd9bf427c-dQ8pE230Wp9BDgjK7y7TUQ@public.gmane.org>
  0 siblings, 1 reply; 7+ messages in thread
From: embedded (VIVAVIS AG) @ 2021-08-23 12:53 UTC (permalink / raw)
  To: devicetree-spec-u79uwXL29TY76Z2rM5mHXA

Dear maintainer,

I see a lot of Device trees wrapping the regulator nodes within a parent node
like this

regulators {
    compatible = "simple-bus";
    #address-cells = <1>;
    #size-cells = <0>;
    reg_p3v3: regulator@0 {
        compatible = "regulator-fixed";
        [...]
        regulator-always-on;
    };
    [...]

Contrary to that, patches exist removing the 'regulators' node, because the 'simple-bus'
doesn't really exist in hardware. Unfortunately, the documentation is unclear about
wrapping regulator nodes like shown above.

Should I avoid the parent 'regulators' node and why?

Is the given naming schema in fixed-regulator.yaml best practice to follow?

    reg_xyz: regulator-xyz {
      compatible = "regulator-fixed";
      regulator-name = "xyz";

Thank you for clarification.

Carsten Stelling


^ permalink raw reply	[flat|nested] 7+ messages in thread

* AW: Voltage and current regulator: usage of 'regulators' parent node in device tree
       [not found] ` <809518e1649a469cb4fc6fffd9bf427c-dQ8pE230Wp9BDgjK7y7TUQ@public.gmane.org>
@ 2021-09-07 15:40   ` embedded (VIVAVIS AG)
  2021-09-07 18:16   ` Rob Herring
  1 sibling, 0 replies; 7+ messages in thread
From: embedded (VIVAVIS AG) @ 2021-09-07 15:40 UTC (permalink / raw)
  To: devicetree-spec-u79uwXL29TY76Z2rM5mHXA, robh+dt-DgEjT+Ai2ygdnm+yROfE0A

I'd really appreciate it, if you can give me feedback on my question.
Thank you.

> Dear maintainer,
>
> I see a lot of Device trees wrapping the regulator nodes within a parent node
> like this
>
> regulators {
>    compatible = "simple-bus";
>    #address-cells = <1>;
>    #size-cells = <0>;
>    reg_p3v3: regulator@0 {
>        compatible = "regulator-fixed";
>        [...]
>        regulator-always-on;
>    };
>    [...]
>
> Contrary to that, patches exist removing the 'regulators' node, because the 'simple-bus'
> doesn't really exist in hardware. Unfortunately, the documentation is unclear about
> wrapping regulator nodes like shown above.
>
> Should I avoid the parent 'regulators' node and why?
>
> Is the given naming schema in fixed-regulator.yaml best practice to follow?
>
>    reg_xyz: regulator-xyz {
>      compatible = "regulator-fixed";
>      regulator-name = "xyz";
>
> Thank you for clarification.
>
> Carsten Stelling


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Voltage and current regulator: usage of 'regulators' parent node in device tree
       [not found] ` <809518e1649a469cb4fc6fffd9bf427c-dQ8pE230Wp9BDgjK7y7TUQ@public.gmane.org>
  2021-09-07 15:40   ` AW: " embedded (VIVAVIS AG)
@ 2021-09-07 18:16   ` Rob Herring
       [not found]     ` <CAL_JsqLBiq0+MnYQ0=vMEDe_n+gHAT8PP6VO=Quj-A4yOCu_6w-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  1 sibling, 1 reply; 7+ messages in thread
From: Rob Herring @ 2021-09-07 18:16 UTC (permalink / raw)
  To: embedded (VIVAVIS AG); +Cc: devicetree-spec-u79uwXL29TY76Z2rM5mHXA

On Mon, Aug 23, 2021 at 7:59 AM embedded (VIVAVIS AG)
<embedded-dQ8pE230Wp9BDgjK7y7TUQ@public.gmane.org> wrote:
>
> Dear maintainer,
>
> I see a lot of Device trees wrapping the regulator nodes within a parent node
> like this
>
> regulators {
>     compatible = "simple-bus";
>     #address-cells = <1>;
>     #size-cells = <0>;
>     reg_p3v3: regulator@0 {
>         compatible = "regulator-fixed";
>         [...]
>         regulator-always-on;
>     };
>     [...]
>
> Contrary to that, patches exist removing the 'regulators' node, because the 'simple-bus'
> doesn't really exist in hardware. Unfortunately, the documentation is unclear about
> wrapping regulator nodes like shown above.
>
> Should I avoid the parent 'regulators' node and why?

Yes and no. Yes, in the above case as there is no bus nor grouping of
fixed regulators. For a MFD that includes regulators, then a child
'regulators' node is appropriate. To put it another way, if you have a
schema defining a 'regulators' node, then it probably is appropriate.

> Is the given naming schema in fixed-regulator.yaml best practice to follow?
>
>     reg_xyz: regulator-xyz {
>       compatible = "regulator-fixed";
>       regulator-name = "xyz";

Yes, pretty much.

Rob

^ permalink raw reply	[flat|nested] 7+ messages in thread

* AW: Voltage and current regulator: usage of 'regulators' parent node in device tree
       [not found]     ` <CAL_JsqLBiq0+MnYQ0=vMEDe_n+gHAT8PP6VO=Quj-A4yOCu_6w-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2021-09-08  8:38       ` embedded (VIVAVIS AG)
  0 siblings, 0 replies; 7+ messages in thread
From: embedded (VIVAVIS AG) @ 2021-09-08  8:38 UTC (permalink / raw)
  To: Rob Herring; +Cc: devicetree-spec-u79uwXL29TY76Z2rM5mHXA

Hi Rob,

> On Mon, Aug 23, 2021 at 7:59 AM embedded (VIVAVIS AG)
> <embedded@vivavis.com> wrote:
> >
> > Dear maintainer,
> >
> > I see a lot of Device trees wrapping the regulator nodes within a parent node
> > like this
> >
> > regulators {
> >     compatible = "simple-bus";
> >     #address-cells = <1>;
> >     #size-cells = <0>;
> >     reg_p3v3: regulator@0 {
> >         compatible = "regulator-fixed";
> >         [...]
> >         regulator-always-on;
> >     };
> >     [...]
> >
> > Contrary to that, patches exist removing the 'regulators' node, because the 'simple-bus'
> > doesn't really exist in hardware. Unfortunately, the documentation is unclear about
> > wrapping regulator nodes like shown above.
> >
> > Should I avoid the parent 'regulators' node and why?
>
> Yes and no. Yes, in the above case as there is no bus nor grouping of
> fixed regulators. For a MFD that includes regulators, then a child
> 'regulators' node is appropriate. To put it another way, if you have a
> schema defining a 'regulators' node, then it probably is appropriate.
>
> > Is the given naming schema in fixed-regulator.yaml best practice to follow?
> >
> >     reg_xyz: regulator-xyz {
> >       compatible = "regulator-fixed";
> >       regulator-name = "xyz";
>
> Yes, pretty much.
> 
> Rob

Think I understand.
MFD might be an integrated power management controller connected to an I2C bus or kind of GPIO.
In this case the regulators node is used as child node under the node describing the PMIC.
Found this binding example for MAX8997 /devicetree/bindings/regulator/max8997-regulator.txt.

max8997_pmic@66 {
    compatible = "maxim,max8997-pmic";
    <snip>
    regulators: {  // child node here
        regulators {
            ldo1_reg: LDO1 { 
            regulator-name = "VDD_ABB_3.3V";
            regulator-min-microvolt = <3300000>;
            regulator-max-microvolt = <3300000>;
        };
        ldo2_reg: LDO2 {
            regulator-name = "VDD_ALIVE_1.1V";
            regulator-min-microvolt = <1100000>;
            regulator-max-microvolt = <1100000>;
            regulator-always-on;
        };
        buck1_reg: BUCK1 {
            regulator-name = "VDD_ARM_1.2V";
            regulator-min-microvolt = <950000>;
            regulator-max-microvolt = <1350000>;
            regulator-always-on;
            regulator-boot-on;
        };
    };
};

To describe my simple 3.3V and 5.0V voltage regulators on the board (not integrated
in a PMIC nor connected to a bus), I should not use the regulators node and put their
descriptions to the root node.

reg_3v3: regulator-3v3 {
    compatible = "regulator-fixed";
    regulator-name = "3v3";
    regulator-min-microvolt = <3300000>;
    regulator-max-microvolt = <3300000>;
    regulator-always-on;
};
reg_5v0: regulator-5v0 {
    compatible = "regulator-fixed";
    regulator-name = "5v0";
    regulator-min-microvolt = <5000000>;
    regulator-max-microvolt = <5000000>;
    regulator-always-on;
};

Thank you very much.

Carsten

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Voltage and current regulator: usage of 'regulators' parent node in device tree
@ 2021-07-08  8:20 embedded (VIVAVIS AG)
  0 siblings, 0 replies; 7+ messages in thread
From: embedded (VIVAVIS AG) @ 2021-07-08  8:20 UTC (permalink / raw)
  To: devicetree

I see a lot of Device trees wrapping the regulator nodes within a parent node
like this

regulators {
    compatible = "simple-bus";
    #address-cells = <1>;
    #size-cells = <0>;
    reg_p3v3: regulator@0 {
        compatible = "regulator-fixed";
        [...]
        regulator-always-on;
    };
    [...]

Contrary to that, patches exist removing the 'regulators' node, because the 'simple-bus'
doesn't really exist in hardware. Unfortunately, the documentation is unclear about
wrapping regulator nodes like shown above.

Should I avoid the parent 'regulators' node and why?

Is the given naming schema in fixed-regulator.yaml best practice to follow?

    reg_xyz: regulator-xyz {
      compatible = "regulator-fixed";
      regulator-name = "xyz";

Thank you for clarification.

Carsten Stelling


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Voltage and current regulator: usage of 'regulators' parent node in device tree
  2021-07-07 13:09 embedded (VIVAVIS AG)
@ 2021-07-07 15:29 ` Mark Brown
  0 siblings, 0 replies; 7+ messages in thread
From: Mark Brown @ 2021-07-07 15:29 UTC (permalink / raw)
  To: embedded (VIVAVIS AG); +Cc: linux-kernel

[-- Attachment #1: Type: text/plain, Size: 284 bytes --]

On Wed, Jul 07, 2021 at 01:09:25PM +0000, embedded (VIVAVIS AG) wrote:

> Should I avoid the parent 'regulators' node?

You should ask the DT maintainers, I don't really mind either way TBH.
My understanding was to avoid the parent node but can't remember why or
if it was important.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Voltage and current regulator: usage of 'regulators' parent node in device tree
@ 2021-07-07 13:09 embedded (VIVAVIS AG)
  2021-07-07 15:29 ` Mark Brown
  0 siblings, 1 reply; 7+ messages in thread
From: embedded (VIVAVIS AG) @ 2021-07-07 13:09 UTC (permalink / raw)
  To: linux-kernel; +Cc: broonie

I see a lot of Devicetrees wrapping the regulator nodes within a parent node
like this

regulators {
    compatible = "simple-bus";
    #address-cells = <1>;
    #size-cells = <0>;
    reg_p3v3: regulator@0 {
        compatible = "regulator-fixed";
        [...]
        regulator-always-on;
    };
    [...]

Contrary to that, patches exist removing the 'regulators' node, because the 'simple-bus'
doesn't really exist in hardware. Unfortunately, the documentation is unclear about
wrapping regulator nodes like shown above.

Should I avoid the parent 'regulators' node?

Is the given naming schema in fixed-regulator.yaml best practice to follow?

    reg_xyz: regulator-xyz {
      compatible = "regulator-fixed";
      regulator-name = "xyz";

Thank you for clarification.

Carsten Stelling


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2021-09-08  8:38 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-23 12:53 Voltage and current regulator: usage of 'regulators' parent node in device tree embedded (VIVAVIS AG)
     [not found] ` <809518e1649a469cb4fc6fffd9bf427c-dQ8pE230Wp9BDgjK7y7TUQ@public.gmane.org>
2021-09-07 15:40   ` AW: " embedded (VIVAVIS AG)
2021-09-07 18:16   ` Rob Herring
     [not found]     ` <CAL_JsqLBiq0+MnYQ0=vMEDe_n+gHAT8PP6VO=Quj-A4yOCu_6w-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2021-09-08  8:38       ` AW: " embedded (VIVAVIS AG)
  -- strict thread matches above, loose matches on Subject: below --
2021-07-08  8:20 embedded (VIVAVIS AG)
2021-07-07 13:09 embedded (VIVAVIS AG)
2021-07-07 15:29 ` Mark Brown

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.