[PATCH 1/5] rtc: ds1307: Keep DT based RTC configuration from breaking DS1337/41

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxxxx>
---
 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


_______________________________________________
barebox mailing list
barebox@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/barebox



[Index of Archives]     [Linux Embedded]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux