Skip to contentSkip to conversation

RTC: nuvoton: Add nuvoton real time clock driver

PATCH Superseded Mia Lin 3 participants 7 messages Jul 7, 2022 – Jul 12, 2022

Subsystems (3)

v4 of 6 Superseded Latest is v6 →

lore
Share & tools
lore

Mia Lin

author
#0 lore raw

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

Support Nuvoton NCT3018Y real time clock.

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 v4 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
#4 lore raw

PATCH v4 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
author
#5 lore raw

PATCH v4 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 Reviewed-by on v4 1/3
#2 lore raw

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

In reply to Mia Lin
Quoted 9 lines · Mia Lin

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
#6 lore raw

Re: [PATCH v4 3/3] RTC: nuvoton: Add NCT3018Y real time clock driver

In reply to Mia Lin
Thank you for the patch! Yet something to improve:

Hi Mia,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on abelloni/rtc-next]
[also build test ERROR on robh/for-next linus/master v5.19-rc5 next-20220708] [If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Mia-Lin/RTC-nuvoton-Add-nuvoton-real-time-clock-driver/20220707-153317
base:   https://git.kernel.org/pub/scm/linux/kernel/git/abelloni/linux.git rtc-next
config: x86_64-allyesconfig (https://download.01.org/0day-ci/archive/20220709/[email protected]/config)
compiler: gcc-11 (Debian 11.3.0-3) 11.3.0
reproduce (this is a W=1 build):
        # https://github.com/intel-lab-lkp/linux/commit/028783fef7713ddc9f2d14a39f09741370f42e3c
        git remote add linux-review https://github.com/intel-lab-lkp/linux
        git fetch --no-tags linux-review Mia-Lin/RTC-nuvoton-Add-nuvoton-real-time-clock-driver/20220707-153317
        git checkout 028783fef7713ddc9f2d14a39f09741370f42e3c
        # save the config file
        mkdir build_dir && cp config build_dir/.config
        make W=1 O=build_dir ARCH=x86_64 SHELL=/bin/bash drivers/

If you fix the issue, kindly add following tag where applicable

All errors (new ones prefixed by >>):

>> drivers/rtc/rtc-nct3018y.c:553:23: error: unterminated argument list invoking macro "MODULE_AUTHOR"
     553 | MODULE_LICENSE("GPL");
         |                       ^
>> drivers/rtc/rtc-nct3018y.c:551:1: error: expected '=', ',', ';', 'asm' or '__attribute__' at end of input
     551 | MODULE_AUTHOR(("Mia Lin <[email protected]>");
         | ^~~~~~~~~~~~~

vim +/MODULE_AUTHOR +553 drivers/rtc/rtc-nct3018y.c

549
550 MODULE_AUTHOR("Medad CChien <[email protected]>");

 > 551	MODULE_AUTHOR(("Mia Lin <[email protected]>");
   552	MODULE_DESCRIPTION("Nuvoton NCT3018Y RTC driver");
 > 553	MODULE_LICENSE("GPL");
Signature · 2 lines
0-DAY CI Kernel Test Service
https://01.org/lkp
#3 lore raw

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

In reply to Rob Herring

Dear Rob Herring,

Thank you for your response.
I'm new to upstream that I didn't add the review tag to v5 patch. I will add the review tag in the v6 patch.

Thanks.
Best regards,
Mia

Rob Herring <[email protected]> 於 2022年7月9日 週六 清晨6:14寫道:

Quoted 13 lines · Mia Lin
Quoted 9 lines

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