Commit 696160fec162601d06940862b5b3aa4460344c1b
1 parent
80d4bb515b
Exists in
master
and in
39 other branches
RTC: Cleanup rtc_class_ops->irq_set_freq()
With the generic rtc code now emulating PIE mode irqs via an hrtimer, no one calls the rtc_class_ops->irq_set_freq call. This patch removes the hook and deletes the driver functions if no one else calls them. CC: Thomas Gleixner <tglx@linutronix.de> CC: Alessandro Zummo <a.zummo@towertech.it> CC: Marcelo Roberto Jimenez <mroberto@cpti.cetuc.puc-rio.br> CC: rtc-linux@googlegroups.com Signed-off-by: John Stultz <john.stultz@linaro.org>
Showing 9 changed files with 0 additions and 105 deletions Side-by-side Diff
drivers/rtc/rtc-cmos.c
... | ... | @@ -375,31 +375,6 @@ |
375 | 375 | return 0; |
376 | 376 | } |
377 | 377 | |
378 | -static int cmos_irq_set_freq(struct device *dev, int freq) | |
379 | -{ | |
380 | - struct cmos_rtc *cmos = dev_get_drvdata(dev); | |
381 | - int f; | |
382 | - unsigned long flags; | |
383 | - | |
384 | - if (!is_valid_irq(cmos->irq)) | |
385 | - return -ENXIO; | |
386 | - | |
387 | - if (!is_power_of_2(freq)) | |
388 | - return -EINVAL; | |
389 | - /* 0 = no irqs; 1 = 2^15 Hz ... 15 = 2^0 Hz */ | |
390 | - f = ffs(freq); | |
391 | - if (f-- > 16) | |
392 | - return -EINVAL; | |
393 | - f = 16 - f; | |
394 | - | |
395 | - spin_lock_irqsave(&rtc_lock, flags); | |
396 | - hpet_set_periodic_freq(freq); | |
397 | - CMOS_WRITE(RTC_REF_CLCK_32KHZ | f, RTC_FREQ_SELECT); | |
398 | - spin_unlock_irqrestore(&rtc_lock, flags); | |
399 | - | |
400 | - return 0; | |
401 | -} | |
402 | - | |
403 | 378 | static int cmos_alarm_irq_enable(struct device *dev, unsigned int enabled) |
404 | 379 | { |
405 | 380 | struct cmos_rtc *cmos = dev_get_drvdata(dev); |
... | ... | @@ -482,7 +457,6 @@ |
482 | 457 | .read_alarm = cmos_read_alarm, |
483 | 458 | .set_alarm = cmos_set_alarm, |
484 | 459 | .proc = cmos_procfs, |
485 | - .irq_set_freq = cmos_irq_set_freq, | |
486 | 460 | .alarm_irq_enable = cmos_alarm_irq_enable, |
487 | 461 | .update_irq_enable = cmos_update_irq_enable, |
488 | 462 | }; |
drivers/rtc/rtc-davinci.c
... | ... | @@ -473,22 +473,6 @@ |
473 | 473 | return 0; |
474 | 474 | } |
475 | 475 | |
476 | -static int davinci_rtc_irq_set_freq(struct device *dev, int freq) | |
477 | -{ | |
478 | - struct davinci_rtc *davinci_rtc = dev_get_drvdata(dev); | |
479 | - unsigned long flags; | |
480 | - u16 tmr_counter = (0x8000 >> (ffs(freq) - 1)); | |
481 | - | |
482 | - spin_lock_irqsave(&davinci_rtc_lock, flags); | |
483 | - | |
484 | - rtcss_write(davinci_rtc, tmr_counter & 0xFF, PRTCSS_RTC_TMR0); | |
485 | - rtcss_write(davinci_rtc, (tmr_counter & 0xFF00) >> 8, PRTCSS_RTC_TMR1); | |
486 | - | |
487 | - spin_unlock_irqrestore(&davinci_rtc_lock, flags); | |
488 | - | |
489 | - return 0; | |
490 | -} | |
491 | - | |
492 | 476 | static struct rtc_class_ops davinci_rtc_ops = { |
493 | 477 | .ioctl = davinci_rtc_ioctl, |
494 | 478 | .read_time = davinci_rtc_read_time, |
... | ... | @@ -496,7 +480,6 @@ |
496 | 480 | .alarm_irq_enable = davinci_rtc_alarm_irq_enable, |
497 | 481 | .read_alarm = davinci_rtc_read_alarm, |
498 | 482 | .set_alarm = davinci_rtc_set_alarm, |
499 | - .irq_set_freq = davinci_rtc_irq_set_freq, | |
500 | 483 | }; |
501 | 484 | |
502 | 485 | static int __init davinci_rtc_probe(struct platform_device *pdev) |
drivers/rtc/rtc-pl031.c
... | ... | @@ -293,25 +293,6 @@ |
293 | 293 | return ret; |
294 | 294 | } |
295 | 295 | |
296 | -static int pl031_irq_set_freq(struct device *dev, int freq) | |
297 | -{ | |
298 | - struct pl031_local *ldata = dev_get_drvdata(dev); | |
299 | - | |
300 | - /* Cant set timer if it is already enabled */ | |
301 | - if (readl(ldata->base + RTC_TCR) & RTC_TCR_EN) { | |
302 | - dev_err(dev, "can't change frequency while timer enabled\n"); | |
303 | - return -EINVAL; | |
304 | - } | |
305 | - | |
306 | - /* If self start bit in RTC_TCR is set timer will start here, | |
307 | - * but we never set that bit. Instead we start the timer when | |
308 | - * set_state is called with enabled == 1. | |
309 | - */ | |
310 | - writel(RTC_TIMER_FREQ / freq, ldata->base + RTC_TLR); | |
311 | - | |
312 | - return 0; | |
313 | -} | |
314 | - | |
315 | 296 | static int pl031_remove(struct amba_device *adev) |
316 | 297 | { |
317 | 298 | struct pl031_local *ldata = dev_get_drvdata(&adev->dev); |
... | ... | @@ -408,7 +389,6 @@ |
408 | 389 | .read_alarm = pl031_read_alarm, |
409 | 390 | .set_alarm = pl031_set_alarm, |
410 | 391 | .alarm_irq_enable = pl031_alarm_irq_enable, |
411 | - .irq_set_freq = pl031_irq_set_freq, | |
412 | 392 | }; |
413 | 393 | |
414 | 394 | /* And the second ST derivative */ |
... | ... | @@ -418,7 +398,6 @@ |
418 | 398 | .read_alarm = pl031_stv2_read_alarm, |
419 | 399 | .set_alarm = pl031_stv2_set_alarm, |
420 | 400 | .alarm_irq_enable = pl031_alarm_irq_enable, |
421 | - .irq_set_freq = pl031_irq_set_freq, | |
422 | 401 | }; |
423 | 402 | |
424 | 403 | static struct amba_id pl031_ids[] = { |
drivers/rtc/rtc-pxa.c
... | ... | @@ -209,20 +209,6 @@ |
209 | 209 | free_irq(pxa_rtc->irq_1Hz, dev); |
210 | 210 | } |
211 | 211 | |
212 | -static int pxa_periodic_irq_set_freq(struct device *dev, int freq) | |
213 | -{ | |
214 | - struct pxa_rtc *pxa_rtc = dev_get_drvdata(dev); | |
215 | - int period_ms; | |
216 | - | |
217 | - if (freq < 1 || freq > MAXFREQ_PERIODIC) | |
218 | - return -EINVAL; | |
219 | - | |
220 | - period_ms = 1000 / freq; | |
221 | - rtc_writel(pxa_rtc, PIAR, period_ms); | |
222 | - | |
223 | - return 0; | |
224 | -} | |
225 | - | |
226 | 212 | static int pxa_alarm_irq_enable(struct device *dev, unsigned int enabled) |
227 | 213 | { |
228 | 214 | struct pxa_rtc *pxa_rtc = dev_get_drvdata(dev); |
... | ... | @@ -336,7 +322,6 @@ |
336 | 322 | .alarm_irq_enable = pxa_alarm_irq_enable, |
337 | 323 | .update_irq_enable = pxa_update_irq_enable, |
338 | 324 | .proc = pxa_rtc_proc, |
339 | - .irq_set_freq = pxa_periodic_irq_set_freq, | |
340 | 325 | }; |
341 | 326 | |
342 | 327 | static int __init pxa_rtc_probe(struct platform_device *pdev) |
drivers/rtc/rtc-s3c.c
drivers/rtc/rtc-sa1100.c
drivers/rtc/rtc-sh.c
drivers/rtc/rtc-vr41xx.c
... | ... | @@ -207,26 +207,6 @@ |
207 | 207 | return 0; |
208 | 208 | } |
209 | 209 | |
210 | -static int vr41xx_rtc_irq_set_freq(struct device *dev, int freq) | |
211 | -{ | |
212 | - u64 count; | |
213 | - | |
214 | - if (!is_power_of_2(freq)) | |
215 | - return -EINVAL; | |
216 | - count = RTC_FREQUENCY; | |
217 | - do_div(count, freq); | |
218 | - | |
219 | - spin_lock_irq(&rtc_lock); | |
220 | - | |
221 | - periodic_count = count; | |
222 | - rtc1_write(RTCL1LREG, periodic_count); | |
223 | - rtc1_write(RTCL1HREG, periodic_count >> 16); | |
224 | - | |
225 | - spin_unlock_irq(&rtc_lock); | |
226 | - | |
227 | - return 0; | |
228 | -} | |
229 | - | |
230 | 210 | static int vr41xx_rtc_ioctl(struct device *dev, unsigned int cmd, unsigned long arg) |
231 | 211 | { |
232 | 212 | switch (cmd) { |
... | ... | @@ -298,7 +278,6 @@ |
298 | 278 | .set_time = vr41xx_rtc_set_time, |
299 | 279 | .read_alarm = vr41xx_rtc_read_alarm, |
300 | 280 | .set_alarm = vr41xx_rtc_set_alarm, |
301 | - .irq_set_freq = vr41xx_rtc_irq_set_freq, | |
302 | 281 | }; |
303 | 282 | |
304 | 283 | static int __devinit rtc_probe(struct platform_device *pdev) |
include/linux/rtc.h
... | ... | @@ -133,7 +133,6 @@ |
133 | 133 | * The (current) exceptions are mostly filesystem hooks: |
134 | 134 | * - the proc() hook for procfs |
135 | 135 | * - non-ioctl() chardev hooks: open(), release(), read_callback() |
136 | - * - periodic irq calls: irq_set_state(), irq_set_freq() | |
137 | 136 | * |
138 | 137 | * REVISIT those periodic irq calls *do* have ops_lock when they're |
139 | 138 | * issued through ioctl() ... |
... | ... | @@ -148,7 +147,6 @@ |
148 | 147 | int (*set_alarm)(struct device *, struct rtc_wkalrm *); |
149 | 148 | int (*proc)(struct device *, struct seq_file *); |
150 | 149 | int (*set_mmss)(struct device *, unsigned long secs); |
151 | - int (*irq_set_freq)(struct device *, int freq); | |
152 | 150 | int (*read_callback)(struct device *, int data); |
153 | 151 | int (*alarm_irq_enable)(struct device *, unsigned int enabled); |
154 | 152 | int (*update_irq_enable)(struct device *, unsigned int enabled); |