summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Leussler <robert.leussler@leica-geosystems.com>2026-07-21 08:19:07 +0000
committerAlexandre Belloni <alexandre.belloni@bootlin.com>2026-08-20 00:28:44 +0200
commit878d93aaa596a861dbc8d71f7c38e62a2e805f01 (patch)
treef28ea99fb46bce9022e7f2327d0daea129085688
parentb1407862fb57c6455a04fa5d0d02b58496a38cc9 (diff)
downloadlinux-878d93aaa596a861dbc8d71f7c38e62a2e805f01.tar.gz
linux-878d93aaa596a861dbc8d71f7c38e62a2e805f01.zip
rtc: ds1307: fix RX8130 wakeup alarm WADA bit for day-of-month mode
The RX8130 wakeup alarm never fired when set via /sys/class/rtc/rtc0/wakealarm. The root cause is that the WADA bit (bit 3) in the Extension register (0x1c) was never set before programming the alarm registers. Per the RX8130 datasheet: WADA=0 - Week alarm: register 0x19 is compared against day-of-week WADA=1 - Day alarm: register 0x19 is compared against day-of-month rx8130_set_alarm() always writes a BCD day-of-month value to alarm register 0x19, so WADA must be 1. With WADA=0 the hardware matched the day-of-month value (e.g. 15) as a day-of-week index, which is always out of range (valid weekdays are 0-6), so the alarm interrupt was never asserted. Fix by setting the WADA bit in rx8130_set_alarm() before writing the Extension register back to the device. This is consistent with rx8130_read_alarm(), which decodes the same register under the same assumption (24-hour and day-of-month mode). Signed-off-by: Robert Leussler <robert.leussler@leica-geosystems.com> Link: https://patch.msgid.link/20260721081907.3518648-1-robert.leussler@leica-geosystems.com Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
-rw-r--r--drivers/rtc/rtc-ds1307.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/rtc/rtc-ds1307.c b/drivers/rtc/rtc-ds1307.c
index 0707ded5368b..6f3dcb6483b9 100644
--- a/drivers/rtc/rtc-ds1307.c
+++ b/drivers/rtc/rtc-ds1307.c
@@ -662,7 +662,7 @@ static int rx8130_set_alarm(struct device *dev, struct rtc_wkalrm *t)
if (ret < 0)
return ret;
- ctl[0] &= RX8130_REG_EXTENSION_WADA;
+ ctl[0] |= RX8130_REG_EXTENSION_WADA;
ctl[1] &= ~RX8130_REG_FLAG_AF;
ctl[2] &= ~RX8130_REG_CONTROL0_AIE;