aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/rtc/rtc-bfin.c28
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
374static 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
384static struct rtc_class_ops bfin_rtc_ops = { 391static 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
395static int __devinit bfin_rtc_probe(struct platform_device *pdev) 403static int __devinit bfin_rtc_probe(struct platform_device *pdev)