* [PATCH] dt-bindings: hspi: Convert bindings to json-schema
@ 2019-09-13 12:21 Simon Horman
2019-09-13 20:22 ` Rob Herring
0 siblings, 1 reply; 3+ messages in thread
From: Simon Horman @ 2019-09-13 12:21 UTC (permalink / raw)
To: Mark Brown, Geert Uytterhoeven
Cc: Rob Herring, Mark Rutland, Magnus Damm, Yoshihiro Kaneko,
linux-spi, devicetree, linux-renesas-soc, Simon Horman
Convert Renesas HSPI bindings documentation to json-schema.
Also name bindings documentation file according to the compat string
being documented.
As a side effect of this change all currently supported/used compat
strings are listed while no while card compat string is documented.
This, in my opinion, is desirable as only supported hardware should
be documented.
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
---
Based on v5.3-rc1
Tested using:
make dtbs_check DT_SCHEMA_FILES=Documentation/devicetree/bindings/spi/renesas,hspi.yaml
---
.../devicetree/bindings/spi/renesas,hspi.yaml | 54 ++++++++++++++++++++++
Documentation/devicetree/bindings/spi/sh-hspi.txt | 26 -----------
2 files changed, 54 insertions(+), 26 deletions(-)
create mode 100644 Documentation/devicetree/bindings/spi/renesas,hspi.yaml
delete mode 100644 Documentation/devicetree/bindings/spi/sh-hspi.txt
diff --git a/Documentation/devicetree/bindings/spi/renesas,hspi.yaml b/Documentation/devicetree/bindings/spi/renesas,hspi.yaml
new file mode 100644
index 000000000000..94a64a33daf4
--- /dev/null
+++ b/Documentation/devicetree/bindings/spi/renesas,hspi.yaml
@@ -0,0 +1,54 @@
+# SPDX-License-Identifier: GPL-2.0
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/spi/renesas,hspi.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Renesas HSPI
+
+maintainers:
+ - Geert Uytterhoeven <geert+renesas@glider.be>
+
+properties:
+ compatible:
+ items:
+ - enum:
+ - renesas,hspi-r8a7778 # R-Car M1A
+ - renesas,hspi-r8a7779 # R-Car H1
+ - const: renesas,hspi
+
+ reg:
+ maxItems: 1
+
+ interrupts:
+ maxItems: 1
+
+ '#address-cells':
+ const: 1
+
+ '#size-cells':
+ const: 0
+
+ # Pinctrl properties might be needed, too.
+ # See Documentation/devicetree/bindings/pinctrl/renesas,*.
+
+required:
+ - compatible
+ - reg
+ - interrupts
+ - '#address-cells'
+ - '#size-cells'
+
+examples:
+ - |
+ #include <dt-bindings/interrupt-controller/irq.h>
+
+ hspi0: spi@fffc7000 {
+ compatible = "renesas,hspi-r8a7778", "renesas,hspi";
+ reg = <0xfffc7000 0x18>;
+ interrupt-parent = <&gic>;
+ interrupts = <0 63 IRQ_TYPE_LEVEL_HIGH>;
+ #address-cells = <1>;
+ #size-cells = <0>;
+ };
+
diff --git a/Documentation/devicetree/bindings/spi/sh-hspi.txt b/Documentation/devicetree/bindings/spi/sh-hspi.txt
deleted file mode 100644
index b9d1e4d11a77..000000000000
--- a/Documentation/devicetree/bindings/spi/sh-hspi.txt
+++ /dev/null
@@ -1,26 +0,0 @@
-Renesas HSPI.
-
-Required properties:
-- compatible : "renesas,hspi-<soctype>", "renesas,hspi" as fallback.
- Examples with soctypes are:
- - "renesas,hspi-r8a7778" (R-Car M1)
- - "renesas,hspi-r8a7779" (R-Car H1)
-- reg : Offset and length of the register set for the device
-- interrupts : Interrupt specifier
-- #address-cells : Must be <1>
-- #size-cells : Must be <0>
-
-Pinctrl properties might be needed, too. See
-Documentation/devicetree/bindings/pinctrl/renesas,*.
-
-Example:
-
- hspi0: spi@fffc7000 {
- compatible = "renesas,hspi-r8a7778", "renesas,hspi";
- reg = <0xfffc7000 0x18>;
- interrupt-parent = <&gic>;
- interrupts = <0 63 IRQ_TYPE_LEVEL_HIGH>;
- #address-cells = <1>;
- #size-cells = <0>;
- };
-
--
2.11.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] dt-bindings: hspi: Convert bindings to json-schema
2019-09-13 12:21 [PATCH] dt-bindings: hspi: Convert bindings to json-schema Simon Horman
@ 2019-09-13 20:22 ` Rob Herring
2019-09-16 7:54 ` Simon Horman
0 siblings, 1 reply; 3+ messages in thread
From: Rob Herring @ 2019-09-13 20:22 UTC (permalink / raw)
To: Simon Horman
Cc: Mark Brown, Geert Uytterhoeven, Mark Rutland, Magnus Damm,
Yoshihiro Kaneko, linux-spi, devicetree,
open list:MEDIA DRIVERS FOR RENESAS - FCP
On Fri, Sep 13, 2019 at 7:22 AM Simon Horman <horms+renesas@verge.net.au> wrote:
>
> Convert Renesas HSPI bindings documentation to json-schema.
> Also name bindings documentation file according to the compat string
> being documented.
>
> As a side effect of this change all currently supported/used compat
> strings are listed while no while card compat string is documented.
> This, in my opinion, is desirable as only supported hardware should
> be documented.
>
> Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
> ---
> Based on v5.3-rc1
> Tested using:
> make dtbs_check DT_SCHEMA_FILES=Documentation/devicetree/bindings/spi/renesas,hspi.yaml
> ---
> .../devicetree/bindings/spi/renesas,hspi.yaml | 54 ++++++++++++++++++++++
> Documentation/devicetree/bindings/spi/sh-hspi.txt | 26 -----------
> 2 files changed, 54 insertions(+), 26 deletions(-)
> create mode 100644 Documentation/devicetree/bindings/spi/renesas,hspi.yaml
> delete mode 100644 Documentation/devicetree/bindings/spi/sh-hspi.txt
>
> diff --git a/Documentation/devicetree/bindings/spi/renesas,hspi.yaml b/Documentation/devicetree/bindings/spi/renesas,hspi.yaml
> new file mode 100644
> index 000000000000..94a64a33daf4
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/spi/renesas,hspi.yaml
> @@ -0,0 +1,54 @@
> +# SPDX-License-Identifier: GPL-2.0
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/spi/renesas,hspi.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Renesas HSPI
> +
> +maintainers:
> + - Geert Uytterhoeven <geert+renesas@glider.be>
Add:
allOf:
- $ref: spi-controller.yaml#
> +
> +properties:
> + compatible:
> + items:
> + - enum:
> + - renesas,hspi-r8a7778 # R-Car M1A
> + - renesas,hspi-r8a7779 # R-Car H1
> + - const: renesas,hspi
> +
> + reg:
> + maxItems: 1
> +
> + interrupts:
> + maxItems: 1
> +
> + '#address-cells':
> + const: 1
> +
> + '#size-cells':
> + const: 0
And then these 2 can be dropped.
> +
> + # Pinctrl properties might be needed, too.
> + # See Documentation/devicetree/bindings/pinctrl/renesas,*.
If only a single state, you don't. For multiple states, we need to
document the names.
If not present, then they get added automagically so that
'additionalProperties: false' works. But you can't use that here as
you'll have child nodes.
> +
> +required:
> + - compatible
> + - reg
> + - interrupts
> + - '#address-cells'
> + - '#size-cells'
> +
> +examples:
> + - |
> + #include <dt-bindings/interrupt-controller/irq.h>
> +
> + hspi0: spi@fffc7000 {
> + compatible = "renesas,hspi-r8a7778", "renesas,hspi";
> + reg = <0xfffc7000 0x18>;
> + interrupt-parent = <&gic>;
> + interrupts = <0 63 IRQ_TYPE_LEVEL_HIGH>;
> + #address-cells = <1>;
> + #size-cells = <0>;
> + };
> +
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] dt-bindings: hspi: Convert bindings to json-schema
2019-09-13 20:22 ` Rob Herring
@ 2019-09-16 7:54 ` Simon Horman
0 siblings, 0 replies; 3+ messages in thread
From: Simon Horman @ 2019-09-16 7:54 UTC (permalink / raw)
To: Rob Herring
Cc: Mark Brown, Geert Uytterhoeven, Mark Rutland, Magnus Damm,
Yoshihiro Kaneko, linux-spi, devicetree,
open list:MEDIA DRIVERS FOR RENESAS - FCP
On Fri, Sep 13, 2019 at 03:22:10PM -0500, Rob Herring wrote:
> On Fri, Sep 13, 2019 at 7:22 AM Simon Horman <horms+renesas@verge.net.au> wrote:
> >
> > Convert Renesas HSPI bindings documentation to json-schema.
> > Also name bindings documentation file according to the compat string
> > being documented.
> >
> > As a side effect of this change all currently supported/used compat
> > strings are listed while no while card compat string is documented.
> > This, in my opinion, is desirable as only supported hardware should
> > be documented.
> >
> > Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
Hi Rob,
thanks for your review. I have sent v2 which I believe addresses
the issues you have raised.
> > ---
> > Based on v5.3-rc1
> > Tested using:
> > make dtbs_check DT_SCHEMA_FILES=Documentation/devicetree/bindings/spi/renesas,hspi.yaml
> > ---
> > .../devicetree/bindings/spi/renesas,hspi.yaml | 54 ++++++++++++++++++++++
> > Documentation/devicetree/bindings/spi/sh-hspi.txt | 26 -----------
> > 2 files changed, 54 insertions(+), 26 deletions(-)
> > create mode 100644 Documentation/devicetree/bindings/spi/renesas,hspi.yaml
> > delete mode 100644 Documentation/devicetree/bindings/spi/sh-hspi.txt
> >
> > diff --git a/Documentation/devicetree/bindings/spi/renesas,hspi.yaml b/Documentation/devicetree/bindings/spi/renesas,hspi.yaml
> > new file mode 100644
> > index 000000000000..94a64a33daf4
> > --- /dev/null
> > +++ b/Documentation/devicetree/bindings/spi/renesas,hspi.yaml
> > @@ -0,0 +1,54 @@
> > +# SPDX-License-Identifier: GPL-2.0
> > +%YAML 1.2
> > +---
> > +$id: http://devicetree.org/schemas/spi/renesas,hspi.yaml#
> > +$schema: http://devicetree.org/meta-schemas/core.yaml#
> > +
> > +title: Renesas HSPI
> > +
> > +maintainers:
> > + - Geert Uytterhoeven <geert+renesas@glider.be>
>
> Add:
>
> allOf:
> - $ref: spi-controller.yaml#
>
> > +
> > +properties:
> > + compatible:
> > + items:
> > + - enum:
> > + - renesas,hspi-r8a7778 # R-Car M1A
> > + - renesas,hspi-r8a7779 # R-Car H1
> > + - const: renesas,hspi
> > +
> > + reg:
> > + maxItems: 1
> > +
> > + interrupts:
> > + maxItems: 1
> > +
>
> > + '#address-cells':
> > + const: 1
> > +
> > + '#size-cells':
> > + const: 0
>
> And then these 2 can be dropped.
>
> > +
> > + # Pinctrl properties might be needed, too.
> > + # See Documentation/devicetree/bindings/pinctrl/renesas,*.
>
> If only a single state, you don't. For multiple states, we need to
> document the names.
>
> If not present, then they get added automagically so that
> 'additionalProperties: false' works. But you can't use that here as
> you'll have child nodes.
>
> > +
> > +required:
> > + - compatible
> > + - reg
> > + - interrupts
> > + - '#address-cells'
> > + - '#size-cells'
> > +
> > +examples:
> > + - |
> > + #include <dt-bindings/interrupt-controller/irq.h>
> > +
> > + hspi0: spi@fffc7000 {
> > + compatible = "renesas,hspi-r8a7778", "renesas,hspi";
> > + reg = <0xfffc7000 0x18>;
> > + interrupt-parent = <&gic>;
> > + interrupts = <0 63 IRQ_TYPE_LEVEL_HIGH>;
> > + #address-cells = <1>;
> > + #size-cells = <0>;
> > + };
> > +
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2019-09-16 7:55 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-13 12:21 [PATCH] dt-bindings: hspi: Convert bindings to json-schema Simon Horman
2019-09-13 20:22 ` Rob Herring
2019-09-16 7:54 ` Simon Horman
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).