Skip to content

Commit 07187ee

Browse files
Wolfram Sangjohnstultz-work
authored andcommitted
rtc: vt8500: Use define instead of hardcoded value for status bit
Fixes the vt8500 driver to use a define value for the isr is-alarm bit. Cc: Alexey Charkov <alchark@gmail.com> Signed-off-by: Wolfram Sang <w.sang@pengutronix.de> Signed-off-by: John Stultz <john.stultz@linaro.org>
1 parent daf54f1 commit 07187ee

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

‎drivers/rtc/rtc-vt8500.c‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,8 @@
7474
#define VT8500_RTC_CR_SM_SEC (1 << 3) /* 0: 1Hz/60, 1: 1Hz */
7575
#define VT8500_RTC_CR_CALIB (1 << 4) /* Enable calibration */
7676

77+
#define VT8500_RTC_IS_ALARM (1 << 0) /* Alarm interrupt status */
78+
7779
struct vt8500_rtc {
7880
void __iomem *regbase;
7981
struct resource *res;
@@ -96,7 +98,7 @@ static irqreturn_t vt8500_rtc_irq(int irq, void *dev_id)
9698

9799
spin_unlock(&vt8500_rtc->lock);
98100

99-
if (isr & 1)
101+
if (isr & VT8500_RTC_IS_ALARM)
100102
events |= RTC_AF | RTC_IRQF;
101103

102104
rtc_update_irq(vt8500_rtc->rtc, 1, events);
@@ -161,8 +163,8 @@ static int vt8500_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *alrm)
161163
alrm->time.tm_sec = bcd2bin((alarm & TIME_SEC_MASK));
162164

163165
alrm->enabled = (alarm & ALARM_ENABLE_MASK) ? 1 : 0;
166+
alrm->pending = (isr & VT8500_RTC_IS_ALARM) ? 1 : 0;
164167

165-
alrm->pending = (isr & 1) ? 1 : 0;
166168
return rtc_valid_tm(&alrm->time);
167169
}
168170

0 commit comments

Comments
 (0)