linux-watchdog.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3] dt-bindings: mfd: twl: Convert trivial subdevices to json-schema
@ 2024-04-01  8:18 Andreas Kemnade
  2024-04-01 15:17 ` Rob Herring
  2024-04-11 11:39 ` (subset) " Lee Jones
  0 siblings, 2 replies; 3+ messages in thread
From: Andreas Kemnade @ 2024-04-01  8:18 UTC (permalink / raw)
  To: dmitry.torokhov, robh, krzysztof.kozlowski+dt, conor+dt, lee,
	alexandre.belloni, wim, linux, andreas, linux-input, devicetree,
	linux-kernel, linux-rtc, linux-watchdog, sre

Convert subdevices with just an interrupt and compatbile to
json-schema and wire up already converted subdevices.
RTC is available in all variants, so allow it unconditionally.
GPADC binding for TWL603X uses two different compatibles, so
specify just the compatible and do not include it.

Signed-off-by: Andreas Kemnade <andreas@kemnade.info>
Acked-by: Guenter Roeck <linux@roeck-us.net>
---
Changes in v3:
- added Ack
  (apparantly many recipients did not receive the V2 patch,
   so there is a need for a resend)

Changes in v2:
- style cleanup
- absolute paths
- unevalutedProperties instead of additionalProperties
  due to not accepting things in if: clauses without it

 .../bindings/input/twl4030-pwrbutton.txt      | 21 ------
 .../devicetree/bindings/mfd/ti,twl.yaml       | 72 ++++++++++++++++++-
 .../devicetree/bindings/rtc/twl-rtc.txt       | 11 ---
 .../bindings/watchdog/twl4030-wdt.txt         | 10 ---
 4 files changed, 71 insertions(+), 43 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/input/twl4030-pwrbutton.txt
 delete mode 100644 Documentation/devicetree/bindings/rtc/twl-rtc.txt
 delete mode 100644 Documentation/devicetree/bindings/watchdog/twl4030-wdt.txt

diff --git a/Documentation/devicetree/bindings/input/twl4030-pwrbutton.txt b/Documentation/devicetree/bindings/input/twl4030-pwrbutton.txt
deleted file mode 100644
index 6c201a2ba8acf..0000000000000
--- a/Documentation/devicetree/bindings/input/twl4030-pwrbutton.txt
+++ /dev/null
@@ -1,21 +0,0 @@
-Texas Instruments TWL family (twl4030) pwrbutton module
-
-This module is part of the TWL4030. For more details about the whole
-chip see Documentation/devicetree/bindings/mfd/ti,twl.yaml.
-
-This module provides a simple power button event via an Interrupt.
-
-Required properties:
-- compatible: should be one of the following
-   - "ti,twl4030-pwrbutton": For controllers compatible with twl4030
-- interrupts: should be one of the following
-   - <8>: For controllers compatible with twl4030
-
-Example:
-
-&twl {
-	twl_pwrbutton: pwrbutton {
-		compatible = "ti,twl4030-pwrbutton";
-		interrupts = <8>;
-	};
-};
diff --git a/Documentation/devicetree/bindings/mfd/ti,twl.yaml b/Documentation/devicetree/bindings/mfd/ti,twl.yaml
index 52ed228fb1e7e..c2357fecb56cc 100644
--- a/Documentation/devicetree/bindings/mfd/ti,twl.yaml
+++ b/Documentation/devicetree/bindings/mfd/ti,twl.yaml
@@ -15,6 +15,67 @@ description: |
   USB transceiver or Audio amplifier.
   These chips are connected to an i2c bus.
 
+allOf:
+  - if:
+      properties:
+        compatible:
+          contains:
+            const: ti,twl4030
+    then:
+      properties:
+        madc:
+          type: object
+          $ref: /schemas/iio/adc/ti,twl4030-madc.yaml
+          unevaluatedProperties: false
+
+        bci:
+          type: object
+          $ref: /schemas/power/supply/twl4030-charger.yaml
+          unevaluatedProperties: false
+
+        pwrbutton:
+          type: object
+          additionalProperties: false
+          properties:
+            compatible:
+              const: ti,twl4030-pwrbutton
+            interrupts:
+              items:
+                - items:
+                    const: 8
+
+        watchdog:
+          type: object
+          additionalProperties: false
+          properties:
+            compatible:
+              const: ti,twl4030-wdt
+
+  - if:
+      properties:
+        compatible:
+          contains:
+            const: ti,twl6030
+    then:
+      properties:
+        gpadc:
+          type: object
+          properties:
+            compatible:
+              const: ti,twl6030-gpadc
+  - if:
+      properties:
+        compatible:
+          contains:
+            const: ti,twl6032
+    then:
+      properties:
+        gpadc:
+          type: object
+          properties:
+            compatible:
+              const: ti,twl6032-gpadc
+
 properties:
   compatible:
     description:
@@ -42,7 +103,16 @@ properties:
   "#clock-cells":
     const: 1
 
-additionalProperties: false
+  rtc:
+    type: object
+    additionalProperties: false
+    properties:
+      compatible:
+        const: ti,twl4030-rtc
+      interrupts:
+        maxItems: 1
+
+unevaluatedProperties: false
 
 required:
   - compatible
diff --git a/Documentation/devicetree/bindings/rtc/twl-rtc.txt b/Documentation/devicetree/bindings/rtc/twl-rtc.txt
deleted file mode 100644
index 8f9a94f2f8969..0000000000000
--- a/Documentation/devicetree/bindings/rtc/twl-rtc.txt
+++ /dev/null
@@ -1,11 +0,0 @@
-* Texas Instruments TWL4030/6030 RTC
-
-Required properties:
-- compatible : Should be "ti,twl4030-rtc"
-- interrupts : Should be the interrupt number.
-
-Example:
-	rtc {
-		compatible = "ti,twl4030-rtc";
-		interrupts = <11>;
-	};
diff --git a/Documentation/devicetree/bindings/watchdog/twl4030-wdt.txt b/Documentation/devicetree/bindings/watchdog/twl4030-wdt.txt
deleted file mode 100644
index 80a37193c0b86..0000000000000
--- a/Documentation/devicetree/bindings/watchdog/twl4030-wdt.txt
+++ /dev/null
@@ -1,10 +0,0 @@
-Device tree bindings for twl4030-wdt driver (TWL4030 watchdog)
-
-Required properties:
-	compatible = "ti,twl4030-wdt";
-
-Example:
-
-watchdog {
-	compatible = "ti,twl4030-wdt";
-};
-- 
2.39.2


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

* Re: [PATCH v3] dt-bindings: mfd: twl: Convert trivial subdevices to json-schema
  2024-04-01  8:18 [PATCH v3] dt-bindings: mfd: twl: Convert trivial subdevices to json-schema Andreas Kemnade
@ 2024-04-01 15:17 ` Rob Herring
  2024-04-11 11:39 ` (subset) " Lee Jones
  1 sibling, 0 replies; 3+ messages in thread
From: Rob Herring @ 2024-04-01 15:17 UTC (permalink / raw)
  To: Andreas Kemnade
  Cc: krzysztof.kozlowski+dt, linux, devicetree, wim, linux-input,
	dmitry.torokhov, linux-rtc, lee, conor+dt, linux-watchdog, sre,
	linux-kernel, alexandre.belloni


On Mon, 01 Apr 2024 10:18:31 +0200, Andreas Kemnade wrote:
> Convert subdevices with just an interrupt and compatbile to
> json-schema and wire up already converted subdevices.
> RTC is available in all variants, so allow it unconditionally.
> GPADC binding for TWL603X uses two different compatibles, so
> specify just the compatible and do not include it.
> 
> Signed-off-by: Andreas Kemnade <andreas@kemnade.info>
> Acked-by: Guenter Roeck <linux@roeck-us.net>
> ---
> Changes in v3:
> - added Ack
>   (apparantly many recipients did not receive the V2 patch,
>    so there is a need for a resend)
> 
> Changes in v2:
> - style cleanup
> - absolute paths
> - unevalutedProperties instead of additionalProperties
>   due to not accepting things in if: clauses without it
> 
>  .../bindings/input/twl4030-pwrbutton.txt      | 21 ------
>  .../devicetree/bindings/mfd/ti,twl.yaml       | 72 ++++++++++++++++++-
>  .../devicetree/bindings/rtc/twl-rtc.txt       | 11 ---
>  .../bindings/watchdog/twl4030-wdt.txt         | 10 ---
>  4 files changed, 71 insertions(+), 43 deletions(-)
>  delete mode 100644 Documentation/devicetree/bindings/input/twl4030-pwrbutton.txt
>  delete mode 100644 Documentation/devicetree/bindings/rtc/twl-rtc.txt
>  delete mode 100644 Documentation/devicetree/bindings/watchdog/twl4030-wdt.txt
> 

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


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

* Re: (subset) [PATCH v3] dt-bindings: mfd: twl: Convert trivial subdevices to json-schema
  2024-04-01  8:18 [PATCH v3] dt-bindings: mfd: twl: Convert trivial subdevices to json-schema Andreas Kemnade
  2024-04-01 15:17 ` Rob Herring
@ 2024-04-11 11:39 ` Lee Jones
  1 sibling, 0 replies; 3+ messages in thread
From: Lee Jones @ 2024-04-11 11:39 UTC (permalink / raw)
  To: dmitry.torokhov, robh, krzysztof.kozlowski+dt, conor+dt, lee,
	alexandre.belloni, wim, linux, linux-input, devicetree,
	linux-kernel, linux-rtc, linux-watchdog, sre, Andreas Kemnade

On Mon, 01 Apr 2024 10:18:31 +0200, Andreas Kemnade wrote:
> Convert subdevices with just an interrupt and compatbile to
> json-schema and wire up already converted subdevices.
> RTC is available in all variants, so allow it unconditionally.
> GPADC binding for TWL603X uses two different compatibles, so
> specify just the compatible and do not include it.
> 
> 
> [...]

Applied, thanks!

[1/1] dt-bindings: mfd: twl: Convert trivial subdevices to json-schema
      commit: f9463e7b73bbd3b6dee77c0387e2ebc9e61fe0e4

--
Lee Jones [李琼斯]


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

end of thread, other threads:[~2024-04-11 11:39 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-04-01  8:18 [PATCH v3] dt-bindings: mfd: twl: Convert trivial subdevices to json-schema Andreas Kemnade
2024-04-01 15:17 ` Rob Herring
2024-04-11 11:39 ` (subset) " Lee Jones

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