Devicetree
 help / color / mirror / Atom feed
* [PATCH v4] dt-bindings: rtc: epson,rx6110: Convert to DT Schema
@ 2026-05-09 18:56 Udaya Kiran Challa
  2026-05-14 15:05 ` Rob Herring
  0 siblings, 1 reply; 2+ messages in thread
From: Udaya Kiran Challa @ 2026-05-09 18:56 UTC (permalink / raw)
  To: alexandre.belloni, robh, krzk+dt, conor+dt
  Cc: skhan, me, linux-rtc, devicetree, linux-kernel,
	Udaya Kiran Challa

Convert the Epson RX6110 Real Time Clock devicetree binding
from the legacy text format to DT schema.

Signed-off-by: Udaya Kiran Challa <challauday369@gmail.com>
---
Changelog:
Changes since v3:
- Add conditional validation for SPI mode properties using anyOf

Link to v3:https://lore.kernel.org/all/20260509181909.21871-1-challauday369@gmail.com/

Changes since v2:
- Reference rtc.yaml for common RTC properties
- Add conditional validation for SPI mode properties

Link to v2:https://lore.kernel.org/all/20260509095713.5818-1-challauday369@gmail.com/

Changes since v1:
- Reuse common SPI peripheral properties
- Drop redundant SPI-specific comment
- Remove unused labels from examples

Link to v1:https://lore.kernel.org/all/20260504183728.27412-1-challauday369@gmail.com/
---
 .../devicetree/bindings/rtc/epson,rx6110.txt  | 39 ---------
 .../devicetree/bindings/rtc/epson,rx6110.yaml | 79 +++++++++++++++++++
 2 files changed, 79 insertions(+), 39 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/rtc/epson,rx6110.txt
 create mode 100644 Documentation/devicetree/bindings/rtc/epson,rx6110.yaml

diff --git a/Documentation/devicetree/bindings/rtc/epson,rx6110.txt b/Documentation/devicetree/bindings/rtc/epson,rx6110.txt
deleted file mode 100644
index 3dc313e01f77..000000000000
--- a/Documentation/devicetree/bindings/rtc/epson,rx6110.txt
+++ /dev/null
@@ -1,39 +0,0 @@
-Epson RX6110 Real Time Clock
-============================
-
-The Epson RX6110 can be used with SPI or I2C busses. The kind of
-bus depends on the SPISEL pin and can not be configured via software.
-
-I2C mode
---------
-
-Required properties:
-  - compatible: should be: "epson,rx6110"
-  - reg : the I2C address of the device for I2C
-
-Example:
-
-	rtc: rtc@32 {
-		compatible = "epson,rx6110"
-		reg = <0x32>;
-	};
-
-SPI mode
---------
-
-Required properties:
-  - compatible: should be: "epson,rx6110"
-  - reg: chip select number
-  - spi-cs-high: RX6110 needs chipselect high
-  - spi-cpha: RX6110 works with SPI shifted clock phase
-  - spi-cpol: RX6110 works with SPI inverse clock polarity
-
-Example:
-
-	rtc: rtc@3 {
-		compatible = "epson,rx6110"
-		reg = <3>
-		spi-cs-high;
-		spi-cpha;
-		spi-cpol;
-	};
diff --git a/Documentation/devicetree/bindings/rtc/epson,rx6110.yaml b/Documentation/devicetree/bindings/rtc/epson,rx6110.yaml
new file mode 100644
index 000000000000..3466f74736d2
--- /dev/null
+++ b/Documentation/devicetree/bindings/rtc/epson,rx6110.yaml
@@ -0,0 +1,79 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/rtc/epson,rx6110.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Epson RX6110 Real Time Clock
+
+description: |
+  The Epson RX6110 can be used with SPI or I2C busses.
+  The kind of bus depends on the SPISEL pin and can not be
+  configured via software.
+
+maintainers:
+  - Alexandre Belloni <alexandre.belloni@bootlin.com>
+
+allOf:
+  - $ref: rtc.yaml#
+  - $ref: /schemas/spi/spi-peripheral-props.yaml#
+
+properties:
+  compatible:
+    const: epson,rx6110
+
+  reg:
+    maxItems: 1
+
+  spi-cs-high: true
+  spi-cpha: true
+  spi-cpol: true
+
+required:
+  - compatible
+  - reg
+
+if:
+  anyOf:
+    - required:
+        - spi-cs-high
+    - required:
+        - spi-cpha
+    - required:
+        - spi-cpol
+
+then:
+  required:
+    - spi-cs-high
+    - spi-cpha
+    - spi-cpol
+
+unevaluatedProperties: false
+
+examples:
+  # I2C mode
+  - |
+    i2c {
+      #address-cells = <1>;
+      #size-cells = <0>;
+
+      rtc@32 {
+        compatible = "epson,rx6110";
+        reg = <0x32>;
+      };
+    };
+
+  # SPI mode
+  - |
+    spi {
+      #address-cells = <1>;
+      #size-cells = <0>;
+
+      rtc@3 {
+        compatible = "epson,rx6110";
+        reg = <3>;
+        spi-cs-high;
+        spi-cpha;
+        spi-cpol;
+      };
+    };
-- 
2.43.0


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

* Re: [PATCH v4] dt-bindings: rtc: epson,rx6110: Convert to DT Schema
  2026-05-09 18:56 [PATCH v4] dt-bindings: rtc: epson,rx6110: Convert to DT Schema Udaya Kiran Challa
@ 2026-05-14 15:05 ` Rob Herring
  0 siblings, 0 replies; 2+ messages in thread
From: Rob Herring @ 2026-05-14 15:05 UTC (permalink / raw)
  To: Udaya Kiran Challa
  Cc: alexandre.belloni, krzk+dt, conor+dt, skhan, me, linux-rtc,
	devicetree, linux-kernel

On Sun, May 10, 2026 at 12:26:39AM +0530, Udaya Kiran Challa wrote:
> Convert the Epson RX6110 Real Time Clock devicetree binding
> from the legacy text format to DT schema.
> 
> Signed-off-by: Udaya Kiran Challa <challauday369@gmail.com>
> ---
> Changelog:
> Changes since v3:
> - Add conditional validation for SPI mode properties using anyOf
> 
> Link to v3:https://lore.kernel.org/all/20260509181909.21871-1-challauday369@gmail.com/
> 
> Changes since v2:
> - Reference rtc.yaml for common RTC properties
> - Add conditional validation for SPI mode properties
> 
> Link to v2:https://lore.kernel.org/all/20260509095713.5818-1-challauday369@gmail.com/
> 
> Changes since v1:
> - Reuse common SPI peripheral properties
> - Drop redundant SPI-specific comment
> - Remove unused labels from examples
> 
> Link to v1:https://lore.kernel.org/all/20260504183728.27412-1-challauday369@gmail.com/
> ---
>  .../devicetree/bindings/rtc/epson,rx6110.txt  | 39 ---------
>  .../devicetree/bindings/rtc/epson,rx6110.yaml | 79 +++++++++++++++++++
>  2 files changed, 79 insertions(+), 39 deletions(-)
>  delete mode 100644 Documentation/devicetree/bindings/rtc/epson,rx6110.txt
>  create mode 100644 Documentation/devicetree/bindings/rtc/epson,rx6110.yaml
> 
> diff --git a/Documentation/devicetree/bindings/rtc/epson,rx6110.txt b/Documentation/devicetree/bindings/rtc/epson,rx6110.txt
> deleted file mode 100644
> index 3dc313e01f77..000000000000
> --- a/Documentation/devicetree/bindings/rtc/epson,rx6110.txt
> +++ /dev/null
> @@ -1,39 +0,0 @@
> -Epson RX6110 Real Time Clock
> -============================
> -
> -The Epson RX6110 can be used with SPI or I2C busses. The kind of
> -bus depends on the SPISEL pin and can not be configured via software.
> -
> -I2C mode
> ---------
> -
> -Required properties:
> -  - compatible: should be: "epson,rx6110"
> -  - reg : the I2C address of the device for I2C
> -
> -Example:
> -
> -	rtc: rtc@32 {
> -		compatible = "epson,rx6110"
> -		reg = <0x32>;
> -	};
> -
> -SPI mode
> ---------
> -
> -Required properties:
> -  - compatible: should be: "epson,rx6110"
> -  - reg: chip select number
> -  - spi-cs-high: RX6110 needs chipselect high
> -  - spi-cpha: RX6110 works with SPI shifted clock phase
> -  - spi-cpol: RX6110 works with SPI inverse clock polarity
> -
> -Example:
> -
> -	rtc: rtc@3 {
> -		compatible = "epson,rx6110"
> -		reg = <3>
> -		spi-cs-high;
> -		spi-cpha;
> -		spi-cpol;
> -	};
> diff --git a/Documentation/devicetree/bindings/rtc/epson,rx6110.yaml b/Documentation/devicetree/bindings/rtc/epson,rx6110.yaml
> new file mode 100644
> index 000000000000..3466f74736d2
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/rtc/epson,rx6110.yaml
> @@ -0,0 +1,79 @@
> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/rtc/epson,rx6110.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Epson RX6110 Real Time Clock
> +
> +description: |

Don't need '|' if no formatting.

> +  The Epson RX6110 can be used with SPI or I2C busses.
> +  The kind of bus depends on the SPISEL pin and can not be
> +  configured via software.

Wrap lines at 80 chars.

> +
> +maintainers:
> +  - Alexandre Belloni <alexandre.belloni@bootlin.com>
> +
> +allOf:
> +  - $ref: rtc.yaml#
> +  - $ref: /schemas/spi/spi-peripheral-props.yaml#
> +
> +properties:
> +  compatible:
> +    const: epson,rx6110
> +
> +  reg:
> +    maxItems: 1
> +
> +  spi-cs-high: true
> +  spi-cpha: true
> +  spi-cpol: true
> +
> +required:
> +  - compatible
> +  - reg
> +
> +if:
> +  anyOf:
> +    - required:
> +        - spi-cs-high
> +    - required:
> +        - spi-cpha
> +    - required:
> +        - spi-cpol
> +
> +then:
> +  required:
> +    - spi-cs-high
> +    - spi-cpha
> +    - spi-cpol

This 'if' can be better expressed as:

dependencies:
  spi-cs-high: [ spi-cpha, spi-cpol ]
  spi-cpha: [ spi-cs-high, spi-cpol ]
  spi-cpol: [ spi-cs-high, spi-cpha ]


> +
> +unevaluatedProperties: false
> +
> +examples:
> +  # I2C mode
> +  - |
> +    i2c {
> +      #address-cells = <1>;
> +      #size-cells = <0>;
> +
> +      rtc@32 {
> +        compatible = "epson,rx6110";
> +        reg = <0x32>;
> +      };
> +    };
> +
> +  # SPI mode
> +  - |
> +    spi {
> +      #address-cells = <1>;
> +      #size-cells = <0>;
> +
> +      rtc@3 {
> +        compatible = "epson,rx6110";
> +        reg = <3>;
> +        spi-cs-high;
> +        spi-cpha;
> +        spi-cpol;
> +      };
> +    };
> -- 
> 2.43.0
> 
> 

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

end of thread, other threads:[~2026-05-14 15:05 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-09 18:56 [PATCH v4] dt-bindings: rtc: epson,rx6110: Convert to DT Schema Udaya Kiran Challa
2026-05-14 15:05 ` Rob Herring

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