rtc: max77663: fix alarm reading bug
Daniel Fu [Wed, 5 Sep 2012 03:45:04 +0000 (11:45 +0800)]
When reading alarm of RTC-max77663, it didn't set alrm->enabled correctly,
if irq is masked, means disable alarm, alrm->enabled should be set to 0,
else it should be 1.

Change-Id: Id0b1ffd9a816643712f33624d7d52cbe7b66b3c3
Signed-off-by: Daniel Fu <danifu@nvidia.com>
Reviewed-on: http://git-master/r/129593
(cherry picked from commit e81b06d36a924dcdf8bb0456e7a50d1634d0365f)

Signed-off-by: Kerwin Wan <kerwinw@nvidia.com>
Change-Id: I21eb95bd6c051963db22e9b4494c6b59c79ae17c
Reviewed-on: http://git-master/r/131124
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>

drivers/rtc/rtc-max77663.c

index 2d22724..978c702 100644 (file)
@@ -431,9 +431,9 @@ static int max77663_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *alrm)
                alrm->time.tm_wday);
 
        if (rtc->irq_mask & RTC_IRQ_ALARM1_MASK)
-               alrm->enabled = 1;
-       else
                alrm->enabled = 0;
+       else
+               alrm->enabled = 1;
 
        return 0;
 }