summaryrefslogtreecommitdiff
path: root/drivers/rtc/rtc-max77663.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/rtc/rtc-max77663.c')
-rw-r--r--drivers/rtc/rtc-max77663.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/drivers/rtc/rtc-max77663.c b/drivers/rtc/rtc-max77663.c
index 13d8062e1def..d6dac76944d6 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;
}
@@ -431,9 +432,9 @@ static int max77663_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *alrm)
alrm->time.tm_wday);
if (rtc->irq_mask & RTC_IRQ_ALARM1_MASK)
- alrm->enabled = 1;
- else
alrm->enabled = 0;
+ else
+ alrm->enabled = 1;
return 0;
}