From patchwork Wed Apr 22 16:11:38 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Suniel Mahesh X-Patchwork-Id: 238328 List-Id: U-Boot discussion From: sunil at amarulasolutions.com (sunil at amarulasolutions.com) Date: Wed, 22 Apr 2020 21:41:38 +0530 Subject: [PATCH 0/3] Add support for Rockchip RK808 PMIC RTC device Message-ID: <1587571901-28343-1-git-send-email-sunil@amarulasolutions.com> From: Suniel Mahesh This patch series adds support for Rockchip RK808 PMIC RTC device. Patch #1, adds a child node under RK808 PMIC node. Patch #2 binds this child device with its parent RK808 PMIC. Patch #3 adds the rtc driver. The RK808 PMIC RTC has a hardware bug. It counts 31 days for november month and the weeks register counts 0 - 7. This driver does a temporary fix, where as in if date is Nov 31, then it resets the date to Dec 1(this happens only if date cmd is queried from u-boot command line/script). Similarly for the weeks register, 0(sun) - 6(sat). If 7 is encountered then it is reset to zero. u-boot generally loads linux/other binary. Linux has a full fledged driver implemented along with a workaround. https://lkml.org/lkml/2015/12/2/1202 Is this changeset acceptable ? please comment. Suniel Mahesh (3): arm: dts: rockchip: rk3399-roc-pc: Add RTC child node for RK808 PMIC power: pmic: rk8xx: bind rk808 RTC rtc: Add base support for the RK808 PMIC RTC arch/arm/dts/rk3399-roc-pc-u-boot.dtsi | 8 ++ configs/roc-pc-rk3399_defconfig | 2 + drivers/power/pmic/rk8xx.c | 19 +++- drivers/rtc/Kconfig | 8 ++ drivers/rtc/Makefile | 1 + drivers/rtc/rk808-rtc.c | 169 +++++++++++++++++++++++++++++++++ 6 files changed, 206 insertions(+), 1 deletion(-) create mode 100644 drivers/rtc/rk808-rtc.c