Skip to contentSkip to conversation

rtc: Add RTC chip pcf2127 support

PATCH New Meng Yi 2 participants 3 messages Dec 1, 2016 – Dec 3, 2016 Real time clock (RTC)

lore
Share & tools
lore

Meng Yi

author
#0 lore raw

PATCH v3 1/1 rtc: Add RTC chip pcf2127 support

This driver just implemented rtc_get and rtc_set function for the compatibility of pcf2127 and pcf2129, and didn't make use of pcf2127's 512 bytes of general-purpose static RAM since pcf2129 don't have any static RAM.

---
change in V3:
-fix coding style and return value check
change in V2:
-convert to using u-boot driver module

---
 drivers/rtc/Kconfig   |  10 +++++
 drivers/rtc/Makefile  |   1 +
 drivers/rtc/pcf2127.c | 109 ++++++++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 120 insertions(+)
 create mode 100644 drivers/rtc/pcf2127.c
drivers/rtc/Kconfig +10 -0
index b5d9048..cb79a01 100644
@@ -13,4 +13,14 @@ config DM_RTC
 	  drivers to perform the actual functions. See rtc.h for a
 	  description of the API.
 
+config RTC_PCF2127
+	bool "Enable PCF2127 driver"
+	depends on DM_RTC
+	help
+	  The PCF2127 is a CMOS Real Time Clock (RTC) and calendar with an integrated
+	  Temperature Compensated Crystal (Xtal) Oscillator (TCXO) and a 32.768 kHz quartz
+	  crystal optimized for very high accuracy and very low power consumption. The PCF2127
+	  has a selectable I2C-bus or SPI-bus, a backup battery switch-over circuit, a
+	  programmable watchdog function, a timestamp function, and many other features.
+
 endmenu
drivers/rtc/Makefile +1 -0
index fc38a3f..c919427 100644
@@ -45,6 +45,7 @@ obj-$(CONFIG_RTC_MV) += mvrtc.o
 obj-$(CONFIG_RTC_MX27) += mx27rtc.o
 obj-$(CONFIG_RTC_MXS) += mxsrtc.o
 obj-$(CONFIG_RTC_PCF8563) += pcf8563.o
+obj-$(CONFIG_RTC_PCF2127) += pcf2127.o
 obj-$(CONFIG_RTC_PL031) += pl031.o
 obj-$(CONFIG_RTC_PT7C4338) += pt7c4338.o
 obj-$(CONFIG_RTC_RS5C372A) += rs5c372.o
drivers/rtc/pcf2127.c new file +109 -0

109 lines not on this page · raw message

Signature · 1 line
2.1.0.27.g96db324
#1 lore raw

PATCH v3 1/1 rtc: Add RTC chip pcf2127 support

Quoted 11 lines · Meng Yi

This driver just implemented rtc_get and rtc_set function for the compatibility of pcf2127 and pcf2129, and didn't make use of pcf2127's 512 bytes of general-purpose static RAM since pcf2129 don't have any static RAM.

---
change in V3:
-fix coding style and return value check
change in V2:
-convert to using u-boot driver module

Quoted 6 lines
---
 drivers/rtc/Kconfig   |  10 +++++
 drivers/rtc/Makefile  |   1 +
 drivers/rtc/pcf2127.c | 109 ++++++++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 120 insertions(+)
 create mode 100644 drivers/rtc/pcf2127.c
#2 lore raw

PATCH v3 1/1 rtc: Add RTC chip pcf2127 support

Quoted 6 lines · Simon Glass
Quoted 5 lines · Meng Yi

This driver just implemented rtc_get and rtc_set function for the compatibility of pcf2127 and pcf2129, and didn't make use of pcf2127's 512 bytes of general-purpose static RAM since pcf2129 don't have any static RAM.

Quoted 14 lines
Quoted 6 lines

---
change in V3:
-fix coding style and return value check
change in V2:
-convert to using u-boot driver module

Quoted 6 lines
---
 drivers/rtc/Kconfig   |  10 +++++
 drivers/rtc/Makefile  |   1 +
 drivers/rtc/pcf2127.c | 109 ++++++++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 120 insertions(+)
 create mode 100644 drivers/rtc/pcf2127.c

Applied to u-boot-dm, thanks!