From 1a61c310b66245a73e021d786eea45c31cd9f6e9 Mon Sep 17 00:00:00 2001 From: Daniel Fu Date: Thu, 23 Aug 2012 19:40:08 +0800 Subject: rtc: max77663: Set Alarm wday to its reset value The wday is configured only when disabled alarm. When enable alarm, set it to its default reset value 0x01, and not enable it, to prevent an error happened when re-read the alarm value into the virtualized generic layer at boot up in reading alarm setting of RTC. Bug 1034871 Change-Id: I8bfa997653edaaa286cf768c1827b5ab986f52cc Signed-off-by: Daniel Fu Reviewed-on: http://git-master/r/129398 Reviewed-by: Automatic_Commit_Validation_User GVS: Gerrit_Virtual_Submit Reviewed-by: Bharat Nihalani Reviewed-by: Jinyoung Park --- drivers/rtc/rtc-max77663.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'drivers/rtc') diff --git a/drivers/rtc/rtc-max77663.c b/drivers/rtc/rtc-max77663.c index 13d8062e1def..a84dcc73f0ec 100644 --- a/drivers/rtc/rtc-max77663.c +++ b/drivers/rtc/rtc-max77663.c @@ -227,9 +227,10 @@ static inline int max77663_rtc_tm_to_reg(struct max77663_rtc *rtc, u8 *buf, /* The wday is configured only when disabled alarm. */ if (!alarm) buf[RTC_WEEKDAY] = (1 << tm->tm_wday); - else - buf[RTC_WEEKDAY] = 0; - + else { + /* Configure its default reset value 0x01, and not enable it. */ + buf[RTC_WEEKDAY] = 0x01; + } return 0; } -- cgit v1.2.3