diff options
author | 2019-10-07 15:47:19 +0200 | |
---|---|---|
committer | 2019-10-07 15:49:29 +0200 | |
commit | 088443c79c7720470e353fa46eb1acf642b05822 (patch) | |
tree | ac75e13d5b6107a617e91413852ba8a3091ed3c5 /drivers | |
parent | rtc: ds1347: simplify getting .driver_data (diff) | |
download | wireguard-linux-088443c79c7720470e353fa46eb1acf642b05822.tar.xz wireguard-linux-088443c79c7720470e353fa46eb1acf642b05822.zip |
rtc: ds1347: mask ALM OUT when reading time
Bit 7 of the minutes registers is ALM OUT. It indicates an alarm fired.
Mask it out when reading the time.
Link: https://lore.kernel.org/r/20191007134724.15505-5-alexandre.belloni@bootlin.com
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/rtc/rtc-ds1347.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/rtc/rtc-ds1347.c b/drivers/rtc/rtc-ds1347.c index 06abf0b47e16..763eb60e5e8f 100644 --- a/drivers/rtc/rtc-ds1347.c +++ b/drivers/rtc/rtc-ds1347.c @@ -52,7 +52,7 @@ static int ds1347_read_time(struct device *dev, struct rtc_time *dt) return err; dt->tm_sec = bcd2bin(buf[0]); - dt->tm_min = bcd2bin(buf[1]); + dt->tm_min = bcd2bin(buf[1] & 0x7f); dt->tm_hour = bcd2bin(buf[2] & 0x3F); dt->tm_mday = bcd2bin(buf[3]); dt->tm_mon = bcd2bin(buf[4]) - 1; |