Commit 26cb8bb2 authored by Mike Frysinger's avatar Mike Frysinger Committed by Linus Torvalds

blackfin RTC driver: drop PIE/stopwatch code since the hardware can only do a...

blackfin RTC driver: drop PIE/stopwatch code since the hardware can only do a max of 1HZ and this same functionality is provided by UIE
Signed-off-by: default avatarMike Frysinger <vapier.adi@gmail.com>
Signed-off-by: default avatarBryan Wu <cooloney@kernel.org>
Cc: David Brownell <david-b@pacbell.net>
Cc: Alessandro Zummo <a.zummo@towertech.it>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent e12af37d
...@@ -32,6 +32,15 @@ ...@@ -32,6 +32,15 @@
* writes to clear status registers complete immediately. * writes to clear status registers complete immediately.
*/ */
/* It may seem odd that there is no SWCNT code in here (which would be exposed
* via the periodic interrupt event, or PIE). Since the Blackfin RTC peripheral
* runs in units of seconds (N/HZ) but the Linux framework runs in units of HZ
* (2^N HZ), there is no point in keeping code that only provides 1 HZ PIEs.
* The same exact behavior can be accomplished by using the update interrupt
* event (UIE). Maybe down the line the RTC peripheral will suck less in which
* case we can re-introduce PIE support.
*/
#include <linux/bcd.h> #include <linux/bcd.h>
#include <linux/completion.h> #include <linux/completion.h>
#include <linux/delay.h> #include <linux/delay.h>
...@@ -151,7 +160,6 @@ static void bfin_rtc_reset(struct device *dev, u16 rtc_ictl) ...@@ -151,7 +160,6 @@ static void bfin_rtc_reset(struct device *dev, u16 rtc_ictl)
bfin_rtc_sync_pending(dev); bfin_rtc_sync_pending(dev);
bfin_write_RTC_PREN(0x1); bfin_write_RTC_PREN(0x1);
bfin_write_RTC_ICTL(rtc_ictl); bfin_write_RTC_ICTL(rtc_ictl);
bfin_write_RTC_SWCNT(0);
bfin_write_RTC_ALARM(0); bfin_write_RTC_ALARM(0);
bfin_write_RTC_ISTAT(0xFFFF); bfin_write_RTC_ISTAT(0xFFFF);
rtc->rtc_wrote_regs = 0; rtc->rtc_wrote_regs = 0;
...@@ -194,14 +202,6 @@ static irqreturn_t bfin_rtc_interrupt(int irq, void *dev_id) ...@@ -194,14 +202,6 @@ static irqreturn_t bfin_rtc_interrupt(int irq, void *dev_id)
} }
} }
if (rtc_ictl & RTC_ISTAT_STOPWATCH) {
if (rtc_istat & RTC_ISTAT_STOPWATCH) {
bfin_write_RTC_ISTAT(RTC_ISTAT_STOPWATCH);
events |= RTC_PF | RTC_IRQF;
bfin_write_RTC_SWCNT(rtc->rtc_dev->irq_freq);
}
}
if (rtc_ictl & RTC_ISTAT_SEC) { if (rtc_ictl & RTC_ISTAT_SEC) {
if (rtc_istat & RTC_ISTAT_SEC) { if (rtc_istat & RTC_ISTAT_SEC) {
bfin_write_RTC_ISTAT(RTC_ISTAT_SEC); bfin_write_RTC_ISTAT(RTC_ISTAT_SEC);
...@@ -361,33 +361,14 @@ static int bfin_rtc_proc(struct device *dev, struct seq_file *seq) ...@@ -361,33 +361,14 @@ static int bfin_rtc_proc(struct device *dev, struct seq_file *seq)
seq_printf(seq, seq_printf(seq,
"alarm_IRQ\t: %s\n" "alarm_IRQ\t: %s\n"
"wkalarm_IRQ\t: %s\n" "wkalarm_IRQ\t: %s\n"
"seconds_IRQ\t: %s\n" "seconds_IRQ\t: %s\n",
"periodic_IRQ\t: %s\n",
yesno(ictl & RTC_ISTAT_ALARM), yesno(ictl & RTC_ISTAT_ALARM),
yesno(ictl & RTC_ISTAT_ALARM_DAY), yesno(ictl & RTC_ISTAT_ALARM_DAY),
yesno(ictl & RTC_ISTAT_SEC), yesno(ictl & RTC_ISTAT_SEC));
yesno(ictl & RTC_ISTAT_STOPWATCH));
return 0; return 0;
#undef yesno #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 = { static struct rtc_class_ops bfin_rtc_ops = {
.open = bfin_rtc_open, .open = bfin_rtc_open,
.release = bfin_rtc_release, .release = bfin_rtc_release,
...@@ -397,7 +378,6 @@ static struct rtc_class_ops bfin_rtc_ops = { ...@@ -397,7 +378,6 @@ static struct rtc_class_ops bfin_rtc_ops = {
.read_alarm = bfin_rtc_read_alarm, .read_alarm = bfin_rtc_read_alarm,
.set_alarm = bfin_rtc_set_alarm, .set_alarm = bfin_rtc_set_alarm,
.proc = bfin_rtc_proc, .proc = bfin_rtc_proc,
.irq_set_state = bfin_irq_set_state,
}; };
static int __devinit bfin_rtc_probe(struct platform_device *pdev) static int __devinit bfin_rtc_probe(struct platform_device *pdev)
...@@ -416,7 +396,9 @@ static int __devinit bfin_rtc_probe(struct platform_device *pdev) ...@@ -416,7 +396,9 @@ static int __devinit bfin_rtc_probe(struct platform_device *pdev)
ret = PTR_ERR(rtc->rtc_dev); ret = PTR_ERR(rtc->rtc_dev);
goto err; goto err;
} }
rtc->rtc_dev->irq_freq = 1;
/* see comment at top of file about stopwatch/PIE */
bfin_write_RTC_SWCNT(0);
platform_set_drvdata(pdev, rtc); platform_set_drvdata(pdev, rtc);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment