rtc: add ht1380 driver
PATCH v3 1/1 rtc: add ht1380 driver
Support Holtek HT1380/HT1381 Serial Timekeeper Chip. It provides seconds , minutes, hours, day of the week, date, month and year information.
Datasheet:
https://www.holtek.com.tw/documents/10179/11842/ht1380_1v130.pdf
---
v3:
Suggested by Simon Glass:
* remove extra brackets
* pass GPIOD_IS_OUT to gpio_request_by_name() and drop the extra code below
* add text to Kconfig: how it is connected, i.e. three GPIOs
* rename dts names to plural: rst/clk/dat-gpios
Suggested by Tom Rini:
* enable on sandbox so that it gets build tested
v2:
* The RESET pin is now to be described as ACTIVE_LOW in dts. Changes suggested by Simon Glass:
* a more detailed driver description in Kconfig
* multi-line comments' style
* enum for 0x80 and the 0x20 at top of file
* lower-case hex constants
* function comments for ht1380_reset_on/off
* blank line before returns
configs/sandbox_defconfig | 1 + drivers/rtc/Kconfig | 9 ++ drivers/rtc/Makefile | 1 + drivers/rtc/ht1380.c | 329 ++++++++++++++++++++++++++++++++++++++ 4 files changed, 340 insertions(+) create mode 100644 drivers/rtc/ht1380.c
configs/sandbox_defconfig +1 -0
@@ -334,3 +334,4 @@ CONFIG_UNIT_TEST=y CONFIG_UT_TIME=y CONFIG_UT_DM=y CONFIG_IPV6=y +CONFIG_RTC_HT1380=y
drivers/rtc/Kconfig +9 -0
@@ -220,4 +220,13 @@ config RTC_ZYNQMP Say "yes" here to support the on chip real time clock present on Xilinx ZynqMP SoC. +config RTC_HT1380 + bool "Enable Holtek HT1380/HT1381 RTC driver" + depends on DM_RTC && DM_GPIO + help + Say "yes" here to get support for Holtek HT1380/HT1381 + Serial Timekeeper IC which provides seconds, minutes, hours, + day of the week, date, month and year information. It is to be + connected via 3 GPIO pins which work as reset, clock, and data. + endmenu
drivers/rtc/Makefile +1 -0
@@ -24,6 +24,7 @@ obj-$(CONFIG_RTC_DS3231) += ds3231.o obj-$(CONFIG_RTC_DS3232) += ds3232.o obj-$(CONFIG_RTC_EMULATION) += emul_rtc.o obj-$(CONFIG_RTC_FTRTC010) += ftrtc010.o +obj-$(CONFIG_RTC_HT1380) += ht1380.o obj-$(CONFIG_SANDBOX) += i2c_rtc_emul.o obj-$(CONFIG_RTC_IMXDI) += imxdi.o obj-$(CONFIG_RTC_ISL1208) += isl1208.o
drivers/rtc/ht1380.c new file +329 -0
329 lines not on this page · raw message
Signature · 1 line
2.34.1
Quoted 29 lines · Sergei Antonov
Support Holtek HT1380/HT1381 Serial Timekeeper Chip. It provides seconds , minutes, hours, day of the week, date, month and year information.
Datasheet:
https://www.holtek.com.tw/documents/10179/11842/ht1380_1v130.pdfSigned-off-by Sergei Antonov <[email protected]>---
v3:
Suggested by Simon Glass:
* remove extra brackets
* passGPIOD_IS_OUTtogpio_request_by_name()and drop the extra code below
* add text toKconfig: how it is connected, i.e. three GPIOs
* rename dts names to plural: rst/clk/dat-gpios
Suggested by Tom Rini:
* enable on sandbox so that it gets build testedv2:
* The RESET pin is now to be described asACTIVE_LOWin dts. Changes suggested by Simon Glass:
* a more detailed driver description inKconfig
* multi-line comments' style
* enum for0x80and the0x20at top of file
* lower-case hex constants
* function comments for ht1380_reset_on/off
* blank line before returns
Quoted 6 lines
configs/sandbox_defconfig | 1 + drivers/rtc/Kconfig | 9 ++ drivers/rtc/Makefile | 1 + drivers/rtc/ht1380.c | 329 ++++++++++++++++++++++++++++++++++++++ 4 files changed, 340 insertions(+) create mode 100644 drivers/rtc/ht1380.c
Quoted 8 lines · Sergei Antonov
Support Holtek HT1380/HT1381 Serial Timekeeper Chip. It provides seconds , minutes, hours, day of the week, date, month and year information.
Datasheet:
https://www.holtek.com.tw/documents/10179/11842/ht1380_1v130.pdfSigned-off-by Sergei Antonov <[email protected]>Reviewed-by Simon Glass <[email protected]>
Applied to u-boot/next, thanks!
Signature · 1 line
Tom