linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3 0/3] Add bindings for peripheral-specific SPI controller properties
@ 2021-11-09 18:19 Pratyush Yadav
  2021-11-09 18:19 ` [PATCH v3 1/3] spi: dt-bindings: add schema listing peripheral-specific properties Pratyush Yadav
                   ` (4 more replies)
  0 siblings, 5 replies; 11+ messages in thread
From: Pratyush Yadav @ 2021-11-09 18:19 UTC (permalink / raw)
  To: Rob Herring
  Cc: Mark Brown, Nishanth Menon, Michael Walle, Miquel Raynal,
	Pratyush Yadav, Richard Weinberger, Tudor Ambarus,
	Vignesh Raghavendra, devicetree, linux-kernel, linux-mtd,
	linux-spi

Hi,

This series adds bindings for peripheral-specific SPI controller properties.
See patch 1 for more info on the motivations behind this.

This is the best approach that I came up with with my limited knowledge
of JSON schema. It has some limitations that are mentioned in patch 1. I
don't know of any better ways to model this. Suggestions are welcome!

Changes in v3:
- s/slave/peripheral/g
- Drop the | on description.
- Drop the compatible property.

Changes in v2:
- Move other subnode properties listed in spi-controller.yaml to
  spi-slave-props.yaml
- Move the Cadence controller-specific properties out of
  spi-slave-props.yaml. They will be added in a separate file.
- Add a reference to spi-slave-props.yaml in spi-controller.yaml.
- Update description.

Pratyush Yadav (3):
  spi: dt-bindings: add schema listing peripheral-specific properties
  spi: dt-bindings: cdns,qspi-nor: Move peripheral-specific properties
    out
  dt-bindings: mtd: spi-nor: Add a reference to
    spi-peripheral-props.yaml

 .../bindings/mtd/jedec,spi-nor.yaml           |  3 +-
 .../spi/cdns,qspi-nor-peripheral-props.yaml   | 42 +++++++++
 .../bindings/spi/cdns,qspi-nor.yaml           | 33 -------
 .../bindings/spi/spi-controller.yaml          | 69 +-------------
 .../bindings/spi/spi-peripheral-props.yaml    | 89 +++++++++++++++++++
 5 files changed, 135 insertions(+), 101 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/spi/cdns,qspi-nor-peripheral-props.yaml
 create mode 100644 Documentation/devicetree/bindings/spi/spi-peripheral-props.yaml

--
2.33.1.835.ge9e5ba39a7


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

* [PATCH v3 1/3] spi: dt-bindings: add schema listing peripheral-specific properties
  2021-11-09 18:19 [PATCH v3 0/3] Add bindings for peripheral-specific SPI controller properties Pratyush Yadav
@ 2021-11-09 18:19 ` Pratyush Yadav
  2021-11-18 22:23   ` Rob Herring
  2021-11-09 18:19 ` [PATCH v3 2/3] spi: dt-bindings: cdns,qspi-nor: Move peripheral-specific properties out Pratyush Yadav
                   ` (3 subsequent siblings)
  4 siblings, 1 reply; 11+ messages in thread
From: Pratyush Yadav @ 2021-11-09 18:19 UTC (permalink / raw)
  To: Rob Herring
  Cc: Pratyush Yadav, Mark Brown, Nishanth Menon, Michael Walle,
	Miquel Raynal, Richard Weinberger, Tudor Ambarus,
	Vignesh Raghavendra, devicetree, linux-kernel, linux-mtd,
	linux-spi

Many SPI controllers need to add properties to peripheral devices. This
could be the delay in clock or data lines, etc. These properties are
controller specific but need to be defined in the peripheral node
because they are per-peripheral and there can be multiple peripherals
attached to a controller.

If these properties are not added to the peripheral binding, then the
dtbs check emits a warning. But these properties do not make much sense
in the peripheral binding because they are controller-specific and they
will just pollute every peripheral binding. So this binding is added to
collect all such properties from all such controllers. Peripheral
bindings should simply refer to this binding and they should be rid of
the warnings.

There are some limitations with this approach. Firstly, there is no way
to specify required properties. The schema contains properties for all
controllers and there is no way to know which controller is being used.
Secondly, there is no way to restrict additional properties. Since this
schema will be used with an allOf operator, additionalProperties needs
to be true. In addition, the peripheral schema will have to set
unevaluatedProperties: false.

Despite these limitations, this appears to be the best solution to this
problem that doesn't involve modifying existing tools or schema specs.

Signed-off-by: Pratyush Yadav <p.yadav@ti.com>

---

Changes in v3:
- s/slave/peripheral/g
- Drop the | on description.
- Drop the compatible property.

Changes in v2:
- Move other subnode properties listed in spi-controller.yaml to
  spi-slave-props.yaml
- Move the Cadence controller-specific properties out of
  spi-slave-props.yaml. They will be added in a separate file.
- Add a reference to spi-slave-props.yaml in spi-controller.yaml.
- Update description.

 .../bindings/spi/spi-controller.yaml          | 69 +--------------
 .../bindings/spi/spi-peripheral-props.yaml    | 87 +++++++++++++++++++
 2 files changed, 89 insertions(+), 67 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/spi/spi-peripheral-props.yaml

diff --git a/Documentation/devicetree/bindings/spi/spi-controller.yaml b/Documentation/devicetree/bindings/spi/spi-controller.yaml
index 8246891602e7..36b72518f565 100644
--- a/Documentation/devicetree/bindings/spi/spi-controller.yaml
+++ b/Documentation/devicetree/bindings/spi/spi-controller.yaml
@@ -94,73 +94,8 @@ patternProperties:
   "^.*@[0-9a-f]+$":
     type: object
 
-    properties:
-      compatible:
-        description:
-          Compatible of the SPI device.
-
-      reg:
-        minItems: 1
-        maxItems: 256
-        items:
-          minimum: 0
-          maximum: 256
-        description:
-          Chip select used by the device.
-
-      spi-3wire:
-        $ref: /schemas/types.yaml#/definitions/flag
-        description:
-          The device requires 3-wire mode.
-
-      spi-cpha:
-        $ref: /schemas/types.yaml#/definitions/flag
-        description:
-          The device requires shifted clock phase (CPHA) mode.
-
-      spi-cpol:
-        $ref: /schemas/types.yaml#/definitions/flag
-        description:
-          The device requires inverse clock polarity (CPOL) mode.
-
-      spi-cs-high:
-        $ref: /schemas/types.yaml#/definitions/flag
-        description:
-          The device requires the chip select active high.
-
-      spi-lsb-first:
-        $ref: /schemas/types.yaml#/definitions/flag
-        description:
-          The device requires the LSB first mode.
-
-      spi-max-frequency:
-        $ref: /schemas/types.yaml#/definitions/uint32
-        description:
-          Maximum SPI clocking speed of the device in Hz.
-
-      spi-rx-bus-width:
-        description:
-          Bus width to the SPI bus used for read transfers.
-          If 0 is provided, then no RX will be possible on this device.
-        $ref: /schemas/types.yaml#/definitions/uint32
-        enum: [0, 1, 2, 4, 8]
-        default: 1
-
-      spi-rx-delay-us:
-        description:
-          Delay, in microseconds, after a read transfer.
-
-      spi-tx-bus-width:
-        description:
-          Bus width to the SPI bus used for write transfers.
-          If 0 is provided, then no TX will be possible on this device.
-        $ref: /schemas/types.yaml#/definitions/uint32
-        enum: [0, 1, 2, 4, 8]
-        default: 1
-
-      spi-tx-delay-us:
-        description:
-          Delay, in microseconds, after a write transfer.
+    allOf:
+      - $ref: spi-peripheral-props.yaml
 
     required:
       - compatible
diff --git a/Documentation/devicetree/bindings/spi/spi-peripheral-props.yaml b/Documentation/devicetree/bindings/spi/spi-peripheral-props.yaml
new file mode 100644
index 000000000000..105fa2840e72
--- /dev/null
+++ b/Documentation/devicetree/bindings/spi/spi-peripheral-props.yaml
@@ -0,0 +1,87 @@
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/spi/spi-peripheral-props.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Peripheral-specific properties for a SPI bus.
+
+description:
+  Many SPI controllers need to add properties to peripheral devices. They could
+  be common properties like spi-max-frequency, spi-cpha, etc. or they could be
+  controller specific like delay in clock or data lines, etc. These properties
+  need to be defined in the peripheral node because they are per-peripheral and
+  there can be multiple peripherals attached to a controller. All those
+  properties are listed here. The controller specific properties should go in
+  their own separate schema that should be referenced from here.
+
+maintainers:
+  - Pratyush Yadav <p.yadav@ti.com>
+
+properties:
+  reg:
+    minItems: 1
+    maxItems: 256
+    items:
+      minimum: 0
+      maximum: 256
+    description:
+      Chip select used by the device.
+
+  spi-3wire:
+    $ref: /schemas/types.yaml#/definitions/flag
+    description:
+      The device requires 3-wire mode.
+
+  spi-cpha:
+    $ref: /schemas/types.yaml#/definitions/flag
+    description:
+      The device requires shifted clock phase (CPHA) mode.
+
+  spi-cpol:
+    $ref: /schemas/types.yaml#/definitions/flag
+    description:
+      The device requires inverse clock polarity (CPOL) mode.
+
+  spi-cs-high:
+    $ref: /schemas/types.yaml#/definitions/flag
+    description:
+      The device requires the chip select active high.
+
+  spi-lsb-first:
+    $ref: /schemas/types.yaml#/definitions/flag
+    description:
+      The device requires the LSB first mode.
+
+  spi-max-frequency:
+    $ref: /schemas/types.yaml#/definitions/uint32
+    description:
+      Maximum SPI clocking speed of the device in Hz.
+
+  spi-rx-bus-width:
+    description:
+      Bus width to the SPI bus used for read transfers.
+      If 0 is provided, then no RX will be possible on this device.
+    $ref: /schemas/types.yaml#/definitions/uint32
+    enum: [0, 1, 2, 4, 8]
+    default: 1
+
+  spi-rx-delay-us:
+    description:
+      Delay, in microseconds, after a read transfer.
+
+  spi-tx-bus-width:
+    description:
+      Bus width to the SPI bus used for write transfers.
+      If 0 is provided, then no TX will be possible on this device.
+    $ref: /schemas/types.yaml#/definitions/uint32
+    enum: [0, 1, 2, 4, 8]
+    default: 1
+
+  spi-tx-delay-us:
+    description:
+      Delay, in microseconds, after a write transfer.
+
+# The controller specific properties go here.
+
+additionalProperties: true
-- 
2.33.1.835.ge9e5ba39a7


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

* [PATCH v3 2/3] spi: dt-bindings: cdns,qspi-nor: Move peripheral-specific properties out
  2021-11-09 18:19 [PATCH v3 0/3] Add bindings for peripheral-specific SPI controller properties Pratyush Yadav
  2021-11-09 18:19 ` [PATCH v3 1/3] spi: dt-bindings: add schema listing peripheral-specific properties Pratyush Yadav
@ 2021-11-09 18:19 ` Pratyush Yadav
  2021-11-18 22:23   ` Rob Herring
  2021-11-09 18:19 ` [PATCH v3 3/3] dt-bindings: mtd: spi-nor: Add a reference to spi-peripheral-props.yaml Pratyush Yadav
                   ` (2 subsequent siblings)
  4 siblings, 1 reply; 11+ messages in thread
From: Pratyush Yadav @ 2021-11-09 18:19 UTC (permalink / raw)
  To: Rob Herring
  Cc: Pratyush Yadav, Mark Brown, Nishanth Menon, Michael Walle,
	Miquel Raynal, Richard Weinberger, Tudor Ambarus,
	Vignesh Raghavendra, devicetree, linux-kernel, linux-mtd,
	linux-spi

The spi-peripheral-props.yaml schema contains peripheral-specific
properties for SPI controllers that should be present in the peripheral
node. Move peripheral-specific properties to a separate file and refer
to it in spi-peripheral-props.yaml.

Signed-off-by: Pratyush Yadav <p.yadav@ti.com>

---

Changes in v3:
- s/slave/peripheral/g

Changes in v2:
- New in v2.

 .../spi/cdns,qspi-nor-peripheral-props.yaml   | 42 +++++++++++++++++++
 .../bindings/spi/cdns,qspi-nor.yaml           | 33 ---------------
 .../bindings/spi/spi-peripheral-props.yaml    |  2 +
 3 files changed, 44 insertions(+), 33 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/spi/cdns,qspi-nor-peripheral-props.yaml

diff --git a/Documentation/devicetree/bindings/spi/cdns,qspi-nor-peripheral-props.yaml b/Documentation/devicetree/bindings/spi/cdns,qspi-nor-peripheral-props.yaml
new file mode 100644
index 000000000000..553601a441a7
--- /dev/null
+++ b/Documentation/devicetree/bindings/spi/cdns,qspi-nor-peripheral-props.yaml
@@ -0,0 +1,42 @@
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/spi/cdns,qspi-nor-peripheral-props.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Peripheral-specific properties for the Cadence QSPI controller.
+
+description:
+  See spi-peripheral-props.yaml for more info.
+
+maintainers:
+  - Pratyush Yadav <p.yadav@ti.com>
+
+properties:
+  # cdns,qspi-nor.yaml
+  cdns,read-delay:
+    $ref: /schemas/types.yaml#/definitions/uint32
+    description:
+      Delay for read capture logic, in clock cycles.
+
+  cdns,tshsl-ns:
+    description:
+      Delay in nanoseconds for the length that the master mode chip select
+      outputs are de-asserted between transactions.
+
+  cdns,tsd2d-ns:
+    description:
+      Delay in nanoseconds between one chip select being de-activated
+      and the activation of another.
+
+  cdns,tchsh-ns:
+    description:
+      Delay in nanoseconds between last bit of current transaction and
+      deasserting the device chip select (qspi_n_ss_out).
+
+  cdns,tslch-ns:
+    description:
+      Delay in nanoseconds between setting qspi_n_ss_out low and
+      first bit transfer.
+
+additionalProperties: true
diff --git a/Documentation/devicetree/bindings/spi/cdns,qspi-nor.yaml b/Documentation/devicetree/bindings/spi/cdns,qspi-nor.yaml
index ca155abbda7a..a439e3ed753f 100644
--- a/Documentation/devicetree/bindings/spi/cdns,qspi-nor.yaml
+++ b/Documentation/devicetree/bindings/spi/cdns,qspi-nor.yaml
@@ -86,39 +86,6 @@ properties:
     items:
       enum: [ qspi, qspi-ocp ]
 
-# subnode's properties
-patternProperties:
-  "@[0-9a-f]+$":
-    type: object
-    description:
-      Flash device uses the below defined properties in the subnode.
-
-    properties:
-      cdns,read-delay:
-        $ref: /schemas/types.yaml#/definitions/uint32
-        description:
-          Delay for read capture logic, in clock cycles.
-
-      cdns,tshsl-ns:
-        description:
-          Delay in nanoseconds for the length that the master mode chip select
-          outputs are de-asserted between transactions.
-
-      cdns,tsd2d-ns:
-        description:
-          Delay in nanoseconds between one chip select being de-activated
-          and the activation of another.
-
-      cdns,tchsh-ns:
-        description:
-          Delay in nanoseconds between last bit of current transaction and
-          deasserting the device chip select (qspi_n_ss_out).
-
-      cdns,tslch-ns:
-        description:
-          Delay in nanoseconds between setting qspi_n_ss_out low and
-          first bit transfer.
-
 required:
   - compatible
   - reg
diff --git a/Documentation/devicetree/bindings/spi/spi-peripheral-props.yaml b/Documentation/devicetree/bindings/spi/spi-peripheral-props.yaml
index 105fa2840e72..5dd209206e88 100644
--- a/Documentation/devicetree/bindings/spi/spi-peripheral-props.yaml
+++ b/Documentation/devicetree/bindings/spi/spi-peripheral-props.yaml
@@ -83,5 +83,7 @@ properties:
       Delay, in microseconds, after a write transfer.
 
 # The controller specific properties go here.
+allOf:
+  - $ref: cdns,qspi-nor-peripheral-props.yaml#
 
 additionalProperties: true
-- 
2.33.1.835.ge9e5ba39a7


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

* [PATCH v3 3/3] dt-bindings: mtd: spi-nor: Add a reference to spi-peripheral-props.yaml
  2021-11-09 18:19 [PATCH v3 0/3] Add bindings for peripheral-specific SPI controller properties Pratyush Yadav
  2021-11-09 18:19 ` [PATCH v3 1/3] spi: dt-bindings: add schema listing peripheral-specific properties Pratyush Yadav
  2021-11-09 18:19 ` [PATCH v3 2/3] spi: dt-bindings: cdns,qspi-nor: Move peripheral-specific properties out Pratyush Yadav
@ 2021-11-09 18:19 ` Pratyush Yadav
  2021-11-18 22:23   ` Rob Herring
  2021-11-29 18:09 ` [PATCH v3 0/3] Add bindings for peripheral-specific SPI controller properties Pratyush Yadav
  2021-12-01 18:32 ` Mark Brown
  4 siblings, 1 reply; 11+ messages in thread
From: Pratyush Yadav @ 2021-11-09 18:19 UTC (permalink / raw)
  To: Rob Herring
  Cc: Pratyush Yadav, Mark Brown, Nishanth Menon, Michael Walle,
	Miquel Raynal, Richard Weinberger, Tudor Ambarus,
	Vignesh Raghavendra, devicetree, linux-kernel, linux-mtd,
	linux-spi

The spi-peripheral-props.yaml schema contains peripheral-specific
properties for SPI controllers that should be present in the peripheral
node. Add a reference to that so its constraints are followed.

additionalProperties: false cannot be used since it marks the controller
properties as unknown. Use unevaluatedProperties: false instead. This
has the side effect of allowing extra properties that are not specified
in the schema. The alternative is to list all the controller properties
in this schema but that would mean every peripheral binding would have
to repeat the same set of properties for each controller.

Signed-off-by: Pratyush Yadav <p.yadav@ti.com>

---

Changes in v3:
- s/slave/peripheral/g

 Documentation/devicetree/bindings/mtd/jedec,spi-nor.yaml | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/Documentation/devicetree/bindings/mtd/jedec,spi-nor.yaml b/Documentation/devicetree/bindings/mtd/jedec,spi-nor.yaml
index ed590d7c6e37..39421f7233e4 100644
--- a/Documentation/devicetree/bindings/mtd/jedec,spi-nor.yaml
+++ b/Documentation/devicetree/bindings/mtd/jedec,spi-nor.yaml
@@ -11,6 +11,7 @@ maintainers:
 
 allOf:
   - $ref: "mtd.yaml#"
+  - $ref: /schemas/spi/spi-peripheral-props.yaml#
 
 properties:
   compatible:
@@ -88,7 +89,7 @@ patternProperties:
   "^otp(-[0-9]+)?$":
     type: object
 
-additionalProperties: false
+unevaluatedProperties: false
 
 examples:
   - |
-- 
2.33.1.835.ge9e5ba39a7


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

* Re: [PATCH v3 1/3] spi: dt-bindings: add schema listing peripheral-specific properties
  2021-11-09 18:19 ` [PATCH v3 1/3] spi: dt-bindings: add schema listing peripheral-specific properties Pratyush Yadav
@ 2021-11-18 22:23   ` Rob Herring
  0 siblings, 0 replies; 11+ messages in thread
From: Rob Herring @ 2021-11-18 22:23 UTC (permalink / raw)
  To: Pratyush Yadav
  Cc: Mark Brown, Nishanth Menon, Michael Walle, Miquel Raynal,
	Richard Weinberger, Tudor Ambarus, Vignesh Raghavendra,
	devicetree, linux-kernel, linux-mtd, linux-spi

On Tue, Nov 09, 2021 at 11:49:09PM +0530, Pratyush Yadav wrote:
> Many SPI controllers need to add properties to peripheral devices. This
> could be the delay in clock or data lines, etc. These properties are
> controller specific but need to be defined in the peripheral node
> because they are per-peripheral and there can be multiple peripherals
> attached to a controller.
> 
> If these properties are not added to the peripheral binding, then the
> dtbs check emits a warning. But these properties do not make much sense
> in the peripheral binding because they are controller-specific and they
> will just pollute every peripheral binding. So this binding is added to
> collect all such properties from all such controllers. Peripheral
> bindings should simply refer to this binding and they should be rid of
> the warnings.
> 
> There are some limitations with this approach. Firstly, there is no way
> to specify required properties. The schema contains properties for all
> controllers and there is no way to know which controller is being used.
> Secondly, there is no way to restrict additional properties. Since this
> schema will be used with an allOf operator, additionalProperties needs
> to be true. In addition, the peripheral schema will have to set
> unevaluatedProperties: false.
> 
> Despite these limitations, this appears to be the best solution to this
> problem that doesn't involve modifying existing tools or schema specs.
> 
> Signed-off-by: Pratyush Yadav <p.yadav@ti.com>
> 
> ---
> 
> Changes in v3:
> - s/slave/peripheral/g
> - Drop the | on description.
> - Drop the compatible property.
> 
> Changes in v2:
> - Move other subnode properties listed in spi-controller.yaml to
>   spi-slave-props.yaml
> - Move the Cadence controller-specific properties out of
>   spi-slave-props.yaml. They will be added in a separate file.
> - Add a reference to spi-slave-props.yaml in spi-controller.yaml.
> - Update description.
> 
>  .../bindings/spi/spi-controller.yaml          | 69 +--------------
>  .../bindings/spi/spi-peripheral-props.yaml    | 87 +++++++++++++++++++
>  2 files changed, 89 insertions(+), 67 deletions(-)
>  create mode 100644 Documentation/devicetree/bindings/spi/spi-peripheral-props.yaml

Reviewed-by: Rob Herring <robh@kernel.org>

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

* Re: [PATCH v3 2/3] spi: dt-bindings: cdns,qspi-nor: Move peripheral-specific properties out
  2021-11-09 18:19 ` [PATCH v3 2/3] spi: dt-bindings: cdns,qspi-nor: Move peripheral-specific properties out Pratyush Yadav
@ 2021-11-18 22:23   ` Rob Herring
  0 siblings, 0 replies; 11+ messages in thread
From: Rob Herring @ 2021-11-18 22:23 UTC (permalink / raw)
  To: Pratyush Yadav
  Cc: Mark Brown, Nishanth Menon, Michael Walle, Miquel Raynal,
	Richard Weinberger, Tudor Ambarus, Vignesh Raghavendra,
	devicetree, linux-kernel, linux-mtd, linux-spi

On Tue, Nov 09, 2021 at 11:49:10PM +0530, Pratyush Yadav wrote:
> The spi-peripheral-props.yaml schema contains peripheral-specific
> properties for SPI controllers that should be present in the peripheral
> node. Move peripheral-specific properties to a separate file and refer
> to it in spi-peripheral-props.yaml.
> 
> Signed-off-by: Pratyush Yadav <p.yadav@ti.com>
> 
> ---
> 
> Changes in v3:
> - s/slave/peripheral/g
> 
> Changes in v2:
> - New in v2.
> 
>  .../spi/cdns,qspi-nor-peripheral-props.yaml   | 42 +++++++++++++++++++
>  .../bindings/spi/cdns,qspi-nor.yaml           | 33 ---------------
>  .../bindings/spi/spi-peripheral-props.yaml    |  2 +
>  3 files changed, 44 insertions(+), 33 deletions(-)
>  create mode 100644 Documentation/devicetree/bindings/spi/cdns,qspi-nor-peripheral-props.yaml

Reviewed-by: Rob Herring <robh@kernel.org>

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

* Re: [PATCH v3 3/3] dt-bindings: mtd: spi-nor: Add a reference to spi-peripheral-props.yaml
  2021-11-09 18:19 ` [PATCH v3 3/3] dt-bindings: mtd: spi-nor: Add a reference to spi-peripheral-props.yaml Pratyush Yadav
@ 2021-11-18 22:23   ` Rob Herring
  0 siblings, 0 replies; 11+ messages in thread
From: Rob Herring @ 2021-11-18 22:23 UTC (permalink / raw)
  To: Pratyush Yadav
  Cc: Mark Brown, Nishanth Menon, Michael Walle, Miquel Raynal,
	Richard Weinberger, Tudor Ambarus, Vignesh Raghavendra,
	devicetree, linux-kernel, linux-mtd, linux-spi

On Tue, Nov 09, 2021 at 11:49:11PM +0530, Pratyush Yadav wrote:
> The spi-peripheral-props.yaml schema contains peripheral-specific
> properties for SPI controllers that should be present in the peripheral
> node. Add a reference to that so its constraints are followed.
> 
> additionalProperties: false cannot be used since it marks the controller
> properties as unknown. Use unevaluatedProperties: false instead. This
> has the side effect of allowing extra properties that are not specified
> in the schema. The alternative is to list all the controller properties
> in this schema but that would mean every peripheral binding would have
> to repeat the same set of properties for each controller.
> 
> Signed-off-by: Pratyush Yadav <p.yadav@ti.com>
> 
> ---
> 
> Changes in v3:
> - s/slave/peripheral/g
> 
>  Documentation/devicetree/bindings/mtd/jedec,spi-nor.yaml | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)

Reviewed-by: Rob Herring <robh@kernel.org>

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

* Re: [PATCH v3 0/3] Add bindings for peripheral-specific SPI controller properties
  2021-11-09 18:19 [PATCH v3 0/3] Add bindings for peripheral-specific SPI controller properties Pratyush Yadav
                   ` (2 preceding siblings ...)
  2021-11-09 18:19 ` [PATCH v3 3/3] dt-bindings: mtd: spi-nor: Add a reference to spi-peripheral-props.yaml Pratyush Yadav
@ 2021-11-29 18:09 ` Pratyush Yadav
  2021-11-29 18:15   ` Mark Brown
  2021-12-01 18:32 ` Mark Brown
  4 siblings, 1 reply; 11+ messages in thread
From: Pratyush Yadav @ 2021-11-29 18:09 UTC (permalink / raw)
  To: Rob Herring
  Cc: Mark Brown, Nishanth Menon, Michael Walle, Miquel Raynal,
	Richard Weinberger, Tudor Ambarus, Vignesh Raghavendra,
	devicetree, linux-kernel, linux-mtd, linux-spi

Hi Rob,

On 09/11/21 11:49PM, Pratyush Yadav wrote:
> Hi,
> 
> This series adds bindings for peripheral-specific SPI controller properties.
> See patch 1 for more info on the motivations behind this.
> 
> This is the best approach that I came up with with my limited knowledge
> of JSON schema. It has some limitations that are mentioned in patch 1. I
> don't know of any better ways to model this. Suggestions are welcome!

Do you plan to take this series through your tree or should I poke Mark 
about it?

> 
> Changes in v3:
> - s/slave/peripheral/g
> - Drop the | on description.
> - Drop the compatible property.
> 
> Changes in v2:
> - Move other subnode properties listed in spi-controller.yaml to
>   spi-slave-props.yaml
> - Move the Cadence controller-specific properties out of
>   spi-slave-props.yaml. They will be added in a separate file.
> - Add a reference to spi-slave-props.yaml in spi-controller.yaml.
> - Update description.
> 
> Pratyush Yadav (3):
>   spi: dt-bindings: add schema listing peripheral-specific properties
>   spi: dt-bindings: cdns,qspi-nor: Move peripheral-specific properties
>     out
>   dt-bindings: mtd: spi-nor: Add a reference to
>     spi-peripheral-props.yaml
> 
>  .../bindings/mtd/jedec,spi-nor.yaml           |  3 +-
>  .../spi/cdns,qspi-nor-peripheral-props.yaml   | 42 +++++++++
>  .../bindings/spi/cdns,qspi-nor.yaml           | 33 -------
>  .../bindings/spi/spi-controller.yaml          | 69 +-------------
>  .../bindings/spi/spi-peripheral-props.yaml    | 89 +++++++++++++++++++
>  5 files changed, 135 insertions(+), 101 deletions(-)
>  create mode 100644 Documentation/devicetree/bindings/spi/cdns,qspi-nor-peripheral-props.yaml
>  create mode 100644 Documentation/devicetree/bindings/spi/spi-peripheral-props.yaml
> 
> --
> 2.33.1.835.ge9e5ba39a7
> 

-- 
Regards,
Pratyush Yadav
Texas Instruments Inc.

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

* Re: [PATCH v3 0/3] Add bindings for peripheral-specific SPI controller properties
  2021-11-29 18:09 ` [PATCH v3 0/3] Add bindings for peripheral-specific SPI controller properties Pratyush Yadav
@ 2021-11-29 18:15   ` Mark Brown
  2021-11-30  9:36     ` Pratyush Yadav
  0 siblings, 1 reply; 11+ messages in thread
From: Mark Brown @ 2021-11-29 18:15 UTC (permalink / raw)
  To: Pratyush Yadav
  Cc: Rob Herring, Nishanth Menon, Michael Walle, Miquel Raynal,
	Richard Weinberger, Tudor Ambarus, Vignesh Raghavendra,
	devicetree, linux-kernel, linux-mtd, linux-spi

[-- Attachment #1: Type: text/plain, Size: 526 bytes --]

On Mon, Nov 29, 2021 at 11:39:35PM +0530, Pratyush Yadav wrote:
> On 09/11/21 11:49PM, Pratyush Yadav wrote:

> > This is the best approach that I came up with with my limited knowledge
> > of JSON schema. It has some limitations that are mentioned in patch 1. I
> > don't know of any better ways to model this. Suggestions are welcome!

> Do you plan to take this series through your tree or should I poke Mark 
> about it?

I'd expect to take it through my tree but please allow a reasonable time
for reviews...

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

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

* Re: [PATCH v3 0/3] Add bindings for peripheral-specific SPI controller properties
  2021-11-29 18:15   ` Mark Brown
@ 2021-11-30  9:36     ` Pratyush Yadav
  0 siblings, 0 replies; 11+ messages in thread
From: Pratyush Yadav @ 2021-11-30  9:36 UTC (permalink / raw)
  To: Mark Brown
  Cc: Rob Herring, Nishanth Menon, Michael Walle, Miquel Raynal,
	Richard Weinberger, Tudor Ambarus, Vignesh Raghavendra,
	devicetree, linux-kernel, linux-mtd, linux-spi

On 29/11/21 06:15PM, Mark Brown wrote:
> On Mon, Nov 29, 2021 at 11:39:35PM +0530, Pratyush Yadav wrote:
> > On 09/11/21 11:49PM, Pratyush Yadav wrote:
> 
> > > This is the best approach that I came up with with my limited knowledge
> > > of JSON schema. It has some limitations that are mentioned in patch 1. I
> > > don't know of any better ways to model this. Suggestions are welcome!
> 
> > Do you plan to take this series through your tree or should I poke Mark 
> > about it?
> 
> I'd expect to take it through my tree but please allow a reasonable time
> for reviews...

Sure, thanks. I just wanted to make sure this series didn't fall through 
the cracks if there was some confusion on who is supposed to pick it up.

-- 
Regards,
Pratyush Yadav
Texas Instruments Inc.

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

* Re: [PATCH v3 0/3] Add bindings for peripheral-specific SPI controller properties
  2021-11-09 18:19 [PATCH v3 0/3] Add bindings for peripheral-specific SPI controller properties Pratyush Yadav
                   ` (3 preceding siblings ...)
  2021-11-29 18:09 ` [PATCH v3 0/3] Add bindings for peripheral-specific SPI controller properties Pratyush Yadav
@ 2021-12-01 18:32 ` Mark Brown
  4 siblings, 0 replies; 11+ messages in thread
From: Mark Brown @ 2021-12-01 18:32 UTC (permalink / raw)
  To: Rob Herring, Pratyush Yadav
  Cc: Richard Weinberger, linux-mtd, Vignesh Raghavendra, linux-kernel,
	Tudor Ambarus, Nishanth Menon, Miquel Raynal, Michael Walle,
	devicetree, linux-spi

On Tue, 9 Nov 2021 23:49:08 +0530, Pratyush Yadav wrote:
> This series adds bindings for peripheral-specific SPI controller properties.
> See patch 1 for more info on the motivations behind this.
> 
> This is the best approach that I came up with with my limited knowledge
> of JSON schema. It has some limitations that are mentioned in patch 1. I
> don't know of any better ways to model this. Suggestions are welcome!
> 
> [...]

Applied to

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git for-next

Thanks!

[1/3] spi: dt-bindings: add schema listing peripheral-specific properties
      commit: 8762b07c95c18fbbe1c6b3eb1e8e686091c346b5
[2/3] spi: dt-bindings: cdns,qspi-nor: Move peripheral-specific properties out
      commit: b6bdc6e043906c70e949b2747772e6aa1d36f2a3
[3/3] dt-bindings: mtd: spi-nor: Add a reference to spi-peripheral-props.yaml
      commit: e9d7c323cfbbd07c365a419b4ce3dc2f161442c7

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark

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

end of thread, other threads:[~2021-12-01 18:35 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-09 18:19 [PATCH v3 0/3] Add bindings for peripheral-specific SPI controller properties Pratyush Yadav
2021-11-09 18:19 ` [PATCH v3 1/3] spi: dt-bindings: add schema listing peripheral-specific properties Pratyush Yadav
2021-11-18 22:23   ` Rob Herring
2021-11-09 18:19 ` [PATCH v3 2/3] spi: dt-bindings: cdns,qspi-nor: Move peripheral-specific properties out Pratyush Yadav
2021-11-18 22:23   ` Rob Herring
2021-11-09 18:19 ` [PATCH v3 3/3] dt-bindings: mtd: spi-nor: Add a reference to spi-peripheral-props.yaml Pratyush Yadav
2021-11-18 22:23   ` Rob Herring
2021-11-29 18:09 ` [PATCH v3 0/3] Add bindings for peripheral-specific SPI controller properties Pratyush Yadav
2021-11-29 18:15   ` Mark Brown
2021-11-30  9:36     ` Pratyush Yadav
2021-12-01 18:32 ` Mark Brown

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).