aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/rtc
diff options
context:
space:
mode:
authorJohn Stultz <john.stultz@linaro.org>2011-02-03 15:02:07 -0500
committerJohn Stultz <john.stultz@linaro.org>2011-03-09 14:23:35 -0500
commit696160fec162601d06940862b5b3aa4460344c1b (patch)
tree63c5d1d87f140b6a989256727b62071dd19d894b /drivers/rtc
parent80d4bb515b78f38738f3378fd1be6039063ab040 (diff)
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>
Diffstat (limited to 'drivers/rtc')
-rw-r--r--drivers/rtc/rtc-cmos.c26
-rw-r--r--drivers/rtc/rtc-davinci.c17
-rw-r--r--drivers/rtc/rtc-pl031.c21
-rw-r--r--drivers/rtc/rtc-pxa.c15
-rw-r--r--drivers/rtc/rtc-s3c.c1
-rw-r--r--drivers/rtc/rtc-sa1100.c1
-rw-r--r--drivers/rtc/rtc-sh.c1
-rw-r--r--drivers/rtc/rtc-vr41xx.c21
8 files changed, 0 insertions, 103 deletions
diff --git a/drivers/rtc/rtc-cmos.c b/drivers/rtc/rtc-cmos.c
index de632e793d46..bdb1f8e2042a 100644
--- a/drivers/rtc/rtc-cmos.c
+++ b/drivers/rtc/rtc-cmos.c
@@ -375,31 +375,6 @@ static int cmos_set_alarm(struct device *dev, struct rtc_wkalrm *t)
375 return 0; 375 return 0;
376} 376}
377 377
378static 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
403static int cmos_alarm_irq_enable(struct device *dev, unsigned int enabled) 378static int cmos_alarm_irq_enable(struct device *dev, unsigned int enabled)
404{ 379{
405 struct cmos_rtc *cmos = dev_get_drvdata(dev); 380 struct cmos_rtc *cmos = dev_get_drvdata(dev);
@@ -482,7 +457,6 @@ static const struct rtc_class_ops cmos_rtc_ops = {
482 .read_alarm = cmos_read_alarm, 457 .read_alarm = cmos_read_alarm,
483 .set_alarm = cmos_set_alarm, 458 .set_alarm = cmos_set_alarm,
484 .proc = cmos_procfs, 459 .proc = cmos_procfs,
485 .irq_set_freq = cmos_irq_set_freq,
486 .alarm_irq_enable = cmos_alarm_irq_enable, 460 .alarm_irq_enable = cmos_alarm_irq_enable,
487 .update_irq_enable = cmos_update_irq_enable, 461 .update_irq_enable = cmos_update_irq_enable,
488}; 462};
diff --git a/drivers/rtc/rtc-davinci.c b/drivers/rtc/rtc-davinci.c
index 92da73d40e13..dfd98a235ad1 100644
--- a/drivers/rtc/rtc-davinci.c
+++ b/drivers/rtc/rtc-davinci.c
@@ -473,22 +473,6 @@ static int davinci_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alm)
473 return 0; 473 return 0;
474} 474}
475 475
476static 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
492static struct rtc_class_ops davinci_rtc_ops = { 476static struct rtc_class_ops davinci_rtc_ops = {
493 .ioctl = davinci_rtc_ioctl, 477 .ioctl = davinci_rtc_ioctl,
494 .read_time = davinci_rtc_read_time, 478 .read_time = davinci_rtc_read_time,
@@ -496,7 +480,6 @@ static struct rtc_class_ops davinci_rtc_ops = {
496 .alarm_irq_enable = davinci_rtc_alarm_irq_enable, 480 .alarm_irq_enable = davinci_rtc_alarm_irq_enable,
497 .read_alarm = davinci_rtc_read_alarm, 481 .read_alarm = davinci_rtc_read_alarm,
498 .set_alarm = davinci_rtc_set_alarm, 482 .set_alarm = davinci_rtc_set_alarm,
499 .irq_set_freq = davinci_rtc_irq_set_freq,
500}; 483};
501 484
502static int __init davinci_rtc_probe(struct platform_device *pdev) 485static int __init davinci_rtc_probe(struct platform_device *pdev)
diff --git a/drivers/rtc/rtc-pl031.c b/drivers/rtc/rtc-pl031.c
index 0e7c15b24c1c..d829ea63c4fb 100644
--- a/drivers/rtc/rtc-pl031.c
+++ b/drivers/rtc/rtc-pl031.c
@@ -293,25 +293,6 @@ static int pl031_set_alarm(struct device *dev, struct rtc_wkalrm *alarm)
293 return ret; 293 return ret;
294} 294}
295 295
296static 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
315static int pl031_remove(struct amba_device *adev) 296static int pl031_remove(struct amba_device *adev)
316{ 297{
317 struct pl031_local *ldata = dev_get_drvdata(&adev->dev); 298 struct pl031_local *ldata = dev_get_drvdata(&adev->dev);
@@ -408,7 +389,6 @@ static struct rtc_class_ops stv1_pl031_ops = {
408 .read_alarm = pl031_read_alarm, 389 .read_alarm = pl031_read_alarm,
409 .set_alarm = pl031_set_alarm, 390 .set_alarm = pl031_set_alarm,
410 .alarm_irq_enable = pl031_alarm_irq_enable, 391 .alarm_irq_enable = pl031_alarm_irq_enable,
411 .irq_set_freq = pl031_irq_set_freq,
412}; 392};
413 393
414/* And the second ST derivative */ 394/* And the second ST derivative */
@@ -418,7 +398,6 @@ static struct rtc_class_ops stv2_pl031_ops = {
418 .read_alarm = pl031_stv2_read_alarm, 398 .read_alarm = pl031_stv2_read_alarm,
419 .set_alarm = pl031_stv2_set_alarm, 399 .set_alarm = pl031_stv2_set_alarm,
420 .alarm_irq_enable = pl031_alarm_irq_enable, 400 .alarm_irq_enable = pl031_alarm_irq_enable,
421 .irq_set_freq = pl031_irq_set_freq,
422}; 401};
423 402
424static struct amba_id pl031_ids[] = { 403static struct amba_id pl031_ids[] = {
diff --git a/drivers/rtc/rtc-pxa.c b/drivers/rtc/rtc-pxa.c
index b216ae5389c8..a1fdc802598a 100644
--- a/drivers/rtc/rtc-pxa.c
+++ b/drivers/rtc/rtc-pxa.c
@@ -209,20 +209,6 @@ static void pxa_rtc_release(struct device *dev)
209 free_irq(pxa_rtc->irq_1Hz, dev); 209 free_irq(pxa_rtc->irq_1Hz, dev);
210} 210}
211 211
212static 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
226static int pxa_alarm_irq_enable(struct device *dev, unsigned int enabled) 212static int pxa_alarm_irq_enable(struct device *dev, unsigned int enabled)
227{ 213{
228 struct pxa_rtc *pxa_rtc = dev_get_drvdata(dev); 214 struct pxa_rtc *pxa_rtc = dev_get_drvdata(dev);
@@ -336,7 +322,6 @@ static const struct rtc_class_ops pxa_rtc_ops = {
336 .alarm_irq_enable = pxa_alarm_irq_enable, 322 .alarm_irq_enable = pxa_alarm_irq_enable,
337 .update_irq_enable = pxa_update_irq_enable, 323 .update_irq_enable = pxa_update_irq_enable,
338 .proc = pxa_rtc_proc, 324 .proc = pxa_rtc_proc,
339 .irq_set_freq = pxa_periodic_irq_set_freq,
340}; 325};
341 326
342static int __init pxa_rtc_probe(struct platform_device *pdev) 327static int __init pxa_rtc_probe(struct platform_device *pdev)
diff --git a/drivers/rtc/rtc-s3c.c b/drivers/rtc/rtc-s3c.c
index 80fb7e72f9d9..714964913e5e 100644
--- a/drivers/rtc/rtc-s3c.c
+++ b/drivers/rtc/rtc-s3c.c
@@ -348,7 +348,6 @@ static const struct rtc_class_ops s3c_rtcops = {
348 .set_time = s3c_rtc_settime, 348 .set_time = s3c_rtc_settime,
349 .read_alarm = s3c_rtc_getalarm, 349 .read_alarm = s3c_rtc_getalarm,
350 .set_alarm = s3c_rtc_setalarm, 350 .set_alarm = s3c_rtc_setalarm,
351 .irq_set_freq = s3c_rtc_setfreq,
352 .proc = s3c_rtc_proc, 351 .proc = s3c_rtc_proc,
353 .alarm_irq_enable = s3c_rtc_setaie, 352 .alarm_irq_enable = s3c_rtc_setaie,
354}; 353};
diff --git a/drivers/rtc/rtc-sa1100.c b/drivers/rtc/rtc-sa1100.c
index d47b3fc9830f..d1a2b0bc3b24 100644
--- a/drivers/rtc/rtc-sa1100.c
+++ b/drivers/rtc/rtc-sa1100.c
@@ -392,7 +392,6 @@ static const struct rtc_class_ops sa1100_rtc_ops = {
392 .read_alarm = sa1100_rtc_read_alarm, 392 .read_alarm = sa1100_rtc_read_alarm,
393 .set_alarm = sa1100_rtc_set_alarm, 393 .set_alarm = sa1100_rtc_set_alarm,
394 .proc = sa1100_rtc_proc, 394 .proc = sa1100_rtc_proc,
395 .irq_set_freq = sa1100_irq_set_freq,
396 .alarm_irq_enable = sa1100_rtc_alarm_irq_enable, 395 .alarm_irq_enable = sa1100_rtc_alarm_irq_enable,
397}; 396};
398 397
diff --git a/drivers/rtc/rtc-sh.c b/drivers/rtc/rtc-sh.c
index ff50a8bc13f6..148544979a54 100644
--- a/drivers/rtc/rtc-sh.c
+++ b/drivers/rtc/rtc-sh.c
@@ -603,7 +603,6 @@ static struct rtc_class_ops sh_rtc_ops = {
603 .set_time = sh_rtc_set_time, 603 .set_time = sh_rtc_set_time,
604 .read_alarm = sh_rtc_read_alarm, 604 .read_alarm = sh_rtc_read_alarm,
605 .set_alarm = sh_rtc_set_alarm, 605 .set_alarm = sh_rtc_set_alarm,
606 .irq_set_freq = sh_rtc_irq_set_freq,
607 .proc = sh_rtc_proc, 606 .proc = sh_rtc_proc,
608 .alarm_irq_enable = sh_rtc_alarm_irq_enable, 607 .alarm_irq_enable = sh_rtc_alarm_irq_enable,
609}; 608};
diff --git a/drivers/rtc/rtc-vr41xx.c b/drivers/rtc/rtc-vr41xx.c
index 86f14909f9db..c5698cda366a 100644
--- a/drivers/rtc/rtc-vr41xx.c
+++ b/drivers/rtc/rtc-vr41xx.c
@@ -207,26 +207,6 @@ static int vr41xx_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *wkalrm)
207 return 0; 207 return 0;
208} 208}
209 209
210static 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
230static int vr41xx_rtc_ioctl(struct device *dev, unsigned int cmd, unsigned long arg) 210static int vr41xx_rtc_ioctl(struct device *dev, unsigned int cmd, unsigned long arg)
231{ 211{
232 switch (cmd) { 212 switch (cmd) {
@@ -298,7 +278,6 @@ static const struct rtc_class_ops vr41xx_rtc_ops = {
298 .set_time = vr41xx_rtc_set_time, 278 .set_time = vr41xx_rtc_set_time,
299 .read_alarm = vr41xx_rtc_read_alarm, 279 .read_alarm = vr41xx_rtc_read_alarm,
300 .set_alarm = vr41xx_rtc_set_alarm, 280 .set_alarm = vr41xx_rtc_set_alarm,
301 .irq_set_freq = vr41xx_rtc_irq_set_freq,
302}; 281};
303 282
304static int __devinit rtc_probe(struct platform_device *pdev) 283static int __devinit rtc_probe(struct platform_device *pdev)