diff options
author | Mike Frysinger <vapier.adi@gmail.com> | 2008-08-05 16:01:21 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-08-05 17:33:48 -0400 |
commit | e12af37d9ee09c2ac6da26a51c77754dec09fed4 (patch) | |
tree | 35d8f3ebc3f0ad8d24a5002e04d21c0ddff62fd0 | |
parent | 140fab14aef093cedf87f69234474c04fdcec99c (diff) |
blackfin RTC driver: convert PIE handling to irq_set_state() as pointed out by David Brownell
Signed-off-by: Mike Frysinger <vapier.adi@gmail.com>
Signed-off-by: Bryan Wu <cooloney@kernel.org>
Cc: David Brownell <david-b@pacbell.net>
Cc: Alessandro Zummo <a.zummo@towertech.it>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r-- | 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 e6b0470063e8..ceebce7e0a0f 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 | |||
264 | bfin_rtc_sync_pending(dev); | 264 | bfin_rtc_sync_pending(dev); |
265 | 265 | ||
266 | switch (cmd) { | 266 | switch (cmd) { |
267 | case RTC_PIE_ON: | ||
268 | dev_dbg_stamp(dev); | ||
269 | bfin_rtc_int_set(RTC_ISTAT_STOPWATCH); | ||
270 | bfin_write_RTC_SWCNT(rtc->rtc_dev->irq_freq); | ||
271 | break; | ||
272 | case RTC_PIE_OFF: | ||
273 | dev_dbg_stamp(dev); | ||
274 | bfin_rtc_int_clear(~RTC_ISTAT_STOPWATCH); | ||
275 | break; | ||
276 | |||
277 | case RTC_UIE_ON: | 267 | case RTC_UIE_ON: |
278 | dev_dbg_stamp(dev); | 268 | dev_dbg_stamp(dev); |
279 | bfin_rtc_int_set(RTC_ISTAT_SEC); | 269 | bfin_rtc_int_set(RTC_ISTAT_SEC); |
@@ -381,6 +371,23 @@ static int bfin_rtc_proc(struct device *dev, struct seq_file *seq) | |||
381 | #undef yesno | 371 | #undef yesno |
382 | } | 372 | } |
383 | 373 | ||
374 | static int bfin_irq_set_state(struct device *dev, int enabled) | ||
375 | { | ||
376 | struct bfin_rtc *rtc = dev_get_drvdata(dev); | ||
377 | |||
378 | dev_dbg_stamp(dev); | ||
379 | |||
380 | bfin_rtc_sync_pending(dev); | ||
381 | |||
382 | if (enabled) { | ||
383 | bfin_rtc_int_set(RTC_ISTAT_STOPWATCH); | ||
384 | bfin_write_RTC_SWCNT(rtc->rtc_dev->irq_freq); | ||
385 | } else | ||
386 | bfin_rtc_int_clear(~RTC_ISTAT_STOPWATCH); | ||
387 | |||
388 | return 0; | ||
389 | } | ||
390 | |||
384 | static struct rtc_class_ops bfin_rtc_ops = { | 391 | static struct rtc_class_ops bfin_rtc_ops = { |
385 | .open = bfin_rtc_open, | 392 | .open = bfin_rtc_open, |
386 | .release = bfin_rtc_release, | 393 | .release = bfin_rtc_release, |
@@ -390,6 +397,7 @@ static struct rtc_class_ops bfin_rtc_ops = { | |||
390 | .read_alarm = bfin_rtc_read_alarm, | 397 | .read_alarm = bfin_rtc_read_alarm, |
391 | .set_alarm = bfin_rtc_set_alarm, | 398 | .set_alarm = bfin_rtc_set_alarm, |
392 | .proc = bfin_rtc_proc, | 399 | .proc = bfin_rtc_proc, |
400 | .irq_set_state = bfin_irq_set_state, | ||
393 | }; | 401 | }; |
394 | 402 | ||
395 | static int __devinit bfin_rtc_probe(struct platform_device *pdev) | 403 | static int __devinit bfin_rtc_probe(struct platform_device *pdev) |