summaryrefslogtreecommitdiff
path: root/drivers/rtc
diff options
context:
space:
mode:
authorGary Bisson <gary.bisson@boundarydevices.com>2017-04-25 16:45:14 +0200
committerAlexandre Belloni <alexandre.belloni@free-electrons.com>2017-05-31 09:17:02 +0200
commit2de9261c18c2b09a8025872bb470853dc8db726c (patch)
treeb1c09c7520d81fcace10cfe7e3b3fc468511ec3a /drivers/rtc
parent8066360744743fb7f2dee1e2041fc9fc92f9d6b5 (diff)
rtc: m41t80: fix SQWE override when setting an alarm
Currently setting an alarm clears the SQWE bit which means that the clock output is disabled no matter its previous state. Signed-off-by: Gary Bisson <gary.bisson@boundarydevices.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
Diffstat (limited to 'drivers/rtc')
-rw-r--r--drivers/rtc/rtc-m41t80.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/rtc/rtc-m41t80.c b/drivers/rtc/rtc-m41t80.c
index 5ec4653022ff..b0749645aa48 100644
--- a/drivers/rtc/rtc-m41t80.c
+++ b/drivers/rtc/rtc-m41t80.c
@@ -332,6 +332,9 @@ static int m41t80_set_alarm(struct device *dev, struct rtc_wkalrm *alrm)
return err;
}
+ /* Keep SQWE bit value */
+ alarmvals[0] |= (ret & M41T80_ALMON_SQWE);
+
ret = i2c_smbus_read_byte_data(client, M41T80_REG_FLAGS);
if (ret < 0)
return ret;