diff mbox series

dt-bindings: net/dsa: Add spi-peripheral-props.yaml references

Message ID 20220525205752.2484423-1-robh@kernel.org (mailing list archive)
State Superseded
Delegated to: Netdev Maintainers
Headers show
Series dt-bindings: net/dsa: Add spi-peripheral-props.yaml references | expand

Checks

Context Check Description
netdev/tree_selection success Not a local patch

Commit Message

Rob Herring (Arm) May 25, 2022, 8:57 p.m. UTC
SPI peripheral device bindings need to reference spi-peripheral-props.yaml
in order to use various SPI controller specific properties. Otherwise,
the unevaluatedProperties check will reject any controller specific
properties.

Signed-off-by: Rob Herring <robh@kernel.org>
---
 Documentation/devicetree/bindings/net/dsa/microchip,ksz.yaml | 1 +
 Documentation/devicetree/bindings/net/dsa/realtek.yaml       | 1 +
 2 files changed, 2 insertions(+)

Comments

Vladimir Oltean May 26, 2022, 12:32 a.m. UTC | #1
On Wed, May 25, 2022 at 03:57:50PM -0500, Rob Herring wrote:
> SPI peripheral device bindings need to reference spi-peripheral-props.yaml
> in order to use various SPI controller specific properties. Otherwise,
> the unevaluatedProperties check will reject any controller specific
> properties.
> 
> Signed-off-by: Rob Herring <robh@kernel.org>
> ---
>  Documentation/devicetree/bindings/net/dsa/microchip,ksz.yaml | 1 +
>  Documentation/devicetree/bindings/net/dsa/realtek.yaml       | 1 +
>  2 files changed, 2 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/net/dsa/microchip,ksz.yaml b/Documentation/devicetree/bindings/net/dsa/microchip,ksz.yaml
> index 184152087b60..6bbd8145b6c1 100644
> --- a/Documentation/devicetree/bindings/net/dsa/microchip,ksz.yaml
> +++ b/Documentation/devicetree/bindings/net/dsa/microchip,ksz.yaml
> @@ -12,6 +12,7 @@ maintainers:
>  
>  allOf:
>    - $ref: dsa.yaml#
> +  - $ref: /schemas/spi/spi-peripheral-props.yaml#
>  
>  properties:
>    # See Documentation/devicetree/bindings/net/dsa/dsa.yaml for a list of additional
> diff --git a/Documentation/devicetree/bindings/net/dsa/realtek.yaml b/Documentation/devicetree/bindings/net/dsa/realtek.yaml
> index 99ee4b5b9346..4f99aff029dc 100644
> --- a/Documentation/devicetree/bindings/net/dsa/realtek.yaml
> +++ b/Documentation/devicetree/bindings/net/dsa/realtek.yaml
> @@ -108,6 +108,7 @@ if:
>      - reg
>  
>  then:
> +  $ref: /schemas/spi/spi-peripheral-props.yaml#
>    not:
>      required:
>        - mdc-gpios
> -- 
> 2.34.1
> 

Also needed by nxp,sja1105.yaml and the following from brcm,b53.yaml:
	brcm,bcm5325
	brcm,bcm5365
	brcm,bcm5395
	brcm,bcm5397
	brcm,bcm5398
	brcm,bcm53115
	brcm,bcm53125
	brcm,bcm53128
Linus Walleij May 26, 2022, 2:31 p.m. UTC | #2
On Wed, May 25, 2022 at 10:58 PM Rob Herring <robh@kernel.org> wrote:

> SPI peripheral device bindings need to reference spi-peripheral-props.yaml
> in order to use various SPI controller specific properties. Otherwise,
> the unevaluatedProperties check will reject any controller specific
> properties.
>
> Signed-off-by: Rob Herring <robh@kernel.org>

Very nice!
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>

Yours,
Linus Walleij
Rob Herring (Arm) May 26, 2022, 10:04 p.m. UTC | #3
On Thu, May 26, 2022 at 03:32:16AM +0300, Vladimir Oltean wrote:
> On Wed, May 25, 2022 at 03:57:50PM -0500, Rob Herring wrote:
> > SPI peripheral device bindings need to reference spi-peripheral-props.yaml
> > in order to use various SPI controller specific properties. Otherwise,
> > the unevaluatedProperties check will reject any controller specific
> > properties.
> > 
> > Signed-off-by: Rob Herring <robh@kernel.org>
> > ---
> >  Documentation/devicetree/bindings/net/dsa/microchip,ksz.yaml | 1 +
> >  Documentation/devicetree/bindings/net/dsa/realtek.yaml       | 1 +
> >  2 files changed, 2 insertions(+)
> > 
> > diff --git a/Documentation/devicetree/bindings/net/dsa/microchip,ksz.yaml b/Documentation/devicetree/bindings/net/dsa/microchip,ksz.yaml
> > index 184152087b60..6bbd8145b6c1 100644
> > --- a/Documentation/devicetree/bindings/net/dsa/microchip,ksz.yaml
> > +++ b/Documentation/devicetree/bindings/net/dsa/microchip,ksz.yaml
> > @@ -12,6 +12,7 @@ maintainers:
> >  
> >  allOf:
> >    - $ref: dsa.yaml#
> > +  - $ref: /schemas/spi/spi-peripheral-props.yaml#
> >  
> >  properties:
> >    # See Documentation/devicetree/bindings/net/dsa/dsa.yaml for a list of additional
> > diff --git a/Documentation/devicetree/bindings/net/dsa/realtek.yaml b/Documentation/devicetree/bindings/net/dsa/realtek.yaml
> > index 99ee4b5b9346..4f99aff029dc 100644
> > --- a/Documentation/devicetree/bindings/net/dsa/realtek.yaml
> > +++ b/Documentation/devicetree/bindings/net/dsa/realtek.yaml
> > @@ -108,6 +108,7 @@ if:
> >      - reg
> >  
> >  then:
> > +  $ref: /schemas/spi/spi-peripheral-props.yaml#
> >    not:
> >      required:
> >        - mdc-gpios
> > -- 
> > 2.34.1
> > 
> 
> Also needed by nxp,sja1105.yaml and the following from brcm,b53.yaml:
> 	brcm,bcm5325
> 	brcm,bcm5365
> 	brcm,bcm5395
> 	brcm,bcm5397
> 	brcm,bcm5398
> 	brcm,bcm53115
> 	brcm,bcm53125
> 	brcm,bcm53128

Okay. Looks like you missed bcm5389?

Rob
Vladimir Oltean May 26, 2022, 11:18 p.m. UTC | #4
On Thu, May 26, 2022 at 05:04:50PM -0500, Rob Herring wrote:
> On Thu, May 26, 2022 at 03:32:16AM +0300, Vladimir Oltean wrote:
> > Also needed by nxp,sja1105.yaml and the following from brcm,b53.yaml:
> > 	brcm,bcm5325
> > 	brcm,bcm5365
> > 	brcm,bcm5395
> > 	brcm,bcm5397
> > 	brcm,bcm5398
> > 	brcm,bcm53115
> > 	brcm,bcm53125
> > 	brcm,bcm53128
> 
> Okay. Looks like you missed bcm5389?

I went to the end of drivers/net/dsa/b53/b53_spi.c and copied the
compatible strings. "brcm,bcm5389" is marked in b53_mdio.c, so I would
guess not.
Rob Herring (Arm) May 31, 2022, 3:01 p.m. UTC | #5
On Fri, May 27, 2022 at 02:18:59AM +0300, Vladimir Oltean wrote:
> On Thu, May 26, 2022 at 05:04:50PM -0500, Rob Herring wrote:
> > On Thu, May 26, 2022 at 03:32:16AM +0300, Vladimir Oltean wrote:
> > > Also needed by nxp,sja1105.yaml and the following from brcm,b53.yaml:
> > > 	brcm,bcm5325
> > > 	brcm,bcm5365
> > > 	brcm,bcm5395
> > > 	brcm,bcm5397
> > > 	brcm,bcm5398
> > > 	brcm,bcm53115
> > > 	brcm,bcm53125
> > > 	brcm,bcm53128
> > 
> > Okay. Looks like you missed bcm5389?
> 
> I went to the end of drivers/net/dsa/b53/b53_spi.c and copied the
> compatible strings. "brcm,bcm5389" is marked in b53_mdio.c, so I would
> guess not.

The datasheet I found says it is SPI interface, but I guess someone that 
cares about this h/w can sort that out if needed.

Rob
Vladimir Oltean May 31, 2022, 9:41 p.m. UTC | #6
On Tue, May 31, 2022 at 10:01:01AM -0500, Rob Herring wrote:
> On Fri, May 27, 2022 at 02:18:59AM +0300, Vladimir Oltean wrote:
> > On Thu, May 26, 2022 at 05:04:50PM -0500, Rob Herring wrote:
> > > On Thu, May 26, 2022 at 03:32:16AM +0300, Vladimir Oltean wrote:
> > > > Also needed by nxp,sja1105.yaml and the following from brcm,b53.yaml:
> > > > 	brcm,bcm5325
> > > > 	brcm,bcm5365
> > > > 	brcm,bcm5395
> > > > 	brcm,bcm5397
> > > > 	brcm,bcm5398
> > > > 	brcm,bcm53115
> > > > 	brcm,bcm53125
> > > > 	brcm,bcm53128
> > > 
> > > Okay. Looks like you missed bcm5389?
> > 
> > I went to the end of drivers/net/dsa/b53/b53_spi.c and copied the
> > compatible strings. "brcm,bcm5389" is marked in b53_mdio.c, so I would
> > guess not.
> 
> The datasheet I found says it is SPI interface, but I guess someone that 
> cares about this h/w can sort that out if needed.
> 
> Rob

If someone adds a new compatible string for a SPI controlled DSA switch,
I will remember to remind him to update the dt-bindings doc as well.
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/net/dsa/microchip,ksz.yaml b/Documentation/devicetree/bindings/net/dsa/microchip,ksz.yaml
index 184152087b60..6bbd8145b6c1 100644
--- a/Documentation/devicetree/bindings/net/dsa/microchip,ksz.yaml
+++ b/Documentation/devicetree/bindings/net/dsa/microchip,ksz.yaml
@@ -12,6 +12,7 @@  maintainers:
 
 allOf:
   - $ref: dsa.yaml#
+  - $ref: /schemas/spi/spi-peripheral-props.yaml#
 
 properties:
   # See Documentation/devicetree/bindings/net/dsa/dsa.yaml for a list of additional
diff --git a/Documentation/devicetree/bindings/net/dsa/realtek.yaml b/Documentation/devicetree/bindings/net/dsa/realtek.yaml
index 99ee4b5b9346..4f99aff029dc 100644
--- a/Documentation/devicetree/bindings/net/dsa/realtek.yaml
+++ b/Documentation/devicetree/bindings/net/dsa/realtek.yaml
@@ -108,6 +108,7 @@  if:
     - reg
 
 then:
+  $ref: /schemas/spi/spi-peripheral-props.yaml#
   not:
     required:
       - mdc-gpios