[PATCH v2 1/3] dt-bindings: mfd: twl: enable power button also for twl603x

akemnade@kernel.org posted 3 patches 3 months, 1 week ago
There is a newer version of this series
[PATCH v2 1/3] dt-bindings: mfd: twl: enable power button also for twl603x
Posted by akemnade@kernel.org 3 months, 1 week ago
From: Andreas Kemnade <andreas@kemnade.info>

TWL603x has also a power button function, so add the corresponding subnode.
As not in all cases there is a power button connected to the corresponding
pad of the TWL603x, the functionality can be disabled by
status = "disabled" or simply not adding the subnode.
To keep things simple, follow the established design pattern of using const
interrupts as used also by the other subdevices.

Signed-off-by: Andreas Kemnade <andreas@kemnade.info>
---
 Documentation/devicetree/bindings/mfd/ti,twl.yaml | 40 ++++++++++++++++++-----
 1 file changed, 32 insertions(+), 8 deletions(-)

diff --git a/Documentation/devicetree/bindings/mfd/ti,twl.yaml b/Documentation/devicetree/bindings/mfd/ti,twl.yaml
index 776b04e182cb..3527fee32cb0 100644
--- a/Documentation/devicetree/bindings/mfd/ti,twl.yaml
+++ b/Documentation/devicetree/bindings/mfd/ti,twl.yaml
@@ -55,6 +55,15 @@ allOf:
 
         gpadc: false
 
+        pwrbutton:
+          properties:
+            compatible:
+              const: ti,twl4030-pwrbutton
+            interrupts:
+              items:
+                - items:
+                    const: 8
+
         usb-comparator: false
 
   - if:
@@ -95,7 +104,14 @@ allOf:
             compatible:
               const: ti,twl6030-gpadc
 
-        pwrbutton: false
+        pwrbutton:
+          properties:
+            compatible:
+              const: ti,twl6030-pwrbutton
+            interrupts:
+              items:
+                - items:
+                    const: 0
 
         madc: false
 
@@ -146,7 +162,14 @@ allOf:
             compatible:
               const: ti,twl6032-gpadc
 
-        pwrbutton: false
+        pwrbutton:
+          properties:
+            compatible:
+              const: ti,twl6030-pwrbutton
+            interrupts:
+              items:
+                - items:
+                    const: 0
 
         madc: false
 
@@ -225,12 +248,8 @@ properties:
     additionalProperties: false
 
     properties:
-      compatible:
-        const: ti,twl4030-pwrbutton
-      interrupts:
-        items:
-          - items:
-              const: 8
+      compatible: true
+      interrupts: true
 
   watchdog:
     type: object
@@ -459,6 +478,11 @@ examples:
           #io-channel-cells = <1>;
         };
 
+        pwrbutton {
+          compatible = "ti,twl6030-pwrbutton";
+          interrupts = <0>;
+        };
+
         rtc {
           compatible = "ti,twl4030-rtc";
           interrupts = <8>;

-- 
2.47.3
Re: [PATCH v2 1/3] dt-bindings: mfd: twl: enable power button also for twl603x
Posted by Conor Dooley 3 months, 1 week ago
On Thu, Oct 30, 2025 at 08:10:34PM +0100, akemnade@kernel.org wrote:
> From: Andreas Kemnade <andreas@kemnade.info>
> 
> TWL603x has also a power button function, so add the corresponding subnode.
> As not in all cases there is a power button connected to the corresponding
> pad of the TWL603x, the functionality can be disabled by
> status = "disabled" or simply not adding the subnode.
> To keep things simple, follow the established design pattern of using const
> interrupts as used also by the other subdevices.
> 
> Signed-off-by: Andreas Kemnade <andreas@kemnade.info>

> @@ -225,12 +248,8 @@ properties:
>      additionalProperties: false
>  
>      properties:
> -      compatible:
> -        const: ti,twl4030-pwrbutton
> -      interrupts:
> -        items:
> -          - items:
> -              const: 8
> +      compatible: true
> +      interrupts: true

I think this should be
    properties:
      compatible:
        enum:
          - ti,twl4030-pwrbutton
          - ti,twl6030-pwrbutton
      interrupts:
        maxItems: 1
since we want to keep the widest constraints that apply at the outer
level, rather than removing the constraints entirely.

pw-bot: changes-requested

Cheers,
Conor.

>  
>    watchdog:
>      type: object
> @@ -459,6 +478,11 @@ examples:
>            #io-channel-cells = <1>;
>          };
>  
> +        pwrbutton {
> +          compatible = "ti,twl6030-pwrbutton";
> +          interrupts = <0>;
> +        };
> +
>          rtc {
>            compatible = "ti,twl4030-rtc";
>            interrupts = <8>;
> 
> -- 
> 2.47.3
>