diff mbox series

[v3,1/2] dt-bindings: mmc: sdhci-atmel: Convert to json schema

Message ID 20240830-atmel-sdhci-v3-1-7c97a0872af4@microchip.com (mailing list archive)
State New
Headers show
Series Update sdhci-atmel dt-binding documentation | expand

Commit Message

Dharma Balasubiramani Aug. 30, 2024, 2:51 p.m. UTC
Convert sdhci-atmel documentation to yaml format. The new file will inherit
from sdhci-common.yaml.

Note: Add microchip,sama7g5-sdhci to compatible list as we already use it
in the DT.

Signed-off-by: Dharma Balasubiramani <dharma.b@microchip.com>
---
 .../bindings/mmc/atmel,sama5d2-sdhci.yaml          | 90 ++++++++++++++++++++++
 .../devicetree/bindings/mmc/sdhci-atmel.txt        | 35 ---------
 2 files changed, 90 insertions(+), 35 deletions(-)

Comments

Krzysztof Kozlowski Aug. 31, 2024, 6:19 a.m. UTC | #1
On Fri, Aug 30, 2024 at 08:21:20PM +0530, Dharma Balasubiramani wrote:
> Convert sdhci-atmel documentation to yaml format. The new file will inherit
> from sdhci-common.yaml.
> 
> Note: Add microchip,sama7g5-sdhci to compatible list as we already use it
> in the DT.
> 
> Signed-off-by: Dharma Balasubiramani <dharma.b@microchip.com>
> ---
>  .../bindings/mmc/atmel,sama5d2-sdhci.yaml          | 90 ++++++++++++++++++++++
>  .../devicetree/bindings/mmc/sdhci-atmel.txt        | 35 ---------
>  2 files changed, 90 insertions(+), 35 deletions(-)
> 
> diff --git a/Documentation/devicetree/bindings/mmc/atmel,sama5d2-sdhci.yaml b/Documentation/devicetree/bindings/mmc/atmel,sama5d2-sdhci.yaml
> new file mode 100644
> index 000000000000..ba4786328833
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/mmc/atmel,sama5d2-sdhci.yaml
> @@ -0,0 +1,90 @@
> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/mmc/atmel,sama5d2-sdhci.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Atmel SDHCI controller
> +
> +maintainers:
> +  - Aubin Constans <aubin.constans@microchip.com>
> +  - Nicolas Ferre <nicolas.ferre@microchip.com>
> +
> +description:
> +  Bindings for the SDHCI controller found in Atmel/Microchip SoCs.
> +
> +properties:
> +  compatible:
> +    oneOf:
> +      - enum:
> +          - atmel,sama5d2-sdhci
> +          - atmel,sama5d3-sdhci

This wasn't in the old binding.

> +          - atmel,sama5d4-sdhci

Neither this.

> +          - microchip,sam9x60-sdhci
> +      - items:
> +          - enum:
> +              - microchip,sama7g5-sdhci
> +          - const: microchip,sam9x60-sdhci

What happened with microchip,sam9x7-sdhci compatible from the old binding?

And none of above changes are explained in commit msg.



Best regards,
Krzysztof
Dharma Balasubiramani Aug. 31, 2024, 7:47 a.m. UTC | #2
Hi Krzysztof,

On 31/08/24 11:49 am, Krzysztof Kozlowski wrote:
> EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe
> 
> On Fri, Aug 30, 2024 at 08:21:20PM +0530, Dharma Balasubiramani wrote:
>> Convert sdhci-atmel documentation to yaml format. The new file will inherit
>> from sdhci-common.yaml.
>>
>> Note: Add microchip,sama7g5-sdhci to compatible list as we already use it
>> in the DT.
>>
>> Signed-off-by: Dharma Balasubiramani <dharma.b@microchip.com>
>> ---
>>   .../bindings/mmc/atmel,sama5d2-sdhci.yaml          | 90 ++++++++++++++++++++++
>>   .../devicetree/bindings/mmc/sdhci-atmel.txt        | 35 ---------
>>   2 files changed, 90 insertions(+), 35 deletions(-)
>>
>> diff --git a/Documentation/devicetree/bindings/mmc/atmel,sama5d2-sdhci.yaml b/Documentation/devicetree/bindings/mmc/atmel,sama5d2-sdhci.yaml
>> new file mode 100644
>> index 000000000000..ba4786328833
>> --- /dev/null
>> +++ b/Documentation/devicetree/bindings/mmc/atmel,sama5d2-sdhci.yaml
>> @@ -0,0 +1,90 @@
>> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
>> +%YAML 1.2
>> +---
>> +$id: http://devicetree.org/schemas/mmc/atmel,sama5d2-sdhci.yaml#
>> +$schema: http://devicetree.org/meta-schemas/core.yaml#
>> +
>> +title: Atmel SDHCI controller
>> +
>> +maintainers:
>> +  - Aubin Constans <aubin.constans@microchip.com>
>> +  - Nicolas Ferre <nicolas.ferre@microchip.com>
>> +
>> +description:
>> +  Bindings for the SDHCI controller found in Atmel/Microchip SoCs.
>> +
>> +properties:
>> +  compatible:
>> +    oneOf:
>> +      - enum:
>> +          - atmel,sama5d2-sdhci
>> +          - atmel,sama5d3-sdhci
> 
> This wasn't in the old binding.
> 
>> +          - atmel,sama5d4-sdhci
> 
> Neither this.

My bad, I accidentally added those compatibles that are not present in 
the old binding or the DTS files.

> 
>> +          - microchip,sam9x60-sdhci
>> +      - items:
>> +          - enum:
>> +              - microchip,sama7g5-sdhci
>> +          - const: microchip,sam9x60-sdhci
> 
> What happened with microchip,sam9x7-sdhci compatible from the old binding?
> 
> And none of above changes are explained in commit msg.

Since there are no users of microchip,sam9x7-sdhci compatible from the 
old binding I missed adding it during the conversion.

I'll correct these issues and make the necessary adjustments (remove the 
"atmel,sama5d3-sdhci" and "atmel,sama5d4-sdhci" compatibles and add back 
the "microchip,sam9x7-sdhci" compatible) in the next revision of this 
patch series.

Thanks.

> 
> 
> 
> Best regards,
> Krzysztof
> 
>
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/mmc/atmel,sama5d2-sdhci.yaml b/Documentation/devicetree/bindings/mmc/atmel,sama5d2-sdhci.yaml
new file mode 100644
index 000000000000..ba4786328833
--- /dev/null
+++ b/Documentation/devicetree/bindings/mmc/atmel,sama5d2-sdhci.yaml
@@ -0,0 +1,90 @@ 
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/mmc/atmel,sama5d2-sdhci.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Atmel SDHCI controller
+
+maintainers:
+  - Aubin Constans <aubin.constans@microchip.com>
+  - Nicolas Ferre <nicolas.ferre@microchip.com>
+
+description:
+  Bindings for the SDHCI controller found in Atmel/Microchip SoCs.
+
+properties:
+  compatible:
+    oneOf:
+      - enum:
+          - atmel,sama5d2-sdhci
+          - atmel,sama5d3-sdhci
+          - atmel,sama5d4-sdhci
+          - microchip,sam9x60-sdhci
+      - items:
+          - enum:
+              - microchip,sama7g5-sdhci
+          - const: microchip,sam9x60-sdhci
+
+  reg:
+    maxItems: 1
+
+  interrupts:
+    maxItems: 1
+
+  clocks:
+    items:
+      - description: hclock
+      - description: multclk
+      - description: baseclk
+    minItems: 2
+
+  clock-names:
+    items:
+      - const: hclock
+      - const: multclk
+      - const: baseclk
+    minItems: 2
+
+  microchip,sdcal-inverted:
+    type: boolean
+    description:
+      When present, polarity on the SDCAL SoC pin is inverted.
+
+required:
+  - compatible
+  - reg
+  - interrupts
+  - clocks
+  - clock-names
+
+allOf:
+  - $ref: sdhci-common.yaml#
+  - if:
+      properties:
+        compatible:
+          contains:
+            enum:
+              - atmel,sama5d2-sdhci
+    then:
+      properties:
+        clocks:
+          minItems: 3
+        clock-names:
+          minItems: 3
+
+unevaluatedProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/interrupt-controller/irq.h>
+    #include <dt-bindings/clock/at91.h>
+    mmc@a0000000 {
+        compatible = "atmel,sama5d2-sdhci";
+        reg = <0xa0000000 0x300>;
+        interrupts = <31 IRQ_TYPE_LEVEL_HIGH 0>;
+        clocks = <&sdmmc0_hclk>, <&sdmmc0_gclk>, <&main>;
+        clock-names = "hclock", "multclk", "baseclk";
+        assigned-clocks = <&sdmmc0_gclk>;
+        assigned-clock-rates = <480000000>;
+    };
diff --git a/Documentation/devicetree/bindings/mmc/sdhci-atmel.txt b/Documentation/devicetree/bindings/mmc/sdhci-atmel.txt
deleted file mode 100644
index a9fb0a91245f..000000000000
--- a/Documentation/devicetree/bindings/mmc/sdhci-atmel.txt
+++ /dev/null
@@ -1,35 +0,0 @@ 
-* Atmel SDHCI controller
-
-This file documents the differences between the core properties in
-Documentation/devicetree/bindings/mmc/mmc.txt and the properties used by the
-sdhci-of-at91 driver.
-
-Required properties:
-- compatible:		Must be "atmel,sama5d2-sdhci" or "microchip,sam9x60-sdhci"
-			or "microchip,sam9x7-sdhci", "microchip,sam9x60-sdhci".
-- clocks:		Phandlers to the clocks.
-- clock-names:		Must be "hclock", "multclk", "baseclk" for
-			"atmel,sama5d2-sdhci".
-			Must be "hclock", "multclk" for "microchip,sam9x60-sdhci".
-			Must be "hclock", "multclk" for "microchip,sam9x7-sdhci".
-
-Optional properties:
-- assigned-clocks:	The same with "multclk".
-- assigned-clock-rates	The rate of "multclk" in order to not rely on the
-			gck configuration set by previous components.
-- microchip,sdcal-inverted: when present, polarity on the SDCAL SoC pin is
-  inverted. The default polarity for this signal is described in the datasheet.
-  For instance on SAMA5D2, the pin is usually tied to the GND with a resistor
-  and a capacitor (see "SDMMC I/O Calibration" chapter).
-
-Example:
-
-mmc0: sdio-host@a0000000 {
-	compatible = "atmel,sama5d2-sdhci";
-	reg = <0xa0000000 0x300>;
-	interrupts = <31 IRQ_TYPE_LEVEL_HIGH 0>;
-	clocks = <&sdmmc0_hclk>, <&sdmmc0_gclk>, <&main>;
-	clock-names = "hclock", "multclk", "baseclk";
-	assigned-clocks = <&sdmmc0_gclk>;
-	assigned-clock-rates = <480000000>;
-};