summaryrefslogtreecommitdiff
path: root/drivers/rtc
diff options
context:
space:
mode:
authorDaniel Fu <danifu@nvidia.com>2012-08-23 19:40:08 +0800
committerRohan Somvanshi <rsomvanshi@nvidia.com>2012-09-13 02:37:45 -0700
commitc20f901e5056dbe1ce7c369a069cf50e63b09174 (patch)
treeb9410e1e6406929c65223706d9a65cc7b398ee44 /drivers/rtc
parent66b47b4aa7e4fe6581e4c0ced6069ef841475af2 (diff)
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 <danifu@nvidia.com> Reviewed-on: http://git-master/r/129398 (cherry picked from commit 1a61c310b66245a73e021d786eea45c31cd9f6e9) Signed-off-by: Kerwin Wan <kerwinw@nvidia.com> Change-Id: Ifa78078c6387689d12fe1aade8a9c531fef4f771 Reviewed-on: http://git-master/r/131130 Reviewed-by: Rohan Somvanshi <rsomvanshi@nvidia.com> Tested-by: Rohan Somvanshi <rsomvanshi@nvidia.com>
Diffstat (limited to 'drivers/rtc')
-rw-r--r--drivers/rtc/rtc-max77663.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/rtc/rtc-max77663.c b/drivers/rtc/rtc-max77663.c
index 978c7021ea12..51faee4bd203 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;
}