Skip to contentSkip to conversation

RTC: nuvoton: Add nuvoton real time clock driver

PATCH Superseded Mia Lin 2 participants 8 messages Jul 12, 2022

Subsystems (3)

v5 of 6 Superseded Latest is v6 →

lore
Share & tools
lore

Mia Lin

author
#0 lore raw

v5 cover RTC: nuvoton: Add nuvoton real time clock driver

Support Nuvoton NCT3018Y real time clock.

Changes since version 5:
- Add battery voltage level check by NCT3018Y_REG_ST.
- Remove disable clock output.
- Fix errors in rtc-nct3018y.c.

Changes since version 4:
- Fix warnings in rtc-nct3018y.c.
- Reduce the number of error messages.
- Add time vaild check.
- Add functionality check.
- Add maintainer.

Changes since version 3:
- Add part number in Kconfig.
- Refactor rtc-nct3018y.c.

Changes since version 2:
- Fix errors in rtc-nct3018y.c.
- Fix warnings in rtc-nct3018y.c.

Changes since version 1:
- Add nuvoton,nct3018y property in NPCM devicetree.
- Add new property in rtc binding document.
- Add new driver for nuvoton real time clock driver.

Mia Lin (3):
dt-bindings: rtc: nuvoton: add NCT3018Y Real Time Clock
ARM: dts: nuvoton: Add nuvoton RTC3018Y node
RTC: nuvoton: Add NCT3018Y real time clock driver

 .../bindings/rtc/nuvoton,nct3018y.yaml        |  45 ++
 MAINTAINERS                                   |   2 +
 arch/arm/boot/dts/nuvoton-npcm750-evb.dts     |   4 +
 drivers/rtc/Kconfig                           |  10 +
 drivers/rtc/Makefile                          |   1 +
 drivers/rtc/rtc-nct3018y.c                    | 553 ++++++++++++++++++
 6 files changed, 615 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/rtc/nuvoton,nct3018y.yaml
 create mode 100644 drivers/rtc/rtc-nct3018y.c
Signature · 1 line
2.17.1
author
#1 lore raw

PATCH v5 1/3 dt-bindings: rtc: nuvoton: add NCT3018Y Real Time Clock

Document devicetree bindings for the Nuvoton NCT3018Y Real Time Clock.

---
 .../bindings/rtc/nuvoton,nct3018y.yaml        | 45 +++++++++++++++++++
 MAINTAINERS                                   |  1 +
 2 files changed, 46 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/rtc/nuvoton,nct3018y.yaml
Documentation/devicetree/bindings/rtc/nuvoton,nct3018y.yaml new file +45 -0
new file mode 100644
index 000000000000..7a1857f5caa8
@@ -0,0 +1,45 @@
+# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/rtc/nuvoton,nct3018y.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: NUVOTON NCT3018Y Real Time Clock
+
+allOf:
+  - $ref: "rtc.yaml#"
+
+maintainers:
+  - Medad CChien <[email protected]>
+  - Mia Lin <[email protected]>
+
+properties:
+  compatible:
+    const: nuvoton,nct3018y
+
+  reg:
+    maxItems: 1
+
+  start-year: true
+
+  reset-source: true
+
+required:
+  - compatible
+  - reg
+
+additionalProperties: false
+
+examples:
+  - |
+    i2c {
+        #address-cells = <1>;
+        #size-cells = <0>;
+
+        rtc@6f {
+            compatible = "nuvoton,nct3018y";
+            reg = <0x6f>;
+        };
+    };
+
+...
MAINTAINERS +1 -0
index fe5daf141501..eca54b275559 100644
@@ -2448,6 +2448,7 @@ S:	Supported
 F:	Documentation/devicetree/bindings/*/*/*npcm*
 F:	Documentation/devicetree/bindings/*/*npcm*
 F:	Documentation/devicetree/bindings/arm/npcm/*
+F:	Documentation/devicetree/bindings/rtc/nuvoton,nct3018y.yaml
 F:	arch/arm/boot/dts/nuvoton-npcm*
 F:	arch/arm/mach-npcm/
 F:	drivers/*/*npcm*
Signature · 1 line
2.17.1
#2 lore raw

Re: [PATCH v5 1/3] dt-bindings: rtc: nuvoton: add NCT3018Y Real Time Clock

Quoted 3 lines · Mia Lin

Document devicetree bindings for the Nuvoton NCT3018Y Real Time Clock.

Where is the review tag?

Best regards,
Krzysztof

#3 lore raw

Re: [PATCH v5 1/3] dt-bindings: rtc: nuvoton: add NCT3018Y Real Time Clock

Dear Krzysztof,

Thank you for your reminder.
I'm new to upstream. I will add the review tag in the next patch.

Thanks.
Best regards,
Mia

Krzysztof Kozlowski <[email protected]> 於 2022年7月12日 週二 下午3:43寫道:

Quoted 10 lines · Mia Lin
Quoted 3 lines

Document devicetree bindings for the Nuvoton NCT3018Y Real Time Clock.

Where is the review tag?

Best regards,
Krzysztof

author
#4 lore raw

PATCH v5 2/3 ARM: dts: nuvoton: Add nuvoton RTC3018Y node

In reply to Mia Lin

Add nuvoton real time clock RTC3018Y in I2C node

---
 arch/arm/boot/dts/nuvoton-npcm750-evb.dts | 4 ++++
 1 file changed, 4 insertions(+)
arch/arm/boot/dts/nuvoton-npcm750-evb.dts +4 -0
index 3dad32834e5e..589aadb67688 100644
@@ -202,6 +202,10 @@
 		reg = <0x48>;
 		status = "okay";
 	};
+	rtc0: rtc@6f {
+		compatible = "nuvoton,nct3018y";
+		reg = <0x6f>;
+	};
 };
 
 /* lm75 on EB */
Signature · 1 line
2.17.1
#5 lore raw

Re: [PATCH v5 2/3] ARM: dts: nuvoton: Add nuvoton RTC3018Y node

Quoted 12 lines · Mia Lin

Add nuvoton real time clock RTC3018Y in I2C node

---
 arch/arm/boot/dts/nuvoton-npcm750-evb.dts | 4 ++++
 1 file changed, 4 insertions(+)
arch/arm/boot/dts/nuvoton-npcm750-evb.dts +0 -0
index 3dad32834e5e..589aadb67688 100644

arch/arm/boot/dts/nuvoton-npcm750-evb.dts line 204

Quoted 3 lines
arch/arm/boot/dts/nuvoton-npcm750-evb.dts +0 -0
@@ -202,6 +202,10 @@
 		reg = <0x48>;
 		status = "okay";
 	};

Missing blank line.

arch/arm/boot/dts/nuvoton-npcm750-evb.dts line 211

Quoted 7 lines
arch/arm/boot/dts/nuvoton-npcm750-evb.dts +4 -0
+	rtc0: rtc@6f {
+		compatible = "nuvoton,nct3018y";
+		reg = <0x6f>;
+	};
 };
 
 /* lm75 on EB */

Best regards,
Krzysztof

#6 lore raw

Re: [PATCH v5 2/3] ARM: dts: nuvoton: Add nuvoton RTC3018Y node

Dear Krzysztof,

Thank you for your comment.
I will fill blank line.

Thanks.
Best Regards,
Mia

Krzysztof Kozlowski <[email protected]> 於 2022年7月12日 週二 下午3:44寫道:

Quoted 31 lines · Mia Lin
Quoted 12 lines

Add nuvoton real time clock RTC3018Y in I2C node

---
 arch/arm/boot/dts/nuvoton-npcm750-evb.dts | 4 ++++
 1 file changed, 4 insertions(+)
arch/arm/boot/dts/nuvoton-npcm750-evb.dts +0 -0
index 3dad32834e5e..589aadb67688 100644

arch/arm/boot/dts/nuvoton-npcm750-evb.dts line 204

Quoted 3 lines
arch/arm/boot/dts/nuvoton-npcm750-evb.dts +0 -0
@@ -202,6 +202,10 @@
              reg = <0x48>;
              status = "okay";
      };

Missing blank line.

arch/arm/boot/dts/nuvoton-npcm750-evb.dts line 211

Quoted 7 lines
arch/arm/boot/dts/nuvoton-npcm750-evb.dts +4 -0
+     rtc0: rtc@6f {
+             compatible = "nuvoton,nct3018y";
+             reg = <0x6f>;
+     };
 };
 
 /* lm75 on EB */

Best regards,
Krzysztof

author
#7 lore raw

PATCH v5 3/3 RTC: nuvoton: Add NCT3018Y real time clock driver

In reply to Mia Lin

Add real time clock support for NCT3018Y.

---
 MAINTAINERS                |   1 +
 drivers/rtc/Kconfig        |  10 +
 drivers/rtc/Makefile       |   1 +
 drivers/rtc/rtc-nct3018y.c | 553 +++++++++++++++++++++++++++++++++++++
 4 files changed, 565 insertions(+)
 create mode 100644 drivers/rtc/rtc-nct3018y.c
MAINTAINERS +1 -0
index eca54b275559..08101c49cba6 100644
@@ -2453,6 +2453,7 @@ F:	arch/arm/boot/dts/nuvoton-npcm*
 F:	arch/arm/mach-npcm/
 F:	drivers/*/*npcm*
 F:	drivers/*/*/*npcm*
+F:	drivers/rtc/rtc-nct3018y.c
 F:	include/dt-bindings/clock/nuvoton,npcm7xx-clock.h
 
 ARM/NUVOTON WPCM450 ARCHITECTURE
drivers/rtc/Kconfig +10 -0
index a00f901b5c1d..3444c638fd28 100644
@@ -383,6 +383,16 @@ config RTC_DRV_MAX77686
 	  This driver can also be built as a module. If so, the module
 	  will be called rtc-max77686.
 
+config RTC_DRV_NCT3018Y
+	tristate "Nuvoton NCT3018Y"
+	depends on OF
+	help
+	   If you say yes here you get support for the Nuvoton NCT3018Y I2C RTC
+	   chip.
+
+	   This driver can also be built as a module, if so, the module will be
+	   called "rtc-nct3018y".
+
 config RTC_DRV_RK808
 	tristate "Rockchip RK805/RK808/RK809/RK817/RK818 RTC"
 	depends on MFD_RK808
drivers/rtc/Makefile +1 -0
index fb04467b652d..12353df426ff 100644
@@ -112,6 +112,7 @@ obj-$(CONFIG_RTC_DRV_MV)	+= rtc-mv.o
 obj-$(CONFIG_RTC_DRV_MXC)	+= rtc-mxc.o
 obj-$(CONFIG_RTC_DRV_MXC_V2)	+= rtc-mxc_v2.o
 obj-$(CONFIG_RTC_DRV_GAMECUBE)	+= rtc-gamecube.o
+obj-$(CONFIG_RTC_DRV_NCT3018Y)	+= rtc-nct3018y.o
 obj-$(CONFIG_RTC_DRV_NTXEC)	+= rtc-ntxec.o
 obj-$(CONFIG_RTC_DRV_OMAP)	+= rtc-omap.o
 obj-$(CONFIG_RTC_DRV_OPAL)	+= rtc-opal.o
drivers/rtc/rtc-nct3018y.c new file +553 -0

553 lines not on this page · raw message

Signature · 1 line
2.17.1