linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] dt-bindings: rtc: pcf2123: convert to YAML
@ 2023-09-14  9:07 Javier Carrasco
  2023-10-15 21:16 ` Alexandre Belloni
  0 siblings, 1 reply; 2+ messages in thread
From: Javier Carrasco @ 2023-09-14  9:07 UTC (permalink / raw)
  To: Alessandro Zummo, Alexandre Belloni, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley
  Cc: linux-rtc, devicetree, linux-kernel, Javier Carrasco,
	Krzysztof Kozlowski

Convert the existing txt binding to the preferred YAML format.

The pcf2123 node may contain SPI settings such as spi-cs-high and
spi-max-frequency, which keeps it from being added to the trivial-rtc
binding with its current definition. Add a reference to
spi-peripheral-props.yaml to account for that.

The "interrupts" property was missing in the binding although it is
already supported. Add the missing property in the new binding.

Signed-off-by: Javier Carrasco <javier.carrasco.cruz@gmail.com>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
---
Changes in v2:
- Added interrupt to the example
- Changed maintainer to Javier Carrasco (maintainer from v1 no longer
  reachable)
- Link to v1: https://lore.kernel.org/r/20230907-topic-pcf2123_yaml-v1-1-40e82bed2066@gmail.com
---
 .../devicetree/bindings/rtc/nxp,pcf2123.yaml       | 47 ++++++++++++++++++++++
 .../devicetree/bindings/rtc/nxp,rtc-2123.txt       | 17 --------
 2 files changed, 47 insertions(+), 17 deletions(-)

diff --git a/Documentation/devicetree/bindings/rtc/nxp,pcf2123.yaml b/Documentation/devicetree/bindings/rtc/nxp,pcf2123.yaml
new file mode 100644
index 000000000000..96e377a4d1bc
--- /dev/null
+++ b/Documentation/devicetree/bindings/rtc/nxp,pcf2123.yaml
@@ -0,0 +1,47 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/rtc/nxp,pcf2123.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: NXP PCF2123 SPI Real Time Clock
+
+maintainers:
+  - Javier Carrasco <javier.carrasco.cruz@gmail.com>
+
+allOf:
+  - $ref: /schemas/spi/spi-peripheral-props.yaml#
+  - $ref: rtc.yaml#
+
+properties:
+  compatible:
+    enum:
+      - nxp,pcf2123
+
+  reg:
+    maxItems: 1
+
+  interrupts:
+    maxItems: 1
+
+required:
+  - compatible
+  - reg
+
+unevaluatedProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/interrupt-controller/arm-gic.h>
+    spi {
+        #address-cells = <1>;
+        #size-cells = <0>;
+
+        rtc@3 {
+            compatible = "nxp,pcf2123";
+            reg = <3>;
+            interrupts = <GIC_SPI 130 IRQ_TYPE_LEVEL_LOW>;
+            spi-cs-high;
+        };
+    };
+...
diff --git a/Documentation/devicetree/bindings/rtc/nxp,rtc-2123.txt b/Documentation/devicetree/bindings/rtc/nxp,rtc-2123.txt
deleted file mode 100644
index 7371f525a687..000000000000
--- a/Documentation/devicetree/bindings/rtc/nxp,rtc-2123.txt
+++ /dev/null
@@ -1,17 +0,0 @@
-NXP PCF2123 SPI Real Time Clock
-
-Required properties:
-- compatible: should be: "nxp,pcf2123"
-                      or "microcrystal,rv2123"
-- reg: should be the SPI slave chipselect address
-
-Optional properties:
-- spi-cs-high: PCF2123 needs chipselect high
-
-Example:
-
-pcf2123: rtc@3 {
-	compatible = "nxp,pcf2123"
-	reg = <3>
-	spi-cs-high;
-};

---
base-commit: 0bb80ecc33a8fb5a682236443c1e740d5c917d1d
change-id: 20230907-topic-pcf2123_yaml-2ce57f4e77d7

Best regards,
-- 
Javier Carrasco <javier.carrasco.cruz@gmail.com>


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

* Re: [PATCH v2] dt-bindings: rtc: pcf2123: convert to YAML
  2023-09-14  9:07 [PATCH v2] dt-bindings: rtc: pcf2123: convert to YAML Javier Carrasco
@ 2023-10-15 21:16 ` Alexandre Belloni
  0 siblings, 0 replies; 2+ messages in thread
From: Alexandre Belloni @ 2023-10-15 21:16 UTC (permalink / raw)
  To: Alessandro Zummo, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Javier Carrasco
  Cc: linux-rtc, devicetree, linux-kernel, Krzysztof Kozlowski


On Thu, 14 Sep 2023 11:07:59 +0200, Javier Carrasco wrote:
> Convert the existing txt binding to the preferred YAML format.
> 
> The pcf2123 node may contain SPI settings such as spi-cs-high and
> spi-max-frequency, which keeps it from being added to the trivial-rtc
> binding with its current definition. Add a reference to
> spi-peripheral-props.yaml to account for that.
> 
> [...]

Applied, thanks!

[1/1] dt-bindings: rtc: pcf2123: convert to YAML
      commit: fdaf4c5acf268bfcc455d8c2ab775cd54317c788

Best regards,

-- 
Alexandre Belloni, co-owner and COO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

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

end of thread, other threads:[~2023-10-15 21:16 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-09-14  9:07 [PATCH v2] dt-bindings: rtc: pcf2123: convert to YAML Javier Carrasco
2023-10-15 21:16 ` Alexandre Belloni

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