Skip to contentSkip to conversation

rtc: add support for rv3028 rtc

PATCH New Heiko Schocher 2 participants 2 messages Mar 10, 2021 – Apr 13, 2021 Real time clock (RTC)

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 rtc: add support for rv3028 rtc

Add support for rtc3028 rtc from microcrystal.
based on linux dirver:
commit a38fd8748464: ("Linux 5.12-rc2")

---
Driver is based on code in linux, but with already corrected weekday usage. Linux codes the weekday bitwise, while the weekday register has only 3 valid bits as the app manual [1] says:

This register holds the current day of the week. Each value represents one weekday that is assigned by the user. Values will range from 0 to 6 The weekday counter is simply a 3-bit counter which counts up to 6 and then resets to 0.

[1] https://www.microcrystal.com/fileadmin/Media/Products/RTC/App.Manual/RV-3028-C7_App-Manual.pdf

This is not a big problem, as userspace never use weekday. Nevertheless, sent an update for the linux driver also:

https://marc.info/?l=linux-rtc&m=161529769106774&w=2

azure build:
https://dev.azure.com/hs0298/hs/_build/results?buildId=64&view=results

Changes in v2:
- add comments from Stefan
- start sentence with upper-case
- remove not needed includes, thanks!
- add Reviewed-by from Stefan

 drivers/rtc/Kconfig  |   6 ++
 drivers/rtc/Makefile |   1 +
 drivers/rtc/rv3028.c | 208 +++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 215 insertions(+)
 create mode 100644 drivers/rtc/rv3028.c
drivers/rtc/Kconfig +6 -0
index aa6d90158c..e451308b40 100644
@@ -95,6 +95,12 @@ config RTC_PCF8563
 	  If you say yes here you get support for the Philips PCF8563 RTC
 	  and compatible chips.
 
+config RTC_RV3028
+	bool "Enable RV3028 driver"
+	depends on DM_RTC
+	help
+	  The MicroCrystal RV3028 is a I2C Real Time Clock (RTC)
+
 config RTC_RV3029
 	bool "Enable RV3029 driver"
 	depends on DM_RTC
drivers/rtc/Makefile +1 -0
index 6a45a9c874..e7acd76266 100644
@@ -46,6 +46,7 @@ obj-$(CONFIG_RTC_PCF2127) += pcf2127.o
 obj-$(CONFIG_RTC_PL031) += pl031.o
 obj-$(CONFIG_RTC_PT7C4338) += pt7c4338.o
 obj-$(CONFIG_RTC_RS5C372A) += rs5c372.o
+obj-$(CONFIG_RTC_RV3028) += rv3028.o
 obj-$(CONFIG_RTC_RV3029) += rv3029.o
 obj-$(CONFIG_RTC_RV8803) += rv8803.o
 obj-$(CONFIG_RTC_RX8025) += rx8025.o
drivers/rtc/rv3028.c new file +208 -0

208 lines not on this page · raw message

Signature · 1 line
2.29.2
#1 lore raw

PATCH v2 1/1 rtc: add support for rv3028 rtc

Quoted 7 lines · Heiko Schocher

Add support for rtc3028 rtc from microcrystal.
based on linux dirver:
commit a38fd8748464: ("Linux 5.12-rc2")

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20210413/76f8382b/attachment.sig>