Linux MultiMedia Card development
 help / color / mirror / Atom feed
* [PATCH 25/54] dt-bindings: mmc: Convert MMC Card binding to a schema
       [not found] <20210721140424.725744-1-maxime@cerno.tech>
@ 2021-07-21 14:03 ` Maxime Ripard
  2021-07-23 21:57   ` Rob Herring
  0 siblings, 1 reply; 3+ messages in thread
From: Maxime Ripard @ 2021-07-21 14:03 UTC (permalink / raw)
  To: Chen-Yu Tsai, Maxime Ripard, Jernej Skrabec, devicetree,
	Rob Herring, Frank Rowand
  Cc: linux-arm-kernel, linux-sunxi, linux-mmc, Ulf Hansson

MMC Cards can have an optional Device Tree binding to add
non-discoverable properties.

Now that we have the DT validation in place, let's convert the device
tree bindings for that driver over to a YAML schema.

Some of these properties were already described in the MMC controller
binding, even though they are not generic and do not apply to any
device, so we took the occasion to fix this.

Cc: linux-mmc@vger.kernel.org
Cc: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Maxime Ripard <maxime@cerno.tech>
---
 .../devicetree/bindings/mmc/mmc-card.txt      | 30 ------------
 .../devicetree/bindings/mmc/mmc-card.yaml     | 48 +++++++++++++++++++
 .../bindings/mmc/mmc-controller.yaml          |  6 ---
 3 files changed, 48 insertions(+), 36 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/mmc/mmc-card.txt
 create mode 100644 Documentation/devicetree/bindings/mmc/mmc-card.yaml

diff --git a/Documentation/devicetree/bindings/mmc/mmc-card.txt b/Documentation/devicetree/bindings/mmc/mmc-card.txt
deleted file mode 100644
index 8d2d71758907..000000000000
--- a/Documentation/devicetree/bindings/mmc/mmc-card.txt
+++ /dev/null
@@ -1,30 +0,0 @@
-mmc-card / eMMC bindings
-------------------------
-
-This documents describes the devicetree bindings for a mmc-host controller
-child node describing a mmc-card / an eMMC, see "Use of Function subnodes"
-in mmc.txt
-
-Required properties:
--compatible : Must be "mmc-card"
--reg        : Must be <0>
-
-Optional properties:
--broken-hpi : Use this to indicate that the mmc-card has a broken hpi
-              implementation, and that hpi should not be used
-
-Example:
-
-&mmc2 {
-	pinctrl-names = "default";
-	pinctrl-0 = <&mmc2_pins_a>;
-	vmmc-supply = <&reg_vcc3v3>;
-	bus-width = <8>;
-	non-removable;
-
-	mmccard: mmccard@0 {
-		reg = <0>;
-		compatible = "mmc-card";
-		broken-hpi;
-	};
-};
diff --git a/Documentation/devicetree/bindings/mmc/mmc-card.yaml b/Documentation/devicetree/bindings/mmc/mmc-card.yaml
new file mode 100644
index 000000000000..aefdd8748b72
--- /dev/null
+++ b/Documentation/devicetree/bindings/mmc/mmc-card.yaml
@@ -0,0 +1,48 @@
+# SPDX-License-Identifier: GPL-2.0
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/mmc/mmc-card.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: MMC Card / eMMC Generic Device Tree Bindings
+
+maintainers:
+  - Ulf Hansson <ulf.hansson@linaro.org>
+
+description: |
+  This documents describes the devicetree bindings for a mmc-host controller
+  child node describing a mmc-card / an eMMC.
+
+properties:
+  compatible:
+    const: mmc-card
+
+  reg:
+    const: 0
+
+  broken-hpi:
+    $ref: /schemas/types.yaml#/definitions/flag
+    description:
+      Use this to indicate that the mmc-card has a broken hpi
+      implementation, and that hpi should not be used.
+
+required:
+  - compatible
+  - reg
+
+additionalProperties: true
+
+examples:
+  - |
+    mmc {
+        #address-cells = <1>;
+        #size-cells = <0>;
+
+        card@0 {
+            compatible = "mmc-card";
+            reg = <0>;
+            broken-hpi;
+        };
+    };
+
+...
diff --git a/Documentation/devicetree/bindings/mmc/mmc-controller.yaml b/Documentation/devicetree/bindings/mmc/mmc-controller.yaml
index 25ac8e200970..513f3c8758aa 100644
--- a/Documentation/devicetree/bindings/mmc/mmc-controller.yaml
+++ b/Documentation/devicetree/bindings/mmc/mmc-controller.yaml
@@ -333,12 +333,6 @@ patternProperties:
               subnode describes. A value of 0 denotes the memory SD
               function, values from 1 to 7 denote the SDIO functions.
 
-      broken-hpi:
-        $ref: /schemas/types.yaml#/definitions/flag
-        description:
-          Use this to indicate that the mmc-card has a broken hpi
-          implementation, and that hpi should not be used.
-
     required:
       - reg
 
-- 
2.31.1


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

* Re: [PATCH 25/54] dt-bindings: mmc: Convert MMC Card binding to a schema
  2021-07-21 14:03 ` [PATCH 25/54] dt-bindings: mmc: Convert MMC Card binding to a schema Maxime Ripard
@ 2021-07-23 21:57   ` Rob Herring
  2021-08-04 11:24     ` Ulf Hansson
  0 siblings, 1 reply; 3+ messages in thread
From: Rob Herring @ 2021-07-23 21:57 UTC (permalink / raw)
  To: Maxime Ripard
  Cc: Chen-Yu Tsai, Jernej Skrabec, devicetree, Frank Rowand,
	linux-arm-kernel, linux-sunxi, linux-mmc, Ulf Hansson

On Wed, Jul 21, 2021 at 04:03:55PM +0200, Maxime Ripard wrote:
> MMC Cards can have an optional Device Tree binding to add
> non-discoverable properties.
> 
> Now that we have the DT validation in place, let's convert the device
> tree bindings for that driver over to a YAML schema.
> 
> Some of these properties were already described in the MMC controller
> binding, even though they are not generic and do not apply to any
> device, so we took the occasion to fix this.
> 
> Cc: linux-mmc@vger.kernel.org
> Cc: Ulf Hansson <ulf.hansson@linaro.org>
> Signed-off-by: Maxime Ripard <maxime@cerno.tech>
> ---
>  .../devicetree/bindings/mmc/mmc-card.txt      | 30 ------------
>  .../devicetree/bindings/mmc/mmc-card.yaml     | 48 +++++++++++++++++++
>  .../bindings/mmc/mmc-controller.yaml          |  6 ---
>  3 files changed, 48 insertions(+), 36 deletions(-)
>  delete mode 100644 Documentation/devicetree/bindings/mmc/mmc-card.txt
>  create mode 100644 Documentation/devicetree/bindings/mmc/mmc-card.yaml
> 
> diff --git a/Documentation/devicetree/bindings/mmc/mmc-card.txt b/Documentation/devicetree/bindings/mmc/mmc-card.txt
> deleted file mode 100644
> index 8d2d71758907..000000000000
> --- a/Documentation/devicetree/bindings/mmc/mmc-card.txt
> +++ /dev/null
> @@ -1,30 +0,0 @@
> -mmc-card / eMMC bindings
> -------------------------
> -
> -This documents describes the devicetree bindings for a mmc-host controller
> -child node describing a mmc-card / an eMMC, see "Use of Function subnodes"
> -in mmc.txt
> -
> -Required properties:
> --compatible : Must be "mmc-card"
> --reg        : Must be <0>
> -
> -Optional properties:
> --broken-hpi : Use this to indicate that the mmc-card has a broken hpi
> -              implementation, and that hpi should not be used
> -
> -Example:
> -
> -&mmc2 {
> -	pinctrl-names = "default";
> -	pinctrl-0 = <&mmc2_pins_a>;
> -	vmmc-supply = <&reg_vcc3v3>;
> -	bus-width = <8>;
> -	non-removable;
> -
> -	mmccard: mmccard@0 {
> -		reg = <0>;
> -		compatible = "mmc-card";
> -		broken-hpi;
> -	};
> -};
> diff --git a/Documentation/devicetree/bindings/mmc/mmc-card.yaml b/Documentation/devicetree/bindings/mmc/mmc-card.yaml
> new file mode 100644
> index 000000000000..aefdd8748b72
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/mmc/mmc-card.yaml
> @@ -0,0 +1,48 @@
> +# SPDX-License-Identifier: GPL-2.0
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/mmc/mmc-card.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: MMC Card / eMMC Generic Device Tree Bindings
> +
> +maintainers:
> +  - Ulf Hansson <ulf.hansson@linaro.org>
> +
> +description: |
> +  This documents describes the devicetree bindings for a mmc-host controller
> +  child node describing a mmc-card / an eMMC.
> +
> +properties:
> +  compatible:
> +    const: mmc-card
> +
> +  reg:
> +    const: 0
> +
> +  broken-hpi:
> +    $ref: /schemas/types.yaml#/definitions/flag
> +    description:
> +      Use this to indicate that the mmc-card has a broken hpi
> +      implementation, and that hpi should not be used.
> +
> +required:
> +  - compatible
> +  - reg
> +
> +additionalProperties: true

Like what? If there's other properties, then there should really be a 
specific compatible.

> +
> +examples:
> +  - |
> +    mmc {
> +        #address-cells = <1>;
> +        #size-cells = <0>;
> +
> +        card@0 {
> +            compatible = "mmc-card";
> +            reg = <0>;
> +            broken-hpi;
> +        };
> +    };
> +
> +...
> diff --git a/Documentation/devicetree/bindings/mmc/mmc-controller.yaml b/Documentation/devicetree/bindings/mmc/mmc-controller.yaml
> index 25ac8e200970..513f3c8758aa 100644
> --- a/Documentation/devicetree/bindings/mmc/mmc-controller.yaml
> +++ b/Documentation/devicetree/bindings/mmc/mmc-controller.yaml
> @@ -333,12 +333,6 @@ patternProperties:
>                subnode describes. A value of 0 denotes the memory SD
>                function, values from 1 to 7 denote the SDIO functions.
>  
> -      broken-hpi:
> -        $ref: /schemas/types.yaml#/definitions/flag
> -        description:
> -          Use this to indicate that the mmc-card has a broken hpi
> -          implementation, and that hpi should not be used.
> -
>      required:
>        - reg
>  
> -- 
> 2.31.1
> 
> 

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

* Re: [PATCH 25/54] dt-bindings: mmc: Convert MMC Card binding to a schema
  2021-07-23 21:57   ` Rob Herring
@ 2021-08-04 11:24     ` Ulf Hansson
  0 siblings, 0 replies; 3+ messages in thread
From: Ulf Hansson @ 2021-08-04 11:24 UTC (permalink / raw)
  To: Rob Herring, Maxime Ripard
  Cc: Chen-Yu Tsai, Jernej Skrabec, DTML, Frank Rowand, Linux ARM,
	linux-sunxi, linux-mmc

On Fri, 23 Jul 2021 at 23:57, Rob Herring <robh@kernel.org> wrote:
>
> On Wed, Jul 21, 2021 at 04:03:55PM +0200, Maxime Ripard wrote:
> > MMC Cards can have an optional Device Tree binding to add
> > non-discoverable properties.
> >
> > Now that we have the DT validation in place, let's convert the device
> > tree bindings for that driver over to a YAML schema.
> >
> > Some of these properties were already described in the MMC controller
> > binding, even though they are not generic and do not apply to any
> > device, so we took the occasion to fix this.
> >
> > Cc: linux-mmc@vger.kernel.org
> > Cc: Ulf Hansson <ulf.hansson@linaro.org>
> > Signed-off-by: Maxime Ripard <maxime@cerno.tech>
> > ---
> >  .../devicetree/bindings/mmc/mmc-card.txt      | 30 ------------
> >  .../devicetree/bindings/mmc/mmc-card.yaml     | 48 +++++++++++++++++++
> >  .../bindings/mmc/mmc-controller.yaml          |  6 ---
> >  3 files changed, 48 insertions(+), 36 deletions(-)
> >  delete mode 100644 Documentation/devicetree/bindings/mmc/mmc-card.txt
> >  create mode 100644 Documentation/devicetree/bindings/mmc/mmc-card.yaml
> >
> > diff --git a/Documentation/devicetree/bindings/mmc/mmc-card.txt b/Documentation/devicetree/bindings/mmc/mmc-card.txt
> > deleted file mode 100644
> > index 8d2d71758907..000000000000
> > --- a/Documentation/devicetree/bindings/mmc/mmc-card.txt
> > +++ /dev/null
> > @@ -1,30 +0,0 @@
> > -mmc-card / eMMC bindings
> > -------------------------
> > -
> > -This documents describes the devicetree bindings for a mmc-host controller
> > -child node describing a mmc-card / an eMMC, see "Use of Function subnodes"
> > -in mmc.txt
> > -
> > -Required properties:
> > --compatible : Must be "mmc-card"
> > --reg        : Must be <0>
> > -
> > -Optional properties:
> > --broken-hpi : Use this to indicate that the mmc-card has a broken hpi
> > -              implementation, and that hpi should not be used
> > -
> > -Example:
> > -
> > -&mmc2 {
> > -     pinctrl-names = "default";
> > -     pinctrl-0 = <&mmc2_pins_a>;
> > -     vmmc-supply = <&reg_vcc3v3>;
> > -     bus-width = <8>;
> > -     non-removable;
> > -
> > -     mmccard: mmccard@0 {
> > -             reg = <0>;
> > -             compatible = "mmc-card";
> > -             broken-hpi;
> > -     };
> > -};
> > diff --git a/Documentation/devicetree/bindings/mmc/mmc-card.yaml b/Documentation/devicetree/bindings/mmc/mmc-card.yaml
> > new file mode 100644
> > index 000000000000..aefdd8748b72
> > --- /dev/null
> > +++ b/Documentation/devicetree/bindings/mmc/mmc-card.yaml
> > @@ -0,0 +1,48 @@
> > +# SPDX-License-Identifier: GPL-2.0
> > +%YAML 1.2
> > +---
> > +$id: http://devicetree.org/schemas/mmc/mmc-card.yaml#
> > +$schema: http://devicetree.org/meta-schemas/core.yaml#
> > +
> > +title: MMC Card / eMMC Generic Device Tree Bindings
> > +
> > +maintainers:
> > +  - Ulf Hansson <ulf.hansson@linaro.org>
> > +
> > +description: |
> > +  This documents describes the devicetree bindings for a mmc-host controller
> > +  child node describing a mmc-card / an eMMC.
> > +
> > +properties:
> > +  compatible:
> > +    const: mmc-card
> > +
> > +  reg:
> > +    const: 0
> > +
> > +  broken-hpi:
> > +    $ref: /schemas/types.yaml#/definitions/flag
> > +    description:
> > +      Use this to indicate that the mmc-card has a broken hpi
> > +      implementation, and that hpi should not be used.
> > +
> > +required:
> > +  - compatible
> > +  - reg
> > +
> > +additionalProperties: true
>
> Like what? If there's other properties, then there should really be a
> specific compatible.

I agree.

Maxime, thanks for working on this. I assume you will be sending a new
version that I can pick up?

[...]

Kind regards
Uffe

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

end of thread, other threads:[~2021-08-04 11:25 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20210721140424.725744-1-maxime@cerno.tech>
2021-07-21 14:03 ` [PATCH 25/54] dt-bindings: mmc: Convert MMC Card binding to a schema Maxime Ripard
2021-07-23 21:57   ` Rob Herring
2021-08-04 11:24     ` Ulf Hansson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox