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: 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>

authored by Mike Frysinger and committed by Linus Torvalds 26cb8bb2 e12af37d

+14 -32
+14 -32
drivers/rtc/rtc-bfin.c
··· 32 * writes to clear status registers complete immediately. 33 */ 34 35 #include <linux/bcd.h> 36 #include <linux/completion.h> 37 #include <linux/delay.h> ··· 160 bfin_rtc_sync_pending(dev); 161 bfin_write_RTC_PREN(0x1); 162 bfin_write_RTC_ICTL(rtc_ictl); 163 - bfin_write_RTC_SWCNT(0); 164 bfin_write_RTC_ALARM(0); 165 bfin_write_RTC_ISTAT(0xFFFF); 166 rtc->rtc_wrote_regs = 0; ··· 199 if (rtc_istat & (RTC_ISTAT_ALARM | RTC_ISTAT_ALARM_DAY)) { 200 bfin_write_RTC_ISTAT(RTC_ISTAT_ALARM | RTC_ISTAT_ALARM_DAY); 201 events |= RTC_AF | RTC_IRQF; 202 - } 203 - } 204 - 205 - if (rtc_ictl & RTC_ISTAT_STOPWATCH) { 206 - if (rtc_istat & RTC_ISTAT_STOPWATCH) { 207 - bfin_write_RTC_ISTAT(RTC_ISTAT_STOPWATCH); 208 - events |= RTC_PF | RTC_IRQF; 209 - bfin_write_RTC_SWCNT(rtc->rtc_dev->irq_freq); 210 } 211 } 212 ··· 361 seq_printf(seq, 362 "alarm_IRQ\t: %s\n" 363 "wkalarm_IRQ\t: %s\n" 364 - "seconds_IRQ\t: %s\n" 365 - "periodic_IRQ\t: %s\n", 366 yesno(ictl & RTC_ISTAT_ALARM), 367 yesno(ictl & RTC_ISTAT_ALARM_DAY), 368 - yesno(ictl & RTC_ISTAT_SEC), 369 - yesno(ictl & RTC_ISTAT_STOPWATCH)); 370 return 0; 371 #undef yesno 372 - } 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 391 static struct rtc_class_ops bfin_rtc_ops = { ··· 378 .read_alarm = bfin_rtc_read_alarm, 379 .set_alarm = bfin_rtc_set_alarm, 380 .proc = bfin_rtc_proc, 381 - .irq_set_state = bfin_irq_set_state, 382 }; 383 384 static int __devinit bfin_rtc_probe(struct platform_device *pdev) ··· 396 ret = PTR_ERR(rtc->rtc_dev); 397 goto err; 398 } 399 - rtc->rtc_dev->irq_freq = 1; 400 401 platform_set_drvdata(pdev, rtc); 402
··· 32 * writes to clear status registers complete immediately. 33 */ 34 35 + /* It may seem odd that there is no SWCNT code in here (which would be exposed 36 + * via the periodic interrupt event, or PIE). Since the Blackfin RTC peripheral 37 + * runs in units of seconds (N/HZ) but the Linux framework runs in units of HZ 38 + * (2^N HZ), there is no point in keeping code that only provides 1 HZ PIEs. 39 + * The same exact behavior can be accomplished by using the update interrupt 40 + * event (UIE). Maybe down the line the RTC peripheral will suck less in which 41 + * case we can re-introduce PIE support. 42 + */ 43 + 44 #include <linux/bcd.h> 45 #include <linux/completion.h> 46 #include <linux/delay.h> ··· 151 bfin_rtc_sync_pending(dev); 152 bfin_write_RTC_PREN(0x1); 153 bfin_write_RTC_ICTL(rtc_ictl); 154 bfin_write_RTC_ALARM(0); 155 bfin_write_RTC_ISTAT(0xFFFF); 156 rtc->rtc_wrote_regs = 0; ··· 191 if (rtc_istat & (RTC_ISTAT_ALARM | RTC_ISTAT_ALARM_DAY)) { 192 bfin_write_RTC_ISTAT(RTC_ISTAT_ALARM | RTC_ISTAT_ALARM_DAY); 193 events |= RTC_AF | RTC_IRQF; 194 } 195 } 196 ··· 361 seq_printf(seq, 362 "alarm_IRQ\t: %s\n" 363 "wkalarm_IRQ\t: %s\n" 364 + "seconds_IRQ\t: %s\n", 365 yesno(ictl & RTC_ISTAT_ALARM), 366 yesno(ictl & RTC_ISTAT_ALARM_DAY), 367 + yesno(ictl & RTC_ISTAT_SEC)); 368 return 0; 369 #undef yesno 370 } 371 372 static struct rtc_class_ops bfin_rtc_ops = { ··· 397 .read_alarm = bfin_rtc_read_alarm, 398 .set_alarm = bfin_rtc_set_alarm, 399 .proc = bfin_rtc_proc, 400 }; 401 402 static int __devinit bfin_rtc_probe(struct platform_device *pdev) ··· 416 ret = PTR_ERR(rtc->rtc_dev); 417 goto err; 418 } 419 + 420 + /* see comment at top of file about stopwatch/PIE */ 421 + bfin_write_RTC_SWCNT(0); 422 423 platform_set_drvdata(pdev, rtc); 424