Skip to contentSkip to conversation

RTC: nuvoton: Add nuvoton real time clock driver

PATCH Applied Mia Lin 2 participants 5 messages Jul 13, 2022 – Jul 26, 2022

Subsystems (3)
lore
Share & tools
lore

Mia Lin

author
#0 lore raw

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

Support Nuvoton NCT3018Y real time clock.

Changes since version 6:
- Add review tag.
- Add blank line in dts.

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     |   5 +
 drivers/rtc/Kconfig                           |  10 +
 drivers/rtc/Makefile                          |   1 +
 drivers/rtc/rtc-nct3018y.c                    | 553 ++++++++++++++++++
 6 files changed, 616 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 v6 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
author
#2 lore raw

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

PATCH v6 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
maintainer Applied
#4 lore raw

Re: (subset) [PATCH v6 0/3] RTC: nuvoton: Add nuvoton real time clock driver

In reply to Mia Lin
Quoted 6 lines · Mia Lin

Support Nuvoton NCT3018Y real time clock.

Changes since version 6:
- Add review tag.
- Add blank line in dts.

Quoted 6 lines

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

[...]

Applied, thanks!

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

      commit: 8b30b09317ec6fda5f36a428e9e331253b5c4739
[3/3] RTC: nuvoton: Add NCT3018Y real time clock driver
      commit: 5adbaed16cc63542057627642d2414f603f2db69

Best regards,

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