[PATCH 1/5] rtc: ds1307: Keep DT based RTC configuration from breaking DS1337/41
Trent Piepho
tpiepho at kymetacorp.com
Tue Jun 7 13:03:44 PDT 2016
The DS1337 and DS1341 use a different configuration register layout
than the other supported ds1307 RTC chips. The code that does the
DT based configuration doesn't support this layout and will
incorrectly program them.
This disables DT configuration for DS1337 and DS1341.
Signed-off-by: Trent Piepho <tpiepho at kymetacorp.com>
---
drivers/rtc/rtc-ds1307.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/rtc/rtc-ds1307.c b/drivers/rtc/rtc-ds1307.c
index 73d88ba..86cba6e 100644
--- a/drivers/rtc/rtc-ds1307.c
+++ b/drivers/rtc/rtc-ds1307.c
@@ -382,7 +382,8 @@ read_rtc:
}
/* Configure clock using OF data if available */
- if (IS_ENABLED(CONFIG_OFDEVICE) && np) {
+ if (IS_ENABLED(CONFIG_OFDEVICE) && np &&
+ ds1307->type != ds_1337 && ds1307->type != ds_1341) {
u8 control = ds1307->regs[DS1307_REG_CONTROL];
u32 rate = 0;
--
2.7.0.25.gfc10eb5.dirty
More information about the barebox
mailing list