diff mbox series

[1/2] dt-bindings: nfc: use spi-peripheral-props.yaml

Message ID 20220727164130.385411-1-krzysztof.kozlowski@linaro.org
State New
Headers show
Series [1/2] dt-bindings: nfc: use spi-peripheral-props.yaml | expand

Commit Message

Krzysztof Kozlowski July 27, 2022, 4:41 p.m. UTC
Instead of listing directly properties typical for SPI peripherals,
reference the spi-peripheral-props.yaml schema.  This allows using all
properties typical for SPI-connected devices, even these which device
bindings author did not tried yet.

Remove the spi-* properties which now come via spi-peripheral-props.yaml
schema, except for the cases when device schema adds some constraints
like maximum frequency.

While changing additionalProperties->unevaluatedProperties, put it in
typical place, just before example DTS.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>

---

Technically, this depends on [1] merged to SPI tree, if we want to
preserve existing behavior of not allowing SPI CPHA and CPOL in each of
schemas in this patch.

If this patch comes independently via different tree, the SPI CPHA and
CPOL will be allowed for brief period of time, before [1] is merged.
This will not have negative impact, just DT schema checks will be
loosened for that period.

[1] https://lore.kernel.org/all/20220722191539.90641-2-krzysztof.kozlowski@linaro.org/
---
 Documentation/devicetree/bindings/net/nfc/marvell,nci.yaml | 4 ++--
 Documentation/devicetree/bindings/net/nfc/st,st-nci.yaml   | 5 ++---
 Documentation/devicetree/bindings/net/nfc/st,st95hf.yaml   | 7 ++++---
 Documentation/devicetree/bindings/net/nfc/ti,trf7970a.yaml | 7 ++++---
 4 files changed, 12 insertions(+), 11 deletions(-)

Comments

Rob Herring (Arm) July 28, 2022, 3:18 p.m. UTC | #1
On Wed, 27 Jul 2022 18:41:29 +0200, Krzysztof Kozlowski wrote:
> Instead of listing directly properties typical for SPI peripherals,
> reference the spi-peripheral-props.yaml schema.  This allows using all
> properties typical for SPI-connected devices, even these which device
> bindings author did not tried yet.
> 
> Remove the spi-* properties which now come via spi-peripheral-props.yaml
> schema, except for the cases when device schema adds some constraints
> like maximum frequency.
> 
> While changing additionalProperties->unevaluatedProperties, put it in
> typical place, just before example DTS.
> 
> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> 
> ---
> 
> Technically, this depends on [1] merged to SPI tree, if we want to
> preserve existing behavior of not allowing SPI CPHA and CPOL in each of
> schemas in this patch.
> 
> If this patch comes independently via different tree, the SPI CPHA and
> CPOL will be allowed for brief period of time, before [1] is merged.
> This will not have negative impact, just DT schema checks will be
> loosened for that period.

I don't think these need to go via the same tree.

> 
> [1] https://lore.kernel.org/all/20220722191539.90641-2-krzysztof.kozlowski@linaro.org/
> ---
>  Documentation/devicetree/bindings/net/nfc/marvell,nci.yaml | 4 ++--
>  Documentation/devicetree/bindings/net/nfc/st,st-nci.yaml   | 5 ++---
>  Documentation/devicetree/bindings/net/nfc/st,st95hf.yaml   | 7 ++++---
>  Documentation/devicetree/bindings/net/nfc/ti,trf7970a.yaml | 7 ++++---
>  4 files changed, 12 insertions(+), 11 deletions(-)
> 

Acked-by: Rob Herring <robh@kernel.org>
Rob Herring (Arm) July 28, 2022, 3:18 p.m. UTC | #2
On Wed, 27 Jul 2022 18:41:30 +0200, Krzysztof Kozlowski wrote:
> Instead of listing directly properties typical for SPI peripherals,
> reference the spi-peripheral-props.yaml schema.  This allows using all
> properties typical for SPI-connected devices, even these which device
> bindings author did not tried yet.
> 
> Remove the spi-* properties which now come via spi-peripheral-props.yaml
> schema, except for the cases when device schema adds some constraints
> like maximum frequency.
> 
> While changing additionalProperties->unevaluatedProperties, put it in
> typical place, just before example DTS.
> 
> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> 
> ---
> 
> Technically, this depends on [1] merged to SPI tree, if we want to
> preserve existing behavior of not allowing SPI CPHA and CPOL in each of
> schemas in this patch.
> 
> If this patch comes independently via different tree, the SPI CPHA and
> CPOL will be allowed for brief period of time, before [1] is merged.
> This will not have negative impact, just DT schema checks will be
> loosened for that period.
> 
> [1] https://lore.kernel.org/all/20220722191539.90641-2-krzysztof.kozlowski@linaro.org/
> ---
>  .../net/wireless/microchip,wilc1000.yaml      |  7 ++--
>  .../bindings/net/wireless/silabs,wfx.yaml     | 15 +++------
>  .../bindings/net/wireless/ti,wlcore.yaml      | 32 +++++++++----------
>  3 files changed, 25 insertions(+), 29 deletions(-)
> 

Acked-by: Rob Herring <robh@kernel.org>
Krzysztof Kozlowski July 28, 2022, 4:31 p.m. UTC | #3
On 28/07/2022 17:18, Rob Herring wrote:
> On Wed, 27 Jul 2022 18:41:29 +0200, Krzysztof Kozlowski wrote:
>> Instead of listing directly properties typical for SPI peripherals,
>> reference the spi-peripheral-props.yaml schema.  This allows using all
>> properties typical for SPI-connected devices, even these which device
>> bindings author did not tried yet.
>>
>> Remove the spi-* properties which now come via spi-peripheral-props.yaml
>> schema, except for the cases when device schema adds some constraints
>> like maximum frequency.
>>
>> While changing additionalProperties->unevaluatedProperties, put it in
>> typical place, just before example DTS.
>>
>> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
>>
>> ---
>>
>> Technically, this depends on [1] merged to SPI tree, if we want to
>> preserve existing behavior of not allowing SPI CPHA and CPOL in each of
>> schemas in this patch.
>>
>> If this patch comes independently via different tree, the SPI CPHA and
>> CPOL will be allowed for brief period of time, before [1] is merged.
>> This will not have negative impact, just DT schema checks will be
>> loosened for that period.
> 
> I don't think these need to go via the same tree.

Yeah, I wanted to express it that almost no impact is expected if it
goes independently. I could be more explicit here.


Best regards,
Krzysztof
Jakub Kicinski July 29, 2022, 5:27 a.m. UTC | #4
On Thu, 28 Jul 2022 18:31:32 +0200 Krzysztof Kozlowski wrote:
> Yeah, I wanted to express it that almost no impact is expected if it
> goes independently. I could be more explicit here.

I'm taking the nfc one, and leaving the wireless change for Kalle.
patchwork-bot+netdevbpf@kernel.org July 29, 2022, 5:30 a.m. UTC | #5
Hello:

This series was applied to netdev/net-next.git (master)
by Jakub Kicinski <kuba@kernel.org>:

On Wed, 27 Jul 2022 18:41:29 +0200 you wrote:
> Instead of listing directly properties typical for SPI peripherals,
> reference the spi-peripheral-props.yaml schema.  This allows using all
> properties typical for SPI-connected devices, even these which device
> bindings author did not tried yet.
> 
> Remove the spi-* properties which now come via spi-peripheral-props.yaml
> schema, except for the cases when device schema adds some constraints
> like maximum frequency.
> 
> [...]

Here is the summary with links:
  - [1/2] dt-bindings: nfc: use spi-peripheral-props.yaml
    https://git.kernel.org/netdev/net-next/c/ba323f6bee1d
  - [2/2] dt-bindings: wireless: use spi-peripheral-props.yaml
    (no matching commit)

You are awesome, thank you!
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/net/nfc/marvell,nci.yaml b/Documentation/devicetree/bindings/net/nfc/marvell,nci.yaml
index 1bcaf6ba822c..a191a04e681c 100644
--- a/Documentation/devicetree/bindings/net/nfc/marvell,nci.yaml
+++ b/Documentation/devicetree/bindings/net/nfc/marvell,nci.yaml
@@ -58,7 +58,6 @@  properties:
 
   spi-cpha: true
   spi-cpol: true
-  spi-max-frequency: true
 
 required:
   - compatible
@@ -85,6 +84,7 @@  allOf:
           contains:
             const: marvell,nfc-spi
     then:
+      $ref: /schemas/spi/spi-peripheral-props.yaml#
       properties:
         break-control: false
         flow-control: false
@@ -108,7 +108,7 @@  allOf:
         spi-max-frequency: false
         reg: false
 
-additionalProperties: false
+unevaluatedProperties: false
 
 examples:
   - |
diff --git a/Documentation/devicetree/bindings/net/nfc/st,st-nci.yaml b/Documentation/devicetree/bindings/net/nfc/st,st-nci.yaml
index ef1155038a2f..1dcbddbc5a74 100644
--- a/Documentation/devicetree/bindings/net/nfc/st,st-nci.yaml
+++ b/Documentation/devicetree/bindings/net/nfc/st,st-nci.yaml
@@ -30,8 +30,6 @@  properties:
   reg:
     maxItems: 1
 
-  spi-max-frequency: true
-
   uicc-present:
     type: boolean
     description: |
@@ -55,10 +53,11 @@  then:
   properties:
     spi-max-frequency: false
 else:
+  $ref: /schemas/spi/spi-peripheral-props.yaml#
   required:
     - spi-max-frequency
 
-additionalProperties: false
+unevaluatedProperties: false
 
 examples:
   - |
diff --git a/Documentation/devicetree/bindings/net/nfc/st,st95hf.yaml b/Documentation/devicetree/bindings/net/nfc/st,st95hf.yaml
index 963d9531a856..647569051ed8 100644
--- a/Documentation/devicetree/bindings/net/nfc/st,st95hf.yaml
+++ b/Documentation/devicetree/bindings/net/nfc/st,st95hf.yaml
@@ -25,8 +25,6 @@  properties:
   st95hfvin-supply:
     description: ST95HF transceiver's Vin regulator supply
 
-  spi-max-frequency: true
-
 required:
   - compatible
   - enable-gpio
@@ -34,7 +32,10 @@  required:
   - reg
   - spi-max-frequency
 
-additionalProperties: false
+allOf:
+  - $ref: /schemas/spi/spi-peripheral-props.yaml#
+
+unevaluatedProperties: false
 
 examples:
   - |
diff --git a/Documentation/devicetree/bindings/net/nfc/ti,trf7970a.yaml b/Documentation/devicetree/bindings/net/nfc/ti,trf7970a.yaml
index 404c8df99364..9cc236ec42f2 100644
--- a/Documentation/devicetree/bindings/net/nfc/ti,trf7970a.yaml
+++ b/Documentation/devicetree/bindings/net/nfc/ti,trf7970a.yaml
@@ -40,8 +40,6 @@  properties:
   reg:
     maxItems: 1
 
-  spi-max-frequency: true
-
   ti,enable-gpios:
     minItems: 1
     maxItems: 2
@@ -65,7 +63,10 @@  required:
   - ti,enable-gpios
   - vin-supply
 
-additionalProperties: false
+allOf:
+  - $ref: /schemas/spi/spi-peripheral-props.yaml#
+
+unevaluatedProperties: false
 
 examples:
   - |