rtc: max77663: Update read buffer before read RTC IRQ status register
Jinyoung Park [Tue, 6 Mar 2012 12:54:26 +0000 (21:54 +0900)]
To get actual current RTC IRQ status, it have to update read buffer
before read RTC IRQ status register.

Bug 918156
Bug 924219

Signed-off-by: Jinyoung Park <jinyoungp@nvidia.com>
Reviewed-on: http://git-master/r/88037
(cherry picked from commit 50528b7d136624ef0014deecba18d7bd9b8d8cc8)

Change-Id: I5ffcc9b24fec0f3688f641ab9f7cf82a69d77aeb
Reviewed-on: http://git-master/r/89738
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Varun Colbert <vcolbert@nvidia.com>
Tested-by: Varun Colbert <vcolbert@nvidia.com>

drivers/rtc/rtc-max77663.c

index a2ecf93..1354b83 100644 (file)
@@ -273,6 +273,12 @@ static inline int max77663_rtc_do_irq(struct max77663_rtc *rtc)
        u8 irq_status;
        int ret;
 
+       ret = max77663_rtc_update_buffer(rtc, 0);
+       if (ret < 0) {
+               dev_err(rtc->dev, "rtc_irq: Failed to get rtc update buffer\n");
+               return ret;
+       }
+
        ret = max77663_read(parent, MAX77663_RTC_IRQ, &irq_status, 1, 1);
        if (ret < 0) {
                dev_err(rtc->dev, "rtc_irq: Failed to get rtc irq status\n");