From: Rob Herring <robh@kernel.org>
To: Pratyush Yadav <p.yadav@ti.com>
Cc: Mark Brown <broonie@kernel.org>, Nishanth Menon <nm@ti.com>,
Michael Walle <michael@walle.cc>,
Miquel Raynal <miquel.raynal@bootlin.com>,
Richard Weinberger <richard@nod.at>,
Tudor Ambarus <tudor.ambarus@microchip.com>,
Vignesh Raghavendra <vigneshr@ti.com>,
devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-mtd@lists.infradead.org, linux-spi@vger.kernel.org
Subject: Re: [PATCH v3 1/3] spi: dt-bindings: add schema listing peripheral-specific properties
Date: Thu, 18 Nov 2021 16:23:20 -0600 [thread overview]
Message-ID: <YZbSWA5kSfORSzky@robh.at.kernel.org> (raw)
In-Reply-To: <20211109181911.2251-2-p.yadav@ti.com>
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>
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
WARNING: multiple messages have this Message-ID (diff)
From: Rob Herring <robh@kernel.org>
To: Pratyush Yadav <p.yadav@ti.com>
Cc: Mark Brown <broonie@kernel.org>, Nishanth Menon <nm@ti.com>,
Michael Walle <michael@walle.cc>,
Miquel Raynal <miquel.raynal@bootlin.com>,
Richard Weinberger <richard@nod.at>,
Tudor Ambarus <tudor.ambarus@microchip.com>,
Vignesh Raghavendra <vigneshr@ti.com>,
devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-mtd@lists.infradead.org, linux-spi@vger.kernel.org
Subject: Re: [PATCH v3 1/3] spi: dt-bindings: add schema listing peripheral-specific properties
Date: Thu, 18 Nov 2021 16:23:20 -0600 [thread overview]
Message-ID: <YZbSWA5kSfORSzky@robh.at.kernel.org> (raw)
In-Reply-To: <20211109181911.2251-2-p.yadav@ti.com>
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>
next prev parent reply other threads:[~2021-11-18 22:24 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
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-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 [this message]
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-09 18:19 ` [PATCH v3 2/3] spi: dt-bindings: cdns,qspi-nor: " Pratyush Yadav
2021-11-18 22:23 ` Rob Herring
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-09 18:19 ` Pratyush Yadav
2021-11-18 22:23 ` Rob Herring
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:09 ` Pratyush Yadav
2021-11-29 18:15 ` Mark Brown
2021-11-29 18:15 ` Mark Brown
2021-11-30 9:36 ` Pratyush Yadav
2021-11-30 9:36 ` Pratyush Yadav
2021-12-01 18:32 ` Mark Brown
2021-12-01 18:32 ` Mark Brown
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=YZbSWA5kSfORSzky@robh.at.kernel.org \
--to=robh@kernel.org \
--cc=broonie@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mtd@lists.infradead.org \
--cc=linux-spi@vger.kernel.org \
--cc=michael@walle.cc \
--cc=miquel.raynal@bootlin.com \
--cc=nm@ti.com \
--cc=p.yadav@ti.com \
--cc=richard@nod.at \
--cc=tudor.ambarus@microchip.com \
--cc=vigneshr@ti.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.