[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1217140707-21263-8-git-send-email-cooloney@kernel.org>
Date: Sun, 27 Jul 2008 14:38:26 +0800
From: Bryan Wu <cooloney@...nel.org>
To: a.zummo@...ertech.it, rtc-linux@...glegroups.com
Cc: akpm@...ux-foundation.org, linux-kernel@...r.kernel.org,
Mike Frysinger <vapier.adi@...il.com>,
Bryan Wu <cooloney@...nel.org>
Subject: [PATCH 7/8] Blackfin RTC Driver: convert PIE handling to irq_set_state() as pointed out by David Brownell
From: Mike Frysinger <vapier.adi@...il.com>
Signed-off-by: Mike Frysinger <vapier.adi@...il.com>
Signed-off-by: Bryan Wu <cooloney@...nel.org>
---
drivers/rtc/rtc-bfin.c | 28 ++++++++++++++++++----------
1 files changed, 18 insertions(+), 10 deletions(-)
diff --git a/drivers/rtc/rtc-bfin.c b/drivers/rtc/rtc-bfin.c
index e6b0470..ceebce7 100644
--- a/drivers/rtc/rtc-bfin.c
+++ b/drivers/rtc/rtc-bfin.c
@@ -264,16 +264,6 @@ static int bfin_rtc_ioctl(struct device *dev, unsigned int cmd, unsigned long ar
bfin_rtc_sync_pending(dev);
switch (cmd) {
- case RTC_PIE_ON:
- dev_dbg_stamp(dev);
- bfin_rtc_int_set(RTC_ISTAT_STOPWATCH);
- bfin_write_RTC_SWCNT(rtc->rtc_dev->irq_freq);
- break;
- case RTC_PIE_OFF:
- dev_dbg_stamp(dev);
- bfin_rtc_int_clear(~RTC_ISTAT_STOPWATCH);
- break;
-
case RTC_UIE_ON:
dev_dbg_stamp(dev);
bfin_rtc_int_set(RTC_ISTAT_SEC);
@@ -381,6 +371,23 @@ static int bfin_rtc_proc(struct device *dev, struct seq_file *seq)
#undef yesno
}
+static int bfin_irq_set_state(struct device *dev, int enabled)
+{
+ struct bfin_rtc *rtc = dev_get_drvdata(dev);
+
+ dev_dbg_stamp(dev);
+
+ bfin_rtc_sync_pending(dev);
+
+ if (enabled) {
+ bfin_rtc_int_set(RTC_ISTAT_STOPWATCH);
+ bfin_write_RTC_SWCNT(rtc->rtc_dev->irq_freq);
+ } else
+ bfin_rtc_int_clear(~RTC_ISTAT_STOPWATCH);
+
+ return 0;
+}
+
static struct rtc_class_ops bfin_rtc_ops = {
.open = bfin_rtc_open,
.release = bfin_rtc_release,
@@ -390,6 +397,7 @@ static struct rtc_class_ops bfin_rtc_ops = {
.read_alarm = bfin_rtc_read_alarm,
.set_alarm = bfin_rtc_set_alarm,
.proc = bfin_rtc_proc,
+ .irq_set_state = bfin_irq_set_state,
};
static int __devinit bfin_rtc_probe(struct platform_device *pdev)
--
1.5.6
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists