Commit 696160fe authored by John Stultz's avatar John Stultz

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: default avatarJohn Stultz <john.stultz@linaro.org>
parent 80d4bb51
...@@ -375,31 +375,6 @@ static int cmos_set_alarm(struct device *dev, struct rtc_wkalrm *t) ...@@ -375,31 +375,6 @@ static int cmos_set_alarm(struct device *dev, struct rtc_wkalrm *t)
return 0; return 0;
} }
static int cmos_irq_set_freq(struct device *dev, int freq)
{
struct cmos_rtc *cmos = dev_get_drvdata(dev);
int f;
unsigned long flags;
if (!is_valid_irq(cmos->irq))
return -ENXIO;
if (!is_power_of_2(freq))
return -EINVAL;
/* 0 = no irqs; 1 = 2^15 Hz ... 15 = 2^0 Hz */
f = ffs(freq);
if (f-- > 16)
return -EINVAL;
f = 16 - f;
spin_lock_irqsave(&rtc_lock, flags);
hpet_set_periodic_freq(freq);
CMOS_WRITE(RTC_REF_CLCK_32KHZ | f, RTC_FREQ_SELECT);
spin_unlock_irqrestore(&rtc_lock, flags);
return 0;
}
static int cmos_alarm_irq_enable(struct device *dev, unsigned int enabled) static int cmos_alarm_irq_enable(struct device *dev, unsigned int enabled)
{ {
struct cmos_rtc *cmos = dev_get_drvdata(dev); struct cmos_rtc *cmos = dev_get_drvdata(dev);
...@@ -482,7 +457,6 @@ static const struct rtc_class_ops cmos_rtc_ops = { ...@@ -482,7 +457,6 @@ static const struct rtc_class_ops cmos_rtc_ops = {
.read_alarm = cmos_read_alarm, .read_alarm = cmos_read_alarm,
.set_alarm = cmos_set_alarm, .set_alarm = cmos_set_alarm,
.proc = cmos_procfs, .proc = cmos_procfs,
.irq_set_freq = cmos_irq_set_freq,
.alarm_irq_enable = cmos_alarm_irq_enable, .alarm_irq_enable = cmos_alarm_irq_enable,
.update_irq_enable = cmos_update_irq_enable, .update_irq_enable = cmos_update_irq_enable,
}; };
......
...@@ -473,22 +473,6 @@ static int davinci_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alm) ...@@ -473,22 +473,6 @@ static int davinci_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alm)
return 0; return 0;
} }
static int davinci_rtc_irq_set_freq(struct device *dev, int freq)
{
struct davinci_rtc *davinci_rtc = dev_get_drvdata(dev);
unsigned long flags;
u16 tmr_counter = (0x8000 >> (ffs(freq) - 1));
spin_lock_irqsave(&davinci_rtc_lock, flags);
rtcss_write(davinci_rtc, tmr_counter & 0xFF, PRTCSS_RTC_TMR0);
rtcss_write(davinci_rtc, (tmr_counter & 0xFF00) >> 8, PRTCSS_RTC_TMR1);
spin_unlock_irqrestore(&davinci_rtc_lock, flags);
return 0;
}
static struct rtc_class_ops davinci_rtc_ops = { static struct rtc_class_ops davinci_rtc_ops = {
.ioctl = davinci_rtc_ioctl, .ioctl = davinci_rtc_ioctl,
.read_time = davinci_rtc_read_time, .read_time = davinci_rtc_read_time,
...@@ -496,7 +480,6 @@ static struct rtc_class_ops davinci_rtc_ops = { ...@@ -496,7 +480,6 @@ static struct rtc_class_ops davinci_rtc_ops = {
.alarm_irq_enable = davinci_rtc_alarm_irq_enable, .alarm_irq_enable = davinci_rtc_alarm_irq_enable,
.read_alarm = davinci_rtc_read_alarm, .read_alarm = davinci_rtc_read_alarm,
.set_alarm = davinci_rtc_set_alarm, .set_alarm = davinci_rtc_set_alarm,
.irq_set_freq = davinci_rtc_irq_set_freq,
}; };
static int __init davinci_rtc_probe(struct platform_device *pdev) static int __init davinci_rtc_probe(struct platform_device *pdev)
......
...@@ -293,25 +293,6 @@ static int pl031_set_alarm(struct device *dev, struct rtc_wkalrm *alarm) ...@@ -293,25 +293,6 @@ static int pl031_set_alarm(struct device *dev, struct rtc_wkalrm *alarm)
return ret; return ret;
} }
static int pl031_irq_set_freq(struct device *dev, int freq)
{
struct pl031_local *ldata = dev_get_drvdata(dev);
/* Cant set timer if it is already enabled */
if (readl(ldata->base + RTC_TCR) & RTC_TCR_EN) {
dev_err(dev, "can't change frequency while timer enabled\n");
return -EINVAL;
}
/* If self start bit in RTC_TCR is set timer will start here,
* but we never set that bit. Instead we start the timer when
* set_state is called with enabled == 1.
*/
writel(RTC_TIMER_FREQ / freq, ldata->base + RTC_TLR);
return 0;
}
static int pl031_remove(struct amba_device *adev) static int pl031_remove(struct amba_device *adev)
{ {
struct pl031_local *ldata = dev_get_drvdata(&adev->dev); struct pl031_local *ldata = dev_get_drvdata(&adev->dev);
...@@ -408,7 +389,6 @@ static struct rtc_class_ops stv1_pl031_ops = { ...@@ -408,7 +389,6 @@ static struct rtc_class_ops stv1_pl031_ops = {
.read_alarm = pl031_read_alarm, .read_alarm = pl031_read_alarm,
.set_alarm = pl031_set_alarm, .set_alarm = pl031_set_alarm,
.alarm_irq_enable = pl031_alarm_irq_enable, .alarm_irq_enable = pl031_alarm_irq_enable,
.irq_set_freq = pl031_irq_set_freq,
}; };
/* And the second ST derivative */ /* And the second ST derivative */
...@@ -418,7 +398,6 @@ static struct rtc_class_ops stv2_pl031_ops = { ...@@ -418,7 +398,6 @@ static struct rtc_class_ops stv2_pl031_ops = {
.read_alarm = pl031_stv2_read_alarm, .read_alarm = pl031_stv2_read_alarm,
.set_alarm = pl031_stv2_set_alarm, .set_alarm = pl031_stv2_set_alarm,
.alarm_irq_enable = pl031_alarm_irq_enable, .alarm_irq_enable = pl031_alarm_irq_enable,
.irq_set_freq = pl031_irq_set_freq,
}; };
static struct amba_id pl031_ids[] = { static struct amba_id pl031_ids[] = {
......
...@@ -209,20 +209,6 @@ static void pxa_rtc_release(struct device *dev) ...@@ -209,20 +209,6 @@ static void pxa_rtc_release(struct device *dev)
free_irq(pxa_rtc->irq_1Hz, dev); free_irq(pxa_rtc->irq_1Hz, dev);
} }
static int pxa_periodic_irq_set_freq(struct device *dev, int freq)
{
struct pxa_rtc *pxa_rtc = dev_get_drvdata(dev);
int period_ms;
if (freq < 1 || freq > MAXFREQ_PERIODIC)
return -EINVAL;
period_ms = 1000 / freq;
rtc_writel(pxa_rtc, PIAR, period_ms);
return 0;
}
static int pxa_alarm_irq_enable(struct device *dev, unsigned int enabled) static int pxa_alarm_irq_enable(struct device *dev, unsigned int enabled)
{ {
struct pxa_rtc *pxa_rtc = dev_get_drvdata(dev); struct pxa_rtc *pxa_rtc = dev_get_drvdata(dev);
...@@ -336,7 +322,6 @@ static const struct rtc_class_ops pxa_rtc_ops = { ...@@ -336,7 +322,6 @@ static const struct rtc_class_ops pxa_rtc_ops = {
.alarm_irq_enable = pxa_alarm_irq_enable, .alarm_irq_enable = pxa_alarm_irq_enable,
.update_irq_enable = pxa_update_irq_enable, .update_irq_enable = pxa_update_irq_enable,
.proc = pxa_rtc_proc, .proc = pxa_rtc_proc,
.irq_set_freq = pxa_periodic_irq_set_freq,
}; };
static int __init pxa_rtc_probe(struct platform_device *pdev) static int __init pxa_rtc_probe(struct platform_device *pdev)
......
...@@ -348,7 +348,6 @@ static const struct rtc_class_ops s3c_rtcops = { ...@@ -348,7 +348,6 @@ static const struct rtc_class_ops s3c_rtcops = {
.set_time = s3c_rtc_settime, .set_time = s3c_rtc_settime,
.read_alarm = s3c_rtc_getalarm, .read_alarm = s3c_rtc_getalarm,
.set_alarm = s3c_rtc_setalarm, .set_alarm = s3c_rtc_setalarm,
.irq_set_freq = s3c_rtc_setfreq,
.proc = s3c_rtc_proc, .proc = s3c_rtc_proc,
.alarm_irq_enable = s3c_rtc_setaie, .alarm_irq_enable = s3c_rtc_setaie,
}; };
......
...@@ -392,7 +392,6 @@ static const struct rtc_class_ops sa1100_rtc_ops = { ...@@ -392,7 +392,6 @@ static const struct rtc_class_ops sa1100_rtc_ops = {
.read_alarm = sa1100_rtc_read_alarm, .read_alarm = sa1100_rtc_read_alarm,
.set_alarm = sa1100_rtc_set_alarm, .set_alarm = sa1100_rtc_set_alarm,
.proc = sa1100_rtc_proc, .proc = sa1100_rtc_proc,
.irq_set_freq = sa1100_irq_set_freq,
.alarm_irq_enable = sa1100_rtc_alarm_irq_enable, .alarm_irq_enable = sa1100_rtc_alarm_irq_enable,
}; };
......
...@@ -603,7 +603,6 @@ static struct rtc_class_ops sh_rtc_ops = { ...@@ -603,7 +603,6 @@ static struct rtc_class_ops sh_rtc_ops = {
.set_time = sh_rtc_set_time, .set_time = sh_rtc_set_time,
.read_alarm = sh_rtc_read_alarm, .read_alarm = sh_rtc_read_alarm,
.set_alarm = sh_rtc_set_alarm, .set_alarm = sh_rtc_set_alarm,
.irq_set_freq = sh_rtc_irq_set_freq,
.proc = sh_rtc_proc, .proc = sh_rtc_proc,
.alarm_irq_enable = sh_rtc_alarm_irq_enable, .alarm_irq_enable = sh_rtc_alarm_irq_enable,
}; };
......
...@@ -207,26 +207,6 @@ static int vr41xx_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *wkalrm) ...@@ -207,26 +207,6 @@ static int vr41xx_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *wkalrm)
return 0; return 0;
} }
static int vr41xx_rtc_irq_set_freq(struct device *dev, int freq)
{
u64 count;
if (!is_power_of_2(freq))
return -EINVAL;
count = RTC_FREQUENCY;
do_div(count, freq);
spin_lock_irq(&rtc_lock);
periodic_count = count;
rtc1_write(RTCL1LREG, periodic_count);
rtc1_write(RTCL1HREG, periodic_count >> 16);
spin_unlock_irq(&rtc_lock);
return 0;
}
static int vr41xx_rtc_ioctl(struct device *dev, unsigned int cmd, unsigned long arg) static int vr41xx_rtc_ioctl(struct device *dev, unsigned int cmd, unsigned long arg)
{ {
switch (cmd) { switch (cmd) {
...@@ -298,7 +278,6 @@ static const struct rtc_class_ops vr41xx_rtc_ops = { ...@@ -298,7 +278,6 @@ static const struct rtc_class_ops vr41xx_rtc_ops = {
.set_time = vr41xx_rtc_set_time, .set_time = vr41xx_rtc_set_time,
.read_alarm = vr41xx_rtc_read_alarm, .read_alarm = vr41xx_rtc_read_alarm,
.set_alarm = vr41xx_rtc_set_alarm, .set_alarm = vr41xx_rtc_set_alarm,
.irq_set_freq = vr41xx_rtc_irq_set_freq,
}; };
static int __devinit rtc_probe(struct platform_device *pdev) static int __devinit rtc_probe(struct platform_device *pdev)
......
...@@ -133,7 +133,6 @@ extern struct class *rtc_class; ...@@ -133,7 +133,6 @@ extern struct class *rtc_class;
* The (current) exceptions are mostly filesystem hooks: * The (current) exceptions are mostly filesystem hooks:
* - the proc() hook for procfs * - the proc() hook for procfs
* - non-ioctl() chardev hooks: open(), release(), read_callback() * - non-ioctl() chardev hooks: open(), release(), read_callback()
* - periodic irq calls: irq_set_state(), irq_set_freq()
* *
* REVISIT those periodic irq calls *do* have ops_lock when they're * REVISIT those periodic irq calls *do* have ops_lock when they're
* issued through ioctl() ... * issued through ioctl() ...
...@@ -148,7 +147,6 @@ struct rtc_class_ops { ...@@ -148,7 +147,6 @@ struct rtc_class_ops {
int (*set_alarm)(struct device *, struct rtc_wkalrm *); int (*set_alarm)(struct device *, struct rtc_wkalrm *);
int (*proc)(struct device *, struct seq_file *); int (*proc)(struct device *, struct seq_file *);
int (*set_mmss)(struct device *, unsigned long secs); int (*set_mmss)(struct device *, unsigned long secs);
int (*irq_set_freq)(struct device *, int freq);
int (*read_callback)(struct device *, int data); int (*read_callback)(struct device *, int data);
int (*alarm_irq_enable)(struct device *, unsigned int enabled); int (*alarm_irq_enable)(struct device *, unsigned int enabled);
int (*update_irq_enable)(struct device *, unsigned int enabled); int (*update_irq_enable)(struct device *, unsigned int enabled);
......
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