linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3 0/2] dt-bindings: mmc: Fix the mmc-slot and Convert atmel,hsmci to json schema
@ 2025-02-12  9:22 Dharma Balasubiramani
  2025-02-12  9:22 ` [PATCH v3 1/2] dt-bindings: mmc: mmc-slot: Make compatible property optional Dharma Balasubiramani
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Dharma Balasubiramani @ 2025-02-12  9:22 UTC (permalink / raw)
  To: Ulf Hansson, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Neil Armstrong, Kevin Hilman, Jerome Brunet, Martin Blumenstingl
  Cc: linux-mmc, devicetree, linux-arm-kernel, linux-amlogic,
	linux-kernel, Dharma Balasubiramani

This patch series modifies the property status of "compatible"
(required/optional).

Signed-off-by: Dharma Balasubiramani <dharma.b@microchip.com>
---
Changes in v3:
- Add compatible as required property in meson binding.
- Include the dependent patch that converts txt to yaml for clarity in patch series.
- Refer the mmc-slot binding in the hsmci binding.
- Explain "why" the property is made optional in commit description.
- Link to v2: https://lore.kernel.org/r/20250205-mmc-slot-v2-1-da3c5f30e2d9@microchip.com

Changes in v2:
- Instead of moving the compatible string to the other binding, just make it
  optional (remove from required list).
- Link to v1: https://lore.kernel.org/r/20241219-mmc-slot-v1-1-dfc747a3d3fb@microchip.com

---
Dharma Balasubiramani (2):
      dt-bindings: mmc: mmc-slot: Make compatible property optional
      dt-bindings: mmc: atmel,hsmci: Convert to json schema

 .../bindings/mmc/amlogic,meson-mx-sdio.yaml        |   3 +
 .../devicetree/bindings/mmc/atmel,hsmci.yaml       | 106 +++++++++++++++++++++
 .../devicetree/bindings/mmc/atmel-hsmci.txt        |  73 --------------
 .../devicetree/bindings/mmc/mmc-slot.yaml          |   1 -
 4 files changed, 109 insertions(+), 74 deletions(-)
---
base-commit: c674aa7c289e51659e40dda0f954886ef7f80042
change-id: 20241219-mmc-slot-0574889daea3

Best regards,
-- 
Dharma Balasubiramani <dharma.b@microchip.com>



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

* [PATCH v3 1/2] dt-bindings: mmc: mmc-slot: Make compatible property optional
  2025-02-12  9:22 [PATCH v3 0/2] dt-bindings: mmc: Fix the mmc-slot and Convert atmel,hsmci to json schema Dharma Balasubiramani
@ 2025-02-12  9:22 ` Dharma Balasubiramani
  2025-02-19 21:49   ` Rob Herring (Arm)
  2025-02-12  9:22 ` [PATCH v3 2/2] dt-bindings: mmc: atmel,hsmci: Convert to json schema Dharma Balasubiramani
  2025-02-16 13:13 ` [PATCH v3 0/2] dt-bindings: mmc: Fix the mmc-slot and Convert atmel,hsmci " Krzysztof Kozlowski
  2 siblings, 1 reply; 6+ messages in thread
From: Dharma Balasubiramani @ 2025-02-12  9:22 UTC (permalink / raw)
  To: Ulf Hansson, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Neil Armstrong, Kevin Hilman, Jerome Brunet, Martin Blumenstingl
  Cc: linux-mmc, devicetree, linux-arm-kernel, linux-amlogic,
	linux-kernel, Dharma Balasubiramani

The compatible property is required for some vendor-specific device trees, such
as Amlogic's meson-mx-sdio, but is unnecessary for others, like Microchip's
DTS. To resolve unintended warnings for configurations that do not require it,
remove compatible from the required properties in mmc-slot.yaml.

Since meson-mx-sdio still requires compatible, explicitly add it to its
required list in amlogic,meson-mx-sdio.yaml.

Signed-off-by: Dharma Balasubiramani <dharma.b@microchip.com>
---
 Documentation/devicetree/bindings/mmc/amlogic,meson-mx-sdio.yaml | 3 +++
 Documentation/devicetree/bindings/mmc/mmc-slot.yaml              | 1 -
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/Documentation/devicetree/bindings/mmc/amlogic,meson-mx-sdio.yaml b/Documentation/devicetree/bindings/mmc/amlogic,meson-mx-sdio.yaml
index 022682a977c6..0d4d9ca6a8d9 100644
--- a/Documentation/devicetree/bindings/mmc/amlogic,meson-mx-sdio.yaml
+++ b/Documentation/devicetree/bindings/mmc/amlogic,meson-mx-sdio.yaml
@@ -60,6 +60,9 @@ patternProperties:
       bus-width:
         enum: [1, 4]
 
+    required:
+      - compatible
+
     unevaluatedProperties: false
 
 required:
diff --git a/Documentation/devicetree/bindings/mmc/mmc-slot.yaml b/Documentation/devicetree/bindings/mmc/mmc-slot.yaml
index 1f0667828063..ca3d0114bfc6 100644
--- a/Documentation/devicetree/bindings/mmc/mmc-slot.yaml
+++ b/Documentation/devicetree/bindings/mmc/mmc-slot.yaml
@@ -29,7 +29,6 @@ properties:
     maxItems: 1
 
 required:
-  - compatible
   - reg
 
 unevaluatedProperties: false

-- 
2.43.0



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

* [PATCH v3 2/2] dt-bindings: mmc: atmel,hsmci: Convert to json schema
  2025-02-12  9:22 [PATCH v3 0/2] dt-bindings: mmc: Fix the mmc-slot and Convert atmel,hsmci to json schema Dharma Balasubiramani
  2025-02-12  9:22 ` [PATCH v3 1/2] dt-bindings: mmc: mmc-slot: Make compatible property optional Dharma Balasubiramani
@ 2025-02-12  9:22 ` Dharma Balasubiramani
  2025-02-19 22:23   ` Rob Herring
  2025-02-16 13:13 ` [PATCH v3 0/2] dt-bindings: mmc: Fix the mmc-slot and Convert atmel,hsmci " Krzysztof Kozlowski
  2 siblings, 1 reply; 6+ messages in thread
From: Dharma Balasubiramani @ 2025-02-12  9:22 UTC (permalink / raw)
  To: Ulf Hansson, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Neil Armstrong, Kevin Hilman, Jerome Brunet, Martin Blumenstingl
  Cc: linux-mmc, devicetree, linux-arm-kernel, linux-amlogic,
	linux-kernel, Dharma Balasubiramani

Convert atmel,hsmci documentation to yaml format. The new file will inherit
from mmc-controller.yaml.

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

diff --git a/Documentation/devicetree/bindings/mmc/atmel,hsmci.yaml b/Documentation/devicetree/bindings/mmc/atmel,hsmci.yaml
new file mode 100644
index 000000000000..feaa98e44955
--- /dev/null
+++ b/Documentation/devicetree/bindings/mmc/atmel,hsmci.yaml
@@ -0,0 +1,106 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/mmc/atmel,hsmci.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Atmel High-Speed MultiMedia Card Interface (HSMCI)
+
+description:
+  The Atmel HSMCI controller provides an interface for MMC, SD, and SDIO memory
+  cards.
+
+maintainers:
+  - Nicolas Ferre <nicolas.ferre@microchip.com>
+  - Aubin Constans <aubin.constans@microchip.com>
+
+allOf:
+  - $ref: mmc-controller.yaml
+
+properties:
+  compatible:
+    const: atmel,hsmci
+
+  reg:
+    maxItems: 1
+
+  interrupts:
+    maxItems: 1
+
+  dmas:
+    maxItems: 1
+
+  dma-names:
+    const: rxtx
+
+  clocks:
+    maxItems: 1
+
+  clock-names:
+    const: mci_clk
+
+  "#address-cells":
+    const: 1
+    description: Used for slot IDs.
+
+  "#size-cells":
+    const: 0
+
+patternProperties:
+  "^slot@[0-9]+$":
+    $ref: mmc-slot.yaml
+    description: A slot node representing an MMC, SD, or SDIO slot.
+
+    properties:
+      reg:
+        enum: [0, 1]
+
+    required:
+      - reg
+      - bus-width
+
+    unevaluatedProperties: false
+
+required:
+  - compatible
+  - reg
+  - interrupts
+  - clocks
+  - clock-names
+  - "#address-cells"
+  - "#size-cells"
+
+anyOf:
+  - required:
+      - slot@0
+  - required:
+      - slot@1
+
+unevaluatedProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/interrupt-controller/irq.h>
+    #include <dt-bindings/clock/at91.h>
+    mmc@f0008000 {
+      compatible = "atmel,hsmci";
+      reg = <0xf0008000 0x600>;
+      interrupts = <12 IRQ_TYPE_LEVEL_HIGH>;
+      clocks = <&mci0_clk>;
+      clock-names = "mci_clk";
+      #address-cells = <1>;
+      #size-cells = <0>;
+
+      slot@0 {
+        reg = <0>;
+        bus-width = <4>;
+        cd-gpios = <&pioD 15 0>;
+        cd-inverted;
+      };
+
+      slot@1 {
+        reg = <1>;
+        bus-width = <4>;
+      };
+    };
+...
diff --git a/Documentation/devicetree/bindings/mmc/atmel-hsmci.txt b/Documentation/devicetree/bindings/mmc/atmel-hsmci.txt
deleted file mode 100644
index 07ad02075a93..000000000000
--- a/Documentation/devicetree/bindings/mmc/atmel-hsmci.txt
+++ /dev/null
@@ -1,73 +0,0 @@
-* Atmel High Speed MultiMedia Card Interface
-
-This controller on atmel products provides an interface for MMC, SD and SDIO
-types of memory cards.
-
-This file documents differences between the core properties described
-by mmc.txt and the properties used by the atmel-mci driver.
-
-1) MCI node
-
-Required properties:
-- compatible: should be "atmel,hsmci"
-- #address-cells: should be one. The cell is the slot id.
-- #size-cells: should be zero.
-- at least one slot node
-- clock-names: tuple listing input clock names.
-	Required elements: "mci_clk"
-- clocks: phandles to input clocks.
-
-The node contains child nodes for each slot that the platform uses
-
-Example MCI node:
-
-mmc0: mmc@f0008000 {
-	compatible = "atmel,hsmci";
-	reg = <0xf0008000 0x600>;
-	interrupts = <12 4>;
-	#address-cells = <1>;
-	#size-cells = <0>;
-	clock-names = "mci_clk";
-	clocks = <&mci0_clk>;
-
-	[ child node definitions...]
-};
-
-2) slot nodes
-
-Required properties:
-- reg: should contain the slot id.
-- bus-width: number of data lines connected to the controller
-
-Optional properties:
-- cd-gpios: specify GPIOs for card detection
-- cd-inverted: invert the value of external card detect gpio line
-- wp-gpios: specify GPIOs for write protection
-
-Example slot node:
-
-slot@0 {
-	reg = <0>;
-	bus-width = <4>;
-	cd-gpios = <&pioD 15 0>
-	cd-inverted;
-};
-
-Example full MCI node:
-mmc0: mmc@f0008000 {
-	compatible = "atmel,hsmci";
-	reg = <0xf0008000 0x600>;
-	interrupts = <12 4>;
-	#address-cells = <1>;
-	#size-cells = <0>;
-	slot@0 {
-		reg = <0>;
-		bus-width = <4>;
-		cd-gpios = <&pioD 15 0>
-		cd-inverted;
-	};
-	slot@1 {
-		reg = <1>;
-		bus-width = <4>;
-	};
-};

-- 
2.43.0



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

* Re: [PATCH v3 0/2] dt-bindings: mmc: Fix the mmc-slot and Convert atmel,hsmci to json schema
  2025-02-12  9:22 [PATCH v3 0/2] dt-bindings: mmc: Fix the mmc-slot and Convert atmel,hsmci to json schema Dharma Balasubiramani
  2025-02-12  9:22 ` [PATCH v3 1/2] dt-bindings: mmc: mmc-slot: Make compatible property optional Dharma Balasubiramani
  2025-02-12  9:22 ` [PATCH v3 2/2] dt-bindings: mmc: atmel,hsmci: Convert to json schema Dharma Balasubiramani
@ 2025-02-16 13:13 ` Krzysztof Kozlowski
  2 siblings, 0 replies; 6+ messages in thread
From: Krzysztof Kozlowski @ 2025-02-16 13:13 UTC (permalink / raw)
  To: Dharma Balasubiramani, Ulf Hansson, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Neil Armstrong, Kevin Hilman,
	Jerome Brunet, Martin Blumenstingl
  Cc: linux-mmc, devicetree, linux-arm-kernel, linux-amlogic,
	linux-kernel

On 12/02/2025 10:22, Dharma Balasubiramani wrote:
> This patch series modifies the property status of "compatible"
> (required/optional).
> 
> Signed-off-by: Dharma Balasubiramani <dharma.b@microchip.com>

Are you sure you run checkpatch before sending?

Best regards,
Krzysztof


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

* Re: [PATCH v3 1/2] dt-bindings: mmc: mmc-slot: Make compatible property optional
  2025-02-12  9:22 ` [PATCH v3 1/2] dt-bindings: mmc: mmc-slot: Make compatible property optional Dharma Balasubiramani
@ 2025-02-19 21:49   ` Rob Herring (Arm)
  0 siblings, 0 replies; 6+ messages in thread
From: Rob Herring (Arm) @ 2025-02-19 21:49 UTC (permalink / raw)
  To: Dharma Balasubiramani
  Cc: Kevin Hilman, linux-amlogic, linux-mmc, devicetree, Conor Dooley,
	linux-arm-kernel, Neil Armstrong, linux-kernel,
	Martin Blumenstingl, Jerome Brunet, Krzysztof Kozlowski,
	Ulf Hansson


On Wed, 12 Feb 2025 14:52:10 +0530, Dharma Balasubiramani wrote:
> The compatible property is required for some vendor-specific device trees, such
> as Amlogic's meson-mx-sdio, but is unnecessary for others, like Microchip's
> DTS. To resolve unintended warnings for configurations that do not require it,
> remove compatible from the required properties in mmc-slot.yaml.

Please rewrap your commit message at the right length. checkpatch.pl 
will tell you this so I don't have to.

> 
> Since meson-mx-sdio still requires compatible, explicitly add it to its
> required list in amlogic,meson-mx-sdio.yaml.
> 
> Signed-off-by: Dharma Balasubiramani <dharma.b@microchip.com>
> ---
>  Documentation/devicetree/bindings/mmc/amlogic,meson-mx-sdio.yaml | 3 +++
>  Documentation/devicetree/bindings/mmc/mmc-slot.yaml              | 1 -
>  2 files changed, 3 insertions(+), 1 deletion(-)
> 

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



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

* Re: [PATCH v3 2/2] dt-bindings: mmc: atmel,hsmci: Convert to json schema
  2025-02-12  9:22 ` [PATCH v3 2/2] dt-bindings: mmc: atmel,hsmci: Convert to json schema Dharma Balasubiramani
@ 2025-02-19 22:23   ` Rob Herring
  0 siblings, 0 replies; 6+ messages in thread
From: Rob Herring @ 2025-02-19 22:23 UTC (permalink / raw)
  To: Dharma Balasubiramani
  Cc: Ulf Hansson, Krzysztof Kozlowski, Conor Dooley, Neil Armstrong,
	Kevin Hilman, Jerome Brunet, Martin Blumenstingl, linux-mmc,
	devicetree, linux-arm-kernel, linux-amlogic, linux-kernel

On Wed, Feb 12, 2025 at 02:52:11PM +0530, Dharma Balasubiramani wrote:
> Convert atmel,hsmci documentation to yaml format. The new file will inherit
> from mmc-controller.yaml.
> 
> Signed-off-by: Dharma Balasubiramani <dharma.b@microchip.com>
> ---
>  .../devicetree/bindings/mmc/atmel,hsmci.yaml       | 106 +++++++++++++++++++++
>  .../devicetree/bindings/mmc/atmel-hsmci.txt        |  73 --------------
>  2 files changed, 106 insertions(+), 73 deletions(-)
> 
> diff --git a/Documentation/devicetree/bindings/mmc/atmel,hsmci.yaml b/Documentation/devicetree/bindings/mmc/atmel,hsmci.yaml
> new file mode 100644
> index 000000000000..feaa98e44955
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/mmc/atmel,hsmci.yaml
> @@ -0,0 +1,106 @@
> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/mmc/atmel,hsmci.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Atmel High-Speed MultiMedia Card Interface (HSMCI)
> +
> +description:
> +  The Atmel HSMCI controller provides an interface for MMC, SD, and SDIO memory
> +  cards.
> +
> +maintainers:
> +  - Nicolas Ferre <nicolas.ferre@microchip.com>
> +  - Aubin Constans <aubin.constans@microchip.com>
> +
> +allOf:
> +  - $ref: mmc-controller.yaml
> +
> +properties:
> +  compatible:
> +    const: atmel,hsmci
> +
> +  reg:
> +    maxItems: 1
> +
> +  interrupts:
> +    maxItems: 1
> +
> +  dmas:
> +    maxItems: 1
> +
> +  dma-names:
> +    const: rxtx
> +
> +  clocks:
> +    maxItems: 1
> +
> +  clock-names:
> +    const: mci_clk
> +
> +  "#address-cells":
> +    const: 1
> +    description: Used for slot IDs.
> +
> +  "#size-cells":
> +    const: 0
> +
> +patternProperties:
> +  "^slot@[0-9]+$":

If reg can only be 0 or 1, then allowing 2-<infinity> is not valid.

Otherwise,

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

> +    $ref: mmc-slot.yaml
> +    description: A slot node representing an MMC, SD, or SDIO slot.
> +
> +    properties:
> +      reg:
> +        enum: [0, 1]


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

end of thread, other threads:[~2025-02-19 22:26 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-02-12  9:22 [PATCH v3 0/2] dt-bindings: mmc: Fix the mmc-slot and Convert atmel,hsmci to json schema Dharma Balasubiramani
2025-02-12  9:22 ` [PATCH v3 1/2] dt-bindings: mmc: mmc-slot: Make compatible property optional Dharma Balasubiramani
2025-02-19 21:49   ` Rob Herring (Arm)
2025-02-12  9:22 ` [PATCH v3 2/2] dt-bindings: mmc: atmel,hsmci: Convert to json schema Dharma Balasubiramani
2025-02-19 22:23   ` Rob Herring
2025-02-16 13:13 ` [PATCH v3 0/2] dt-bindings: mmc: Fix the mmc-slot and Convert atmel,hsmci " Krzysztof Kozlowski

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