From: luowei Date: Sat, 7 Sep 2013 08:27:02 +0000 (+0800) Subject: rtc-HYM8563:close intterupt while disable alarm X-Git-Tag: firefly_0821_release~6648 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=50daeab0c8755864d2c7081f0e0cb0b673d9f5e4;p=firefly-linux-kernel-4.4.55.git rtc-HYM8563:close intterupt while disable alarm --- diff --git a/drivers/rtc/rtc-HYM8563.c b/drivers/rtc/rtc-HYM8563.c index 1e17cd340277..d6d8fc6bb30d 100755 --- a/drivers/rtc/rtc-HYM8563.c +++ b/drivers/rtc/rtc-HYM8563.c @@ -307,9 +307,19 @@ static int hym8563_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alarm) if((diff_sec > 0) && (diff_sec < 256)) { - printk("%s:diff_sec= %ds , use time\n",__func__, diff_sec); - hym8563_enable_count(client, 1); - hym8563_set_count(client, diff_sec); + printk("%s:diff_sec= %ds , use time\n",__func__, diff_sec); + + if (alarm->enabled == 1) + { + hym8563_set_count(client, diff_sec); + hym8563_enable_count(client, 1); + } + + else + { + hym8563_enable_count(client, 0); + } + } else { @@ -354,7 +364,6 @@ static int hym8563_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alarm) regs[0] |= AIE; else regs[0] &= 0x0; - regs[0] |= TIE; hym8563_i2c_set_regs(client, RTC_CTL2, regs, 1); hym8563_i2c_read_regs(client, RTC_CTL2, regs, 1);