diff options
author | Jin Park <jinyoungp@nvidia.com> | 2011-11-23 10:22:59 +0900 |
---|---|---|
committer | Varun Wadekar <vwadekar@nvidia.com> | 2011-12-08 16:54:01 +0530 |
commit | c63f85d09cd95443ca47276e0f933f68099085f1 (patch) | |
tree | 0a6734ed714fc2a10447d8ac6fb6f7843fcab3f5 /drivers/rtc | |
parent | f3de7d55d19f92a70a20eb1498dc5dffa915ab29 (diff) |
rtc: max77663: Disable alarm wakeup
It should be disabled alarm wakeup to wakeup from sleep
by EN1 input signal.
Bug 849360
Bug 903301
Reviewed-on: http://git-master/r/66321
(cherry picked from commit 4338d09efe5a58e126d92c794aa641bdfa7f5cd0)
Change-Id: If59631bf662f6c4812dcd24cbca65750d5e5b117
Signed-off-by: Jin Park <jinyoungp@nvidia.com>
Reviewed-on: http://git-master/r/67382
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
Diffstat (limited to 'drivers/rtc')
-rw-r--r-- | drivers/rtc/rtc-max77663.c | 53 |
1 files changed, 12 insertions, 41 deletions
diff --git a/drivers/rtc/rtc-max77663.c b/drivers/rtc/rtc-max77663.c index 348387ce9347..a2ecf9327353 100644 --- a/drivers/rtc/rtc-max77663.c +++ b/drivers/rtc/rtc-max77663.c @@ -319,38 +319,15 @@ static int max77663_rtc_alarm_irq_enable(struct device *dev, goto out; /* Config alarm interrupt */ - if (enabled) - max77663_rtc_irq_unmask(rtc, RTC_IRQ_ALARM1_MASK); - else - max77663_rtc_irq_mask(rtc, RTC_IRQ_ALARM1_MASK); - -out: - mutex_unlock(&rtc->io_lock); - return ret; -} - -static int max77663_rtc_update_irq_enable(struct device *dev, - unsigned int enabled) -{ - struct max77663_rtc *rtc = dev_get_drvdata(dev); - int ret = 0; - - if (rtc->irq < 0) - return -ENXIO; - - mutex_lock(&rtc->io_lock); - - /* Handle pending interrupt */ - ret = max77663_rtc_do_irq(rtc); - if (ret < 0) - goto out; - - /* Config update interrupt */ - if (enabled) - max77663_rtc_irq_unmask(rtc, RTC_IRQ_1SEC_MASK); - else - max77663_rtc_irq_mask(rtc, RTC_IRQ_1SEC_MASK); - + if (enabled) { + ret = max77663_rtc_irq_unmask(rtc, RTC_IRQ_ALARM1_MASK); + if (ret < 0) + goto out; + } else { + ret = max77663_rtc_irq_mask(rtc, RTC_IRQ_ALARM1_MASK); + if (ret < 0) + goto out; + } out: mutex_unlock(&rtc->io_lock); return ret; @@ -460,13 +437,6 @@ static int max77663_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alrm) u8 buf[RTC_NR]; int ret; - ret = max77663_rtc_alarm_irq_enable(dev, 0); - if (ret < 0) { - dev_err(rtc->dev, - "rtc_set_alarm: Failed to disable rtc alarm\n"); - return ret; - } - dev_dbg(rtc->dev, "rtc_set_alarm: " "tm: %d-%02d-%02d %02d:%02d:%02d, wday=%d\n", alrm->time.tm_year, alrm->time.tm_mon, alrm->time.tm_mday, @@ -534,9 +504,10 @@ static int max77663_rtc_preinit(struct max77663_rtc *rtc) return ret; } - /* Set alarm to wake-up event from sleep */ + /* It should be disabled alarm wakeup to wakeup from sleep + * by EN1 input signal */ ret = max77663_set_bits(parent, MAX77663_REG_ONOFF_CFG2, - ONOFF_WK_ALARM1_MASK, ONOFF_WK_ALARM1_MASK, 0); + ONOFF_WK_ALARM1_MASK, 0, 0); if (ret < 0) { dev_err(rtc->dev, "preinit: Failed to set onoff cfg2\n"); return ret; |