Skip to contentSkip to conversation

dt-bindings: rtc-2127: Add bindings for nxp,rtc-2127.txt

PATCH Superseded Qiang Zhao 4 participants 12 messages Aug 27, 2020 – Sep 18, 2020

Subsystems (3)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Qiang Zhao

author
#0 lore raw

PATCH 1/3 dt-bindings: rtc-2127: Add bindings for nxp,rtc-2127.txt

From: Zhao Qiang <[email protected]>

Add bindings for nxp,rtc-2127

---
 Documentation/devicetree/bindings/rtc/nxp,rtc-2127.txt | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/rtc/nxp,rtc-2127.txt
Documentation/devicetree/bindings/rtc/nxp,rtc-2127.txt new file +18 -0
new file mode 100644
index 0000000..c822e10
@@ -0,0 +1,18 @@
+NXP PCF2127 SPI Real Time Clock
+
+Required properties:
+- compatible: should be: "nxp,pcf2127"
+                      or "nxp,pcf2129"
+- reg: should be the SPI slave chipselect address
+
+Optional properties:
+- no-watchdog: PCF2127 is not used as watchdog
+
+Example:
+
+pcf2127: rtc@51 {
+	compatible = "nxp,pcf2127";
+	reg = <0x51>;
+	interrupts = <0 150 0x4>;
+	no-watchdog;
+};
Signature · 1 line
2.7.4
author
#1 lore raw

PATCH 2/3 rtc: pcf2127: add "no-watchdog" property

From: Zhao Qiang <[email protected]>

Commit 0e735eaae165 ("rtc: pcf2127: add watchdog feature support") adds watchdog feature for pcf2127, then it will be registered as a watchdog device even though it is not used as watchdog. Pcf2127 always be registered as watchdog0(default watchdog device), even though it is not used as watchdog, meanwhile there is another real watchdog device registered as watchdog1.
So add "no-watchdog" property, if the node has this property, driver will not register it as a watchdog device

---
 drivers/rtc/rtc-pcf2127.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
drivers/rtc/rtc-pcf2127.c +5 -3
index 02b069c..38d30e2 100644
@@ -476,9 +476,11 @@ static int pcf2127_probe(struct device *dev, struct regmap *regmap,
 	}
 
 #ifdef CONFIG_WATCHDOG
-	ret = devm_watchdog_register_device(dev, &pcf2127->wdd);
-	if (ret)
-		return ret;
+	if (!of_property_read_bool(dev->of_node, "no-watchdog")) {
+		ret = devm_watchdog_register_device(dev, &pcf2127->wdd);
+		if (ret)
+			return ret;
+	}
 #endif /* CONFIG_WATCHDOG */
 
 	/*
Signature · 1 line
2.7.4
author
#2 lore raw

PATCH 3/3 arm64: dts: lx2160a: Add "no-watchdog" property to pcf2127

In reply to Qiang Zhao

From: Zhao Qiang <[email protected]>

pcf2127 on lx2160a are not used as watchdog.

---
 arch/arm64/boot/dts/freescale/fsl-lx2160a-rdb.dts | 1 +
 1 file changed, 1 insertion(+)
arch/arm64/boot/dts/freescale/fsl-lx2160a-rdb.dts +1 -0
index 2ec43c6..4d14c91 100644
@@ -149,6 +149,7 @@
 		reg = <0x51>;
 		// IRQ10_B
 		interrupts = <0 150 0x4>;
+		no-watchdog;
 	};
 };
 
Signature · 1 line
2.7.4
author
#4 lore raw
Quoted 18 lines · Rob Herring

-----Original Message-----
From: Rob Herring <[email protected]>
Sent: 2020年9月10日 4:25
To: Qiang Zhao <[email protected]>
Cc: [email protected]; [email protected]; [email protected]; [email protected]; [email protected]
Subject: Re: [PATCH 1/3] dt-bindings: rtc-2127: Add bindings for nxp,rtc-2127.txt

Quoted 7 lines · Qiang Zhao

From: Zhao Qiang <[email protected]>

Add bindings for nxp,rtc-2127

---
 Documentation/devicetree/bindings/rtc/nxp,rtc-2127.txt | 18
Quoted 6 lines

++++++++++++++++++

Quoted 2 lines
 1 file changed, 18 insertions(+)
 create mode 100644

Documentation/devicetree/bindings/rtc/nxp,rtc-2127.txt

Bindings should be in DT schema format now.

Is there any doc description for DT schema format or example So that I can take as a reference. Thank you!

Best Regards
Qiang Zhao

maintainer
#5 lore raw
Quoted 21 lines · Qiang Zhao
Quoted 19 lines · Rob Herring

-----Original Message-----
From: Rob Herring <[email protected]>
Sent: 2020年9月10日 4:25
To: Qiang Zhao <[email protected]>
Cc: [email protected]; [email protected]; [email protected]; [email protected]; [email protected]
Subject: Re: [PATCH 1/3] dt-bindings: rtc-2127: Add bindings for nxp,rtc-2127.txt

Quoted 7 lines · Qiang Zhao

From: Zhao Qiang <[email protected]>

Add bindings for nxp,rtc-2127

---
 Documentation/devicetree/bindings/rtc/nxp,rtc-2127.txt | 18

++++++++++++++++++

Quoted 8 lines
Quoted 5 lines
Quoted 2 lines
 1 file changed, 18 insertions(+)
 create mode 100644

Documentation/devicetree/bindings/rtc/nxp,rtc-2127.txt

Bindings should be in DT schema format now.

Is there any doc description for DT schema format or example So that I can take as a reference. Thank you!

Documentation/devicetree/writing-schema.rst and about 1000 examples in the kernel tree.

Rob

author
#6 lore raw
Quoted 10 lines · Rob Herring

-----Original Message-----
From: Rob Herring <[email protected]>
Sent: 2020年9月11日 22:03
To: Qiang Zhao <[email protected]>
Cc: [email protected]; [email protected]; [email protected]; [email protected]; [email protected]
Subject: Re: [PATCH 1/3] dt-bindings: rtc-2127: Add bindings for nxp,rtc-2127.txt

Quoted 16 lines
Quoted 15 lines · Qiang Zhao
Quoted 13 lines · Rob Herring

-----Original Message-----
From: Rob Herring <[email protected]>
Sent: 2020年9月10日 4:25
To: Qiang Zhao <[email protected]>
Cc: [email protected]; [email protected]; [email protected]; [email protected]; [email protected]
Subject: Re: [PATCH 1/3] dt-bindings: rtc-2127: Add bindings for nxp,rtc-2127.txt

Quoted 2 lines · Qiang Zhao

From: Zhao Qiang <[email protected]>

Please help to review as below, if it is ok, I will send the new version patch. Thank you!

Documentation/devicetree/bindings/rtc/nxp,pcf2127.yaml new file +38 -0
new file mode 100644
index 0000000..809dd59
@@ -0,0 +1,38 @@
+# SPDX-License-Identifier: GPL-2.0
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/rtc/nxp,pcf2127.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: PCF RTCs
+
+maintainers:
+  - Qiang Zhao <[email protected]>
+
+allOf:
+  - $ref: "rtc.yaml#"
+
+properties:
+  compatible:
+    enum:
+      - nxp,pcf2127
+      - nxp,pcf2129
+
+  reg:
+    maxItems: 1
+
+  interrupts:
+    maxItems: 1
+
+  no-watchdog:
+    maxItems: 1
+
+  start-year: true
+
+required:
+  - compatible
+  - reg
+
+additionalProperties: false
+
+...
Quoted 5 lines

Documentation/devicetree/writing-schema.rst and about 1000 examples in the kernel tree.

Rob

maintainer
#7 lore raw
Quoted 38 lines · Qiang Zhao
Quoted 10 lines · Rob Herring

-----Original Message-----
From: Rob Herring <[email protected]>
Sent: 2020年9月11日 22:03
To: Qiang Zhao <[email protected]>
Cc: [email protected]; [email protected]; [email protected]; [email protected]; [email protected]
Subject: Re: [PATCH 1/3] dt-bindings: rtc-2127: Add bindings for nxp,rtc-2127.txt

Quoted 16 lines
Quoted 15 lines · Qiang Zhao
Quoted 13 lines · Rob Herring

-----Original Message-----
From: Rob Herring <[email protected]>
Sent: 2020年9月10日 4:25
To: Qiang Zhao <[email protected]>
Cc: [email protected]; [email protected]; [email protected]; [email protected]; [email protected]
Subject: Re: [PATCH 1/3] dt-bindings: rtc-2127: Add bindings for nxp,rtc-2127.txt

Quoted 2 lines · Qiang Zhao

From: Zhao Qiang <[email protected]>

Please help to review as below, if it is ok, I will send the new version patch. Thank you!

Documentation/devicetree/bindings/rtc/nxp,pcf2127.yaml new file +0 -0
new file mode 100644
index 0000000..809dd59

Documentation/devicetree/bindings/rtc/nxp,pcf2127.yaml line 1

Quoted 1 line
Documentation/devicetree/bindings/rtc/nxp,pcf2127.yaml new file +1 -0
@@ -0,0 +1,38 @@
+# SPDX-License-Identifier: GPL-2.0

Dual license new bindings please:

(GPL-2.0-only OR BSD-2-Clause)

Quoted 17 lines
Documentation/devicetree/bindings/rtc/nxp,pcf2127.yaml new file +17 -0
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/rtc/nxp,pcf2127.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: PCF RTCs
+
+maintainers:
+  - Qiang Zhao <[email protected]>
+
+allOf:
+  - $ref: "rtc.yaml#"
+
+properties:
+  compatible:
+    enum:
+      - nxp,pcf2127

Documentation/devicetree/bindings/rtc/nxp,pcf2127.yaml line 28

Quoted 10 lines
Documentation/devicetree/bindings/rtc/nxp,pcf2127.yaml new file +10 -0
+      - nxp,pcf2129
+
+  reg:
+    maxItems: 1
+
+  interrupts:
+    maxItems: 1
+
+  no-watchdog:
+    maxItems: 1

maxItems is for arrays. What's the type here? It should have a description too.

Quoted 16 lines
Documentation/devicetree/bindings/rtc/nxp,pcf2127.yaml new file +10 -0
+
+  start-year: true
+
+required:
+  - compatible
+  - reg
+
+additionalProperties: false
+
+...
Quoted 6 lines

Documentation/devicetree/writing-schema.rst and about 1000 examples in the kernel tree.

Rob

author
#8 lore raw
Quoted 25 lines · Rob Herring

-----Original Message-----
From: Rob Herring <[email protected]>
Sent: 2020年9月14日 22:36
To: Qiang Zhao <[email protected]>
Cc: [email protected]; [email protected]; [email protected]; [email protected]; [email protected]
Subject: Re: [PATCH 1/3] dt-bindings: rtc-2127: Add bindings for nxp,rtc-2127.txt

Quoted 3 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

Please help to review as below, if it is ok, I will send the new version patch.

Thank you!

Documentation/devicetree/bindings/rtc/nxp,pcf2127.yaml line 1

Quoted 9 lines
Documentation/devicetree/bindings/rtc/nxp,pcf2127.yaml new file +1 -0
new file mode 100644
index 0000000..809dd59
@@ -0,0 +1,38 @@
+# SPDX-License-Identifier: GPL-2.0

Dual license new bindings please:

Quoted 11 lines

Documentation/devicetree/bindings/rtc/nxp,pcf2127.yaml line 28

Quoted 9 lines
Documentation/devicetree/bindings/rtc/nxp,pcf2127.yaml new file +9 -0
+
+title: PCF RTCs
+
+maintainers:
+  - Qiang Zhao <[email protected]>
+
+
+  no-watchdog:
+    maxItems: 1

maxItems is for arrays. What's the type here? It should have a description too.

Is it ok as below?
no-watchdog:
$ref: /schemas/types.yaml#/definitions/flag
description:
With this property, the device will not registered as a watchdog device.

Quoted 5 lines
Quoted 5 lines
Quoted 5 lines

Documentation/devicetree/writing-schema.rst and about 1000 examples in the kernel tree.

Rob

Best Regards
Qiang Zhao

#9 lore raw
In reply to Qiang Zhao

Den man. 14. sep. 2020 kl. 09.08 skrev Qiang Zhao <[email protected]>:

Quoted 20 lines · Rob Herring

Please help to review as below, if it is ok, I will send the new version patch. Thank you!

Documentation/devicetree/bindings/rtc/nxp,pcf2127.yaml new file +9 -0
new file mode 100644
index 0000000..809dd59
@@ -0,0 +1,38 @@
+# SPDX-License-Identifier: GPL-2.0
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/rtc/nxp,pcf2127.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: PCF RTCs
+
+maintainers:

Documentation/devicetree/bindings/rtc/nxp,pcf2127.yaml line 19

Quoted 10 lines
Documentation/devicetree/bindings/rtc/nxp,pcf2127.yaml new file +10 -0
+  - Qiang Zhao <[email protected]>
+
+allOf:
+  - $ref: "rtc.yaml#"
+
+properties:
+  compatible:
+    enum:
+      - nxp,pcf2127
+      - nxp,pcf2129

The device driver have 3 compatible strings, "nxp,pca2129" is missing.

/Bruno

Quoted 25 lines
Documentation/devicetree/bindings/rtc/nxp,pcf2127.yaml new file +19 -0
+
+  reg:
+    maxItems: 1
+
+  interrupts:
+    maxItems: 1
+
+  no-watchdog:
+    maxItems: 1
+
+  start-year: true
+
+required:
+  - compatible
+  - reg
+
+additionalProperties: false
+
+...
Quoted 6 lines

Documentation/devicetree/writing-schema.rst and about 1000 examples in the kernel tree.

Rob

author
#10 lore raw
Quoted 59 lines · Bruno Thomsen

-----Original Message-----
From: Bruno Thomsen <[email protected]>
Sent: 2020年9月18日 3:29
To: Qiang Zhao <[email protected]>
Cc: Rob Herring <[email protected]>; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]
Subject: Re: [PATCH 1/3] dt-bindings: rtc-2127: Add bindings for nxp,rtc-2127.txt

Den man. 14. sep. 2020 kl. 09.08 skrev Qiang Zhao <[email protected]>:

Quoted 4 lines · Rob Herring

Please help to review as below, if it is ok, I will send the new version patch.

Thank you!

Quoted 9 lines
Documentation/devicetree/bindings/rtc/nxp,pcf2127.yaml new file +0 -0
new file mode 100644
index 0000000..809dd59

Documentation/devicetree/bindings/rtc/nxp,pcf2127.yaml line 5

Quoted 5 lines
Documentation/devicetree/bindings/rtc/nxp,pcf2127.yaml new file +5 -0
@@ -0,0 +1,38 @@
+# SPDX-License-Identifier: GPL-2.0
+%YAML 1.2
+---
+$id:
+https://eur01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fdevi

+cetree.org%2Fschemas%2Frtc%2Fnxp%2Cpcf2127.yaml%23&amp;data=02%7 C01%7

Quoted 1 line

+Cqiang.zhao%40nxp.com%7C5a271aa3d1ed46ea578108d85b3ff9f6%7C686e a1d3bc

Quoted 1 line

+2b4c6fa92cd99c5c301635%7C0%7C0%7C637359677624002617&amp;sdata =UGZ9B6E

Documentation/devicetree/bindings/rtc/nxp,pcf2127.yaml

Quoted 4 lines
Documentation/devicetree/bindings/rtc/nxp,pcf2127.yaml new file +3 -0
+xteIMvxc3zvPfr%2FjZVQuPD6DJ6b2kZ%2BOO%2BIA%3D&amp;reserved=0
+$schema:
+https://eur01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fdevi

+cetree.org%2Fmeta-schemas%2Fcore.yaml%23&amp;data=02%7C01%7Cqiang .zha

Quoted 1 line

+o%40nxp.com%7C5a271aa3d1ed46ea578108d85b3ff9f6%7C686ea1d3bc2b4 c6fa92c

Quoted 1 line

+d99c5c301635%7C0%7C0%7C637359677624002617&amp;sdata=7P2m9OvIs FS6Q2By9

Quoted 9 lines
Documentation/devicetree/bindings/rtc/nxp,pcf2127.yaml new file +9 -0
+DNmK9Oq5Ff6B%2BNSEA4F7otTT8g%3D&amp;reserved=0
+
+title: PCF RTCs
+
+maintainers:
+  - Qiang Zhao <[email protected]>
+
+allOf:
+  - $ref: "rtc.yaml#"
Quoted 8 lines

Documentation/devicetree/bindings/rtc/nxp,pcf2127.yaml line 19

Quoted 6 lines
Documentation/devicetree/bindings/rtc/nxp,pcf2127.yaml new file +6 -0
+
+properties:
+  compatible:
+    enum:
+      - nxp,pcf2127
+      - nxp,pcf2129

The device driver have 3 compatible strings, "nxp,pca2129" is missing.

Thank you for your reminder, I will add in next version.

Quoted 28 lines

/Bruno

Quoted 25 lines
Documentation/devicetree/bindings/rtc/nxp,pcf2127.yaml new file +19 -0
+
+  reg:
+    maxItems: 1
+
+  interrupts:
+    maxItems: 1
+
+  no-watchdog:
+    maxItems: 1
+
+  start-year: true
+
+required:
+  - compatible
+  - reg
+
+additionalProperties: false
+
+...
Quoted 6 lines

Documentation/devicetree/writing-schema.rst and about 1000 examples in the kernel tree.

Rob

Best Regards
Qiang Zhao

#11 lore raw
In reply to Qiang Zhao

Hi,

The correct subject prefix is dt-bindings: rtc: pcf2127

Documentation/devicetree/bindings/rtc/nxp,rtc-2127.txt

Quoted 15 lines · Qiang Zhao

From: Zhao Qiang <[email protected]>

Add bindings for nxp,rtc-2127

---
 Documentation/devicetree/bindings/rtc/nxp,rtc-2127.txt | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/rtc/nxp,rtc-2127.txt
Documentation/devicetree/bindings/rtc/nxp,rtc-2127.txt new file +0 -0
new file mode 100644
index 0000000..c822e10

The proper filename is nxp,pcf2127.

Documentation/devicetree/bindings/rtc/nxp,rtc-2127.txt line 10

Quoted 11 lines
Documentation/devicetree/bindings/rtc/nxp,rtc-2127.txt new file +10 -0
@@ -0,0 +1,18 @@
+NXP PCF2127 SPI Real Time Clock
+
+Required properties:
+- compatible: should be: "nxp,pcf2127"
+                      or "nxp,pcf2129"
+- reg: should be the SPI slave chipselect address
+
+Optional properties:
+- no-watchdog: PCF2127 is not used as watchdog
+

Please Cc the watchdog maintainers as this should probably end up being a common watchdog binding.

Quoted 11 lines
Documentation/devicetree/bindings/rtc/nxp,rtc-2127.txt new file +8 -0
+Example:
+
+pcf2127: rtc@51 {
+	compatible = "nxp,pcf2127";
+	reg = <0x51>;
+	interrupts = <0 150 0x4>;
+	no-watchdog;
+};
Signature · 1 line
2.7.4
Signature · 3 lines
Alexandre Belloni, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com