[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20220420150759.713fcd02@bootlin.com>
Date: Wed, 20 Apr 2022 15:07:59 +0200
From: Herve Codina <herve.codina@...tlin.com>
To: Geert Uytterhoeven <geert@...ux-m68k.org>
Cc: Marek Vasut <marek.vasut+renesas@...il.com>,
Yoshihiro Shimoda <yoshihiro.shimoda.uh@...esas.com>,
Bjorn Helgaas <bhelgaas@...gle.com>,
Rob Herring <robh+dt@...nel.org>,
Krzysztof Kozlowski <krzk+dt@...nel.org>,
Geert Uytterhoeven <geert+renesas@...der.be>,
Magnus Damm <magnus.damm@...il.com>,
Lorenzo Pieralisi <lorenzo.pieralisi@....com>,
Krzysztof Wilczyński <kw@...ux.com>,
Rob Herring <robh@...nel.org>,
linux-pci <linux-pci@...r.kernel.org>,
Linux-Renesas <linux-renesas-soc@...r.kernel.org>,
"open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS"
<devicetree@...r.kernel.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
Sergey Shtylyov <s.shtylyov@....ru>,
Thomas Petazzoni <thomas.petazzoni@...tlin.com>,
Clement Leger <clement.leger@...tlin.com>,
Miquel Raynal <miquel.raynal@...tlin.com>
Subject: Re: [PATCH v2 3/8] dt-bindings: PCI: renesas-pci-usb: Allow
multiple clocks
Hi Geert, Rob,
On Thu, 14 Apr 2022 10:35:07 +0200
Geert Uytterhoeven <geert@...ux-m68k.org> wrote:
> Hi Hervé,
>
> On Thu, Apr 14, 2022 at 9:40 AM Herve Codina <herve.codina@...tlin.com> wrote:
> > Define that multiple clocks can be present at clocks property.
> >
> > Signed-off-by: Herve Codina <herve.codina@...tlin.com>
>
> Thanks for your patch!
>
> > --- a/Documentation/devicetree/bindings/pci/renesas,pci-usb.yaml
> > +++ b/Documentation/devicetree/bindings/pci/renesas,pci-usb.yaml
> > @@ -54,7 +54,8 @@ properties:
> > Standard property that helps to define the interrupt mapping.
> >
> > clocks:
> > - description: The reference to the device clock.
> > + description:
> > + The references to the device clocks (several clocks can be referenced).
>
> Please describe the clocks, and add the missing "clock-names" property.
>
> >
> > bus-range:
> > description: |
>
> I think it would be better to combine this with [PATCH v2 4/8], as the
> additional clocks are only present on RZ/N1.
>
> Then you can easily add json-schema logic to enforce the correct
> number of clocks, depending on the compatible value.
Sure.
Is there a way to have the clocks description depending on the compatible value.
I mean something like:
--- 8< ---
properties:
clocks:
maxItems: 1
if:
properties:
compatible:
contains:
enum:
- renesas,pci-r9a06g032
- renesas,pci-rzn1
then:
properties:
clocks:
items:
- description: Internal bus clock (AHB) for HOST
- description: Internal bus clock (AHB) Power Management
- description: PCI clock for USB subsystem
minItems: 3
maxItems: 3
else:
properties:
items:
- description: Device clock
clocks:
minItems: 1
maxItems: 1
--- 8< ---
In fact, I would like to describe the 3 clocks only for the r9a06g032 SOC
and the rzn1 family and have an other description for the other 'compatible'.
I cannot succeed to do it.
The only thing I can do is to leave the description of the 3 clocks out of the
conditional part. This leads to :
--- 8< ---
properties:
clocks:
items:
- description: Internal bus clock (AHB) for HOST
- description: Internal bus clock (AHB) Power Management
- description: PCI clock for USB subsystem
minItems: 1
if:
properties:
compatible:
contains:
enum:
- renesas,pci-r9a06g032
- renesas,pci-rzn1
then:
properties:
clocks:
minItems: 3
maxItems: 3
else:
properties:
clocks:
minItems: 1
maxItems: 1
--- 8< ---
Also the clock-names items can be different depending on the
compatible value.
Regards,
Hervé
--
Hervé Codina, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
Powered by blists - more mailing lists