Skip to contentSkip to conversation

Device Tree nodes ending with -supply

DISCUSSION Maxime Ripard 2 participants 3 messages May 20, 2019 – May 21, 2019

lore
Share & tools
lore
#0 lore raw

Hi Rob,

I've noticed that you recently added support to validate the *-supply properties in the dt-schema tools.

However, we have a family of PMIC that are exposing a bunch of power supplies (battery, AC, USB, etc) to know what is currently powering the board.

All these various supplies are exposed as children nodes of the PMIC itself, and they are named *-power-supply. For an example, you can look at:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/arch/arm/boot/dts/axp209.dtsi#n56

Now, those are obviously not properties, and yet the current dt-schema schemas are trying to validate them.

I'm not really sure how to fix that. Changing the node names seems like an obvious solution, but they seem to be what they should be. Can we reduce the scope of the validation to only match properties (ie arrays?) and not the nodes (objects?)

Thanks!
Maxime

--
Maxime Ripard, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

#1 lore raw
Quoted 15 lines · Maxime Ripard

Hi Rob,

I've noticed that you recently added support to validate the *-supply properties in the dt-schema tools.

However, we have a family of PMIC that are exposing a bunch of power supplies (battery, AC, USB, etc) to know what is currently powering the board.

All these various supplies are exposed as children nodes of the PMIC itself, and they are named *-power-supply. For an example, you can look at:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/arch/arm/boot/dts/axp209.dtsi#n56

Quoted 7 lines

Now, those are obviously not properties, and yet the current dt-schema schemas are trying to validate them.

I'm not really sure how to fix that. Changing the node names seems like an obvious solution, but they seem to be what they should be. Can we reduce the scope of the validation to only match properties (ie arrays?) and not the nodes (objects?)

While I'd prefer to avoid that node name, I fixed it with the fancy new if/then schema:

".*-supply$":

    if:
      not: { type: object }
    then:
      $ref: "types.yaml#/definitions/phandle"

I'll push it out shortly.

Rob

#2 lore raw
Quoted 28 lines · Rob Herring
Quoted 15 lines · Maxime Ripard

Hi Rob,

I've noticed that you recently added support to validate the *-supply properties in the dt-schema tools.

However, we have a family of PMIC that are exposing a bunch of power supplies (battery, AC, USB, etc) to know what is currently powering the board.

All these various supplies are exposed as children nodes of the PMIC itself, and they are named *-power-supply. For an example, you can look at:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/arch/arm/boot/dts/axp209.dtsi#n56

Quoted 7 lines

Now, those are obviously not properties, and yet the current dt-schema schemas are trying to validate them.

I'm not really sure how to fix that. Changing the node names seems like an obvious solution, but they seem to be what they should be. Can we reduce the scope of the validation to only match properties (ie arrays?) and not the nodes (objects?)

While I'd prefer to avoid that node name, I fixed it with the fancy new if/then schema:

Quoted 7 lines

".*-supply$":

    if:
      not: { type: object }
    then:
      $ref: "types.yaml#/definitions/phandle"

I'll push it out shortly.

Great, thanks!
Maxime

--
Maxime Ripard, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel