diff mbox series

[1/2] dt-bindings: mmc: mmc-pwrseq-simple: add support for reset control

Message ID 20241004120740.2887776-1-catalin.popescu@leica-geosystems.com
State New
Headers show
Series [1/2] dt-bindings: mmc: mmc-pwrseq-simple: add support for reset control | expand

Commit Message

Catalin Popescu Oct. 4, 2024, 12:07 p.m. UTC
Add compatible value "mmc-pwrseq-simple-reset" to support reset control
instead of gpios. Reset controls being refcounted, they allow to use
shared resets or gpios across drivers. Support of reset control is
limited to one single reset control.

Signed-off-by: Catalin Popescu <catalin.popescu@leica-geosystems.com>
---
 .../bindings/mmc/mmc-pwrseq-simple.yaml       | 21 +++++++++++++++++--
 1 file changed, 19 insertions(+), 2 deletions(-)

Comments

Rob Herring Oct. 5, 2024, 6:26 p.m. UTC | #1
On Fri, Oct 04, 2024 at 02:07:39PM +0200, Catalin Popescu wrote:
> Add compatible value "mmc-pwrseq-simple-reset" to support reset control
> instead of gpios. Reset controls being refcounted, they allow to use
> shared resets or gpios across drivers. Support of reset control is
> limited to one single reset control.

Can't you do this without a binding change? Just use reset controls when 
there is only 1 GPIO.

> 
> Signed-off-by: Catalin Popescu <catalin.popescu@leica-geosystems.com>
> ---
>  .../bindings/mmc/mmc-pwrseq-simple.yaml       | 21 +++++++++++++++++--
>  1 file changed, 19 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/mmc/mmc-pwrseq-simple.yaml b/Documentation/devicetree/bindings/mmc/mmc-pwrseq-simple.yaml
index 00feaafc1063..da218260af01 100644
--- a/Documentation/devicetree/bindings/mmc/mmc-pwrseq-simple.yaml
+++ b/Documentation/devicetree/bindings/mmc/mmc-pwrseq-simple.yaml
@@ -16,12 +16,13 @@  description:
 
 properties:
   compatible:
-    const: mmc-pwrseq-simple
+    enum:
+      - mmc-pwrseq-simple
+      - mmc-pwrseq-simple-reset
 
   reset-gpios:
     minItems: 1
     # Put some limit to avoid false warnings
-    maxItems: 32
     description:
       contains a list of GPIO specifiers. The reset GPIOs are asserted
       at initialization and prior we start the power up procedure of the card.
@@ -50,6 +51,22 @@  properties:
 required:
   - compatible
 
+allOf:
+  - if:
+      properties:
+        compatible:
+          contains:
+            enum:
+              - mmc-pwrseq-simple-reset
+    then:
+      properties:
+        reset-gpios:
+          maxItems: 1
+    else:
+      properties:
+        reset-gpios:
+          maxItems: 32
+
 additionalProperties: false
 
 examples: