summaryrefslogtreecommitdiffstats
path: root/drivers/rtc/rtc-lp8788.c
diff options
context:
space:
mode:
authorNishanth Menon <nm@ti.com>2015-04-20 19:51:34 -0500
committerAlexandre Belloni <alexandre.belloni@free-electrons.com>2015-06-25 01:13:46 +0200
commite3edd67141a1ea5294e54b17fee5becf1090f5d4 (patch)
treebd66e6f402abcb86de94252d77bd7bf3a4ace9c9 /drivers/rtc/rtc-lp8788.c
parent4be1f6bbd1e968ab02653c28eababd9480dfff77 (diff)
downloadtalos-op-linux-e3edd67141a1ea5294e54b17fee5becf1090f5d4.tar.gz
talos-op-linux-e3edd67141a1ea5294e54b17fee5becf1090f5d4.zip
rtc: ds1307: Enable the mcp794xx alarm after programming time
Alarm interrupt enable register is at offset 0x7, while the time registers for the alarm follow that. When we program Alarm interrupt enable prior to programming the time, it is possible that previous time value could be close or match at the time of alarm enable resulting in interrupt trigger which is unexpected (and does not match the time we expect it to trigger). To prevent this scenario from occuring, program the ALM0_EN bit only after the alarm time is appropriately programmed. Ofcourse, I2C programming is non-atomic, so there are loopholes where the interrupt wont trigger if the time requested is in the past at the time of programming the ALM0_EN bit. However, we will not have unexpected interrupts while the time is programmed after the interrupt are enabled. Signed-off-by: Nishanth Menon <nm@ti.com> Reviewed-by: Grygorii Strashko <grygorii.strashko@linaro.org> Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
Diffstat (limited to 'drivers/rtc/rtc-lp8788.c')
0 files changed, 0 insertions, 0 deletions
OpenPOWER on IntegriCloud