All of lore.kernel.org
 help / color / mirror / Atom feed
* Device Tree nodes ending with -supply
@ 2019-05-20 15:51 ` Maxime Ripard
  0 siblings, 0 replies; 5+ messages in thread
From: Maxime Ripard @ 2019-05-20 15:51 UTC (permalink / raw)
  To: Rob Herring; +Cc: devicetree, Chen-Yu Tsai, linux-arm-kernel

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

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

* Device Tree nodes ending with -supply
@ 2019-05-20 15:51 ` Maxime Ripard
  0 siblings, 0 replies; 5+ messages in thread
From: Maxime Ripard @ 2019-05-20 15:51 UTC (permalink / raw)
  To: Rob Herring; +Cc: devicetree, Chen-Yu Tsai, linux-arm-kernel

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

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: Device Tree nodes ending with -supply
  2019-05-20 15:51 ` Maxime Ripard
@ 2019-05-20 19:46   ` Rob Herring
  -1 siblings, 0 replies; 5+ messages in thread
From: Rob Herring @ 2019-05-20 19:46 UTC (permalink / raw)
  To: Maxime Ripard
  Cc: devicetree, Chen-Yu Tsai,
	moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE

On Mon, May 20, 2019 at 10:51 AM Maxime Ripard
<maxime.ripard@bootlin.com> wrote:
>
> 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?)

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

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

* Re: Device Tree nodes ending with -supply
@ 2019-05-20 19:46   ` Rob Herring
  0 siblings, 0 replies; 5+ messages in thread
From: Rob Herring @ 2019-05-20 19:46 UTC (permalink / raw)
  To: Maxime Ripard
  Cc: devicetree, Chen-Yu Tsai,
	moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE

On Mon, May 20, 2019 at 10:51 AM Maxime Ripard
<maxime.ripard@bootlin.com> wrote:
>
> 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?)

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

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: Device Tree nodes ending with -supply
  2019-05-20 19:46   ` Rob Herring
  (?)
@ 2019-05-21  8:19   ` Maxime Ripard
  -1 siblings, 0 replies; 5+ messages in thread
From: Maxime Ripard @ 2019-05-21  8:19 UTC (permalink / raw)
  To: Rob Herring
  Cc: devicetree, Chen-Yu Tsai,
	moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE


[-- Attachment #1.1: Type: text/plain, Size: 1450 bytes --]

On Mon, May 20, 2019 at 02:46:11PM -0500, Rob Herring wrote:
> On Mon, May 20, 2019 at 10:51 AM Maxime Ripard
> <maxime.ripard@bootlin.com> wrote:
> >
> > 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?)
>
> 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.

Great, thanks!
Maxime

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

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

[-- Attachment #2: Type: text/plain, Size: 176 bytes --]

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

end of thread, other threads:[~2019-05-21  8:19 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-20 15:51 Device Tree nodes ending with -supply Maxime Ripard
2019-05-20 15:51 ` Maxime Ripard
2019-05-20 19:46 ` Rob Herring
2019-05-20 19:46   ` Rob Herring
2019-05-21  8:19   ` Maxime Ripard

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.