]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
rtc: m41t80: fix SQWE override when setting an alarm
authorGary Bisson <gary.bisson@boundarydevices.com>
Tue, 25 Apr 2017 14:45:14 +0000 (16:45 +0200)
committerAlexandre Belloni <alexandre.belloni@free-electrons.com>
Wed, 31 May 2017 07:17:02 +0000 (09:17 +0200)
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>
drivers/rtc/rtc-m41t80.c

index 5ec4653022fff574ae8d4df2a31531d6963b5ca2..b0749645aa48c4542c86fa0b57ae366d7aa3e6cd 100644 (file)
@@ -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;