Skip to content

Commit

Permalink
RTC: Cleanup rtc_class_ops->update_irq_enable()
Browse files Browse the repository at this point in the history
Now that the generic code handles UIE mode irqs via periodic
alarm interrupts, no one calls the
rtc_class_ops->update_irq_enable() method anymore.

This patch removes the driver hooks and implementations of
update_irq_enable if no one else is calling it.

CC: Thomas Gleixner <[email protected]>
CC: Alessandro Zummo <[email protected]>
CC: Marcelo Roberto Jimenez <[email protected]>
CC: [email protected]
Signed-off-by: John Stultz <[email protected]>
  • Loading branch information
johnstultz-work committed Mar 9, 2011
1 parent 696160f commit 51ba60c
Show file tree
Hide file tree
Showing 17 changed files with 1 addition and 237 deletions.
20 changes: 0 additions & 20 deletions drivers/rtc/rtc-cmos.c
Original file line number Diff line number Diff line change
Expand Up @@ -394,25 +394,6 @@ static int cmos_alarm_irq_enable(struct device *dev, unsigned int enabled)
return 0;
}

static int cmos_update_irq_enable(struct device *dev, unsigned int enabled)
{
struct cmos_rtc *cmos = dev_get_drvdata(dev);
unsigned long flags;

if (!is_valid_irq(cmos->irq))
return -EINVAL;

spin_lock_irqsave(&rtc_lock, flags);

if (enabled)
cmos_irq_enable(cmos, RTC_UIE);
else
cmos_irq_disable(cmos, RTC_UIE);

spin_unlock_irqrestore(&rtc_lock, flags);
return 0;
}

#if defined(CONFIG_RTC_INTF_PROC) || defined(CONFIG_RTC_INTF_PROC_MODULE)

static int cmos_procfs(struct device *dev, struct seq_file *seq)
Expand Down Expand Up @@ -458,7 +439,6 @@ static const struct rtc_class_ops cmos_rtc_ops = {
.set_alarm = cmos_set_alarm,
.proc = cmos_procfs,
.alarm_irq_enable = cmos_alarm_irq_enable,
.update_irq_enable = cmos_update_irq_enable,
};

/*----------------------------------------------------------------*/
Expand Down
17 changes: 0 additions & 17 deletions drivers/rtc/rtc-ds1511.c
Original file line number Diff line number Diff line change
Expand Up @@ -397,29 +397,12 @@ static int ds1511_rtc_alarm_irq_enable(struct device *dev, unsigned int enabled)
return 0;
}

static int ds1511_rtc_update_irq_enable(struct device *dev,
unsigned int enabled)
{
struct platform_device *pdev = to_platform_device(dev);
struct rtc_plat_data *pdata = platform_get_drvdata(pdev);

if (pdata->irq <= 0)
return -EINVAL;
if (enabled)
pdata->irqen |= RTC_UF;
else
pdata->irqen &= ~RTC_UF;
ds1511_rtc_update_alarm(pdata);
return 0;
}

static const struct rtc_class_ops ds1511_rtc_ops = {
.read_time = ds1511_rtc_read_time,
.set_time = ds1511_rtc_set_time,
.read_alarm = ds1511_rtc_read_alarm,
.set_alarm = ds1511_rtc_set_alarm,
.alarm_irq_enable = ds1511_rtc_alarm_irq_enable,
.update_irq_enable = ds1511_rtc_update_irq_enable,
};

static ssize_t
Expand Down
17 changes: 0 additions & 17 deletions drivers/rtc/rtc-ds1553.c
Original file line number Diff line number Diff line change
Expand Up @@ -227,29 +227,12 @@ static int ds1553_rtc_alarm_irq_enable(struct device *dev, unsigned int enabled)
return 0;
}

static int ds1553_rtc_update_irq_enable(struct device *dev,
unsigned int enabled)
{
struct platform_device *pdev = to_platform_device(dev);
struct rtc_plat_data *pdata = platform_get_drvdata(pdev);

if (pdata->irq <= 0)
return -EINVAL;
if (enabled)
pdata->irqen |= RTC_UF;
else
pdata->irqen &= ~RTC_UF;
ds1553_rtc_update_alarm(pdata);
return 0;
}

static const struct rtc_class_ops ds1553_rtc_ops = {
.read_time = ds1553_rtc_read_time,
.set_time = ds1553_rtc_set_time,
.read_alarm = ds1553_rtc_read_alarm,
.set_alarm = ds1553_rtc_set_alarm,
.alarm_irq_enable = ds1553_rtc_alarm_irq_enable,
.update_irq_enable = ds1553_rtc_update_irq_enable,
};

static ssize_t ds1553_nvram_read(struct file *filp, struct kobject *kobj,
Expand Down
18 changes: 0 additions & 18 deletions drivers/rtc/rtc-ds3232.c
Original file line number Diff line number Diff line change
Expand Up @@ -339,23 +339,6 @@ static int ds3232_alarm_irq_enable(struct device *dev, unsigned int enabled)
return 0;
}

static int ds3232_update_irq_enable(struct device *dev, unsigned int enabled)
{
struct i2c_client *client = to_i2c_client(dev);
struct ds3232 *ds3232 = i2c_get_clientdata(client);

if (client->irq <= 0)
return -EINVAL;

if (enabled)
ds3232->rtc->irq_data |= RTC_UF;
else
ds3232->rtc->irq_data &= ~RTC_UF;

ds3232_update_alarm(client);
return 0;
}

static irqreturn_t ds3232_irq(int irq, void *dev_id)
{
struct i2c_client *client = dev_id;
Expand Down Expand Up @@ -406,7 +389,6 @@ static const struct rtc_class_ops ds3232_rtc_ops = {
.read_alarm = ds3232_read_alarm,
.set_alarm = ds3232_set_alarm,
.alarm_irq_enable = ds3232_alarm_irq_enable,
.update_irq_enable = ds3232_update_irq_enable,
};

static int __devinit ds3232_probe(struct i2c_client *client,
Expand Down
7 changes: 0 additions & 7 deletions drivers/rtc/rtc-jz4740.c
Original file line number Diff line number Diff line change
Expand Up @@ -168,12 +168,6 @@ static int jz4740_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alrm)
return ret;
}

static int jz4740_rtc_update_irq_enable(struct device *dev, unsigned int enable)
{
struct jz4740_rtc *rtc = dev_get_drvdata(dev);
return jz4740_rtc_ctrl_set_bits(rtc, JZ_RTC_CTRL_1HZ_IRQ, enable);
}

static int jz4740_rtc_alarm_irq_enable(struct device *dev, unsigned int enable)
{
struct jz4740_rtc *rtc = dev_get_drvdata(dev);
Expand All @@ -185,7 +179,6 @@ static struct rtc_class_ops jz4740_rtc_ops = {
.set_mmss = jz4740_rtc_set_mmss,
.read_alarm = jz4740_rtc_read_alarm,
.set_alarm = jz4740_rtc_set_alarm,
.update_irq_enable = jz4740_rtc_update_irq_enable,
.alarm_irq_enable = jz4740_rtc_alarm_irq_enable,
};

Expand Down
7 changes: 0 additions & 7 deletions drivers/rtc/rtc-mc13xxx.c
Original file line number Diff line number Diff line change
Expand Up @@ -282,12 +282,6 @@ static irqreturn_t mc13xxx_rtc_update_handler(int irq, void *dev)
return IRQ_HANDLED;
}

static int mc13xxx_rtc_update_irq_enable(struct device *dev,
unsigned int enabled)
{
return mc13xxx_rtc_irq_enable(dev, enabled, MC13XXX_IRQ_1HZ);
}

static int mc13xxx_rtc_alarm_irq_enable(struct device *dev,
unsigned int enabled)
{
Expand All @@ -300,7 +294,6 @@ static const struct rtc_class_ops mc13xxx_rtc_ops = {
.read_alarm = mc13xxx_rtc_read_alarm,
.set_alarm = mc13xxx_rtc_set_alarm,
.alarm_irq_enable = mc13xxx_rtc_alarm_irq_enable,
.update_irq_enable = mc13xxx_rtc_update_irq_enable,
};

static irqreturn_t mc13xxx_rtc_reset_handler(int irq, void *dev)
Expand Down
20 changes: 0 additions & 20 deletions drivers/rtc/rtc-mpc5121.c
Original file line number Diff line number Diff line change
Expand Up @@ -240,32 +240,12 @@ static int mpc5121_rtc_alarm_irq_enable(struct device *dev,
return 0;
}

static int mpc5121_rtc_update_irq_enable(struct device *dev,
unsigned int enabled)
{
struct mpc5121_rtc_data *rtc = dev_get_drvdata(dev);
struct mpc5121_rtc_regs __iomem *regs = rtc->regs;
int val;

val = in_8(&regs->int_enable);

if (enabled)
val = (val & ~0x8) | 0x1;
else
val &= ~0x1;

out_8(&regs->int_enable, val);

return 0;
}

static const struct rtc_class_ops mpc5121_rtc_ops = {
.read_time = mpc5121_rtc_read_time,
.set_time = mpc5121_rtc_set_time,
.read_alarm = mpc5121_rtc_read_alarm,
.set_alarm = mpc5121_rtc_set_alarm,
.alarm_irq_enable = mpc5121_rtc_alarm_irq_enable,
.update_irq_enable = mpc5121_rtc_update_irq_enable,
};

static int __devinit mpc5121_rtc_probe(struct platform_device *op,
Expand Down
7 changes: 0 additions & 7 deletions drivers/rtc/rtc-mxc.c
Original file line number Diff line number Diff line change
Expand Up @@ -274,12 +274,6 @@ static int mxc_rtc_alarm_irq_enable(struct device *dev, unsigned int enabled)
return 0;
}

static int mxc_rtc_update_irq_enable(struct device *dev, unsigned int enabled)
{
mxc_rtc_irq_enable(dev, RTC_1HZ_BIT, enabled);
return 0;
}

/*
* This function reads the current RTC time into tm in Gregorian date.
*/
Expand Down Expand Up @@ -368,7 +362,6 @@ static struct rtc_class_ops mxc_rtc_ops = {
.read_alarm = mxc_rtc_read_alarm,
.set_alarm = mxc_rtc_set_alarm,
.alarm_irq_enable = mxc_rtc_alarm_irq_enable,
.update_irq_enable = mxc_rtc_update_irq_enable,
};

static int __init mxc_rtc_probe(struct platform_device *pdev)
Expand Down
15 changes: 0 additions & 15 deletions drivers/rtc/rtc-nuc900.c
Original file line number Diff line number Diff line change
Expand Up @@ -134,20 +134,6 @@ static void nuc900_rtc_bin2bcd(struct device *dev, struct rtc_time *settm,
gettm->bcd_hour = bin2bcd(settm->tm_hour) << 16;
}

static int nuc900_update_irq_enable(struct device *dev, unsigned int enabled)
{
struct nuc900_rtc *rtc = dev_get_drvdata(dev);

if (enabled)
__raw_writel(__raw_readl(rtc->rtc_reg + REG_RTC_RIER)|
(TICKINTENB), rtc->rtc_reg + REG_RTC_RIER);
else
__raw_writel(__raw_readl(rtc->rtc_reg + REG_RTC_RIER)&
(~TICKINTENB), rtc->rtc_reg + REG_RTC_RIER);

return 0;
}

static int nuc900_alarm_irq_enable(struct device *dev, unsigned int enabled)
{
struct nuc900_rtc *rtc = dev_get_drvdata(dev);
Expand Down Expand Up @@ -234,7 +220,6 @@ static struct rtc_class_ops nuc900_rtc_ops = {
.read_alarm = nuc900_rtc_read_alarm,
.set_alarm = nuc900_rtc_set_alarm,
.alarm_irq_enable = nuc900_alarm_irq_enable,
.update_irq_enable = nuc900_update_irq_enable,
};

static int __devinit nuc900_rtc_probe(struct platform_device *pdev)
Expand Down
6 changes: 0 additions & 6 deletions drivers/rtc/rtc-pcap.c
Original file line number Diff line number Diff line change
Expand Up @@ -131,18 +131,12 @@ static int pcap_rtc_alarm_irq_enable(struct device *dev, unsigned int en)
return pcap_rtc_irq_enable(dev, PCAP_IRQ_TODA, en);
}

static int pcap_rtc_update_irq_enable(struct device *dev, unsigned int en)
{
return pcap_rtc_irq_enable(dev, PCAP_IRQ_1HZ, en);
}

static const struct rtc_class_ops pcap_rtc_ops = {
.read_time = pcap_rtc_read_time,
.read_alarm = pcap_rtc_read_alarm,
.set_alarm = pcap_rtc_set_alarm,
.set_mmss = pcap_rtc_set_mmss,
.alarm_irq_enable = pcap_rtc_alarm_irq_enable,
.update_irq_enable = pcap_rtc_update_irq_enable,
};

static int __devinit pcap_rtc_probe(struct platform_device *pdev)
Expand Down
22 changes: 1 addition & 21 deletions drivers/rtc/rtc-pcf50633.c
Original file line number Diff line number Diff line change
Expand Up @@ -106,25 +106,6 @@ pcf50633_rtc_alarm_irq_enable(struct device *dev, unsigned int enabled)
return 0;
}

static int
pcf50633_rtc_update_irq_enable(struct device *dev, unsigned int enabled)
{
struct pcf50633_rtc *rtc = dev_get_drvdata(dev);
int err;

if (enabled)
err = pcf50633_irq_unmask(rtc->pcf, PCF50633_IRQ_SECOND);
else
err = pcf50633_irq_mask(rtc->pcf, PCF50633_IRQ_SECOND);

if (err < 0)
return err;

rtc->second_enabled = enabled;

return 0;
}

static int pcf50633_rtc_read_time(struct device *dev, struct rtc_time *tm)
{
struct pcf50633_rtc *rtc;
Expand Down Expand Up @@ -262,8 +243,7 @@ static struct rtc_class_ops pcf50633_rtc_ops = {
.set_time = pcf50633_rtc_set_time,
.read_alarm = pcf50633_rtc_read_alarm,
.set_alarm = pcf50633_rtc_set_alarm,
.alarm_irq_enable = pcf50633_rtc_alarm_irq_enable,
.update_irq_enable = pcf50633_rtc_update_irq_enable,
.alarm_irq_enable = pcf50633_rtc_alarm_irq_enable,
};

static void pcf50633_rtc_irq(int irq, void *data)
Expand Down
16 changes: 0 additions & 16 deletions drivers/rtc/rtc-pxa.c
Original file line number Diff line number Diff line change
Expand Up @@ -224,21 +224,6 @@ static int pxa_alarm_irq_enable(struct device *dev, unsigned int enabled)
return 0;
}

static int pxa_update_irq_enable(struct device *dev, unsigned int enabled)
{
struct pxa_rtc *pxa_rtc = dev_get_drvdata(dev);

spin_lock_irq(&pxa_rtc->lock);

if (enabled)
rtsr_set_bits(pxa_rtc, RTSR_HZE);
else
rtsr_clear_bits(pxa_rtc, RTSR_HZE);

spin_unlock_irq(&pxa_rtc->lock);
return 0;
}

static int pxa_rtc_read_time(struct device *dev, struct rtc_time *tm)
{
struct pxa_rtc *pxa_rtc = dev_get_drvdata(dev);
Expand Down Expand Up @@ -320,7 +305,6 @@ static const struct rtc_class_ops pxa_rtc_ops = {
.read_alarm = pxa_rtc_read_alarm,
.set_alarm = pxa_rtc_set_alarm,
.alarm_irq_enable = pxa_alarm_irq_enable,
.update_irq_enable = pxa_update_irq_enable,
.proc = pxa_rtc_proc,
};

Expand Down
15 changes: 0 additions & 15 deletions drivers/rtc/rtc-stmp3xxx.c
Original file line number Diff line number Diff line change
Expand Up @@ -115,19 +115,6 @@ static int stmp3xxx_alarm_irq_enable(struct device *dev, unsigned int enabled)
return 0;
}

static int stmp3xxx_update_irq_enable(struct device *dev, unsigned int enabled)
{
struct stmp3xxx_rtc_data *rtc_data = dev_get_drvdata(dev);

if (enabled)
stmp3xxx_setl(BM_RTC_CTRL_ONEMSEC_IRQ_EN,
rtc_data->io + HW_RTC_CTRL);
else
stmp3xxx_clearl(BM_RTC_CTRL_ONEMSEC_IRQ_EN,
rtc_data->io + HW_RTC_CTRL);
return 0;
}

static int stmp3xxx_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *alm)
{
struct stmp3xxx_rtc_data *rtc_data = dev_get_drvdata(dev);
Expand All @@ -149,8 +136,6 @@ static int stmp3xxx_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alm)
static struct rtc_class_ops stmp3xxx_rtc_ops = {
.alarm_irq_enable =
stmp3xxx_alarm_irq_enable,
.update_irq_enable =
stmp3xxx_update_irq_enable,
.read_time = stmp3xxx_rtc_gettime,
.set_mmss = stmp3xxx_rtc_set_mmss,
.read_alarm = stmp3xxx_rtc_read_alarm,
Expand Down
13 changes: 0 additions & 13 deletions drivers/rtc/rtc-twl.c
Original file line number Diff line number Diff line change
Expand Up @@ -213,18 +213,6 @@ static int twl_rtc_alarm_irq_enable(struct device *dev, unsigned enabled)
return ret;
}

static int twl_rtc_update_irq_enable(struct device *dev, unsigned enabled)
{
int ret;

if (enabled)
ret = set_rtc_irq_bit(BIT_RTC_INTERRUPTS_REG_IT_TIMER_M);
else
ret = mask_rtc_irq_bit(BIT_RTC_INTERRUPTS_REG_IT_TIMER_M);

return ret;
}

/*
* Gets current TWL RTC time and date parameters.
*
Expand Down Expand Up @@ -433,7 +421,6 @@ static struct rtc_class_ops twl_rtc_ops = {
.read_alarm = twl_rtc_read_alarm,
.set_alarm = twl_rtc_set_alarm,
.alarm_irq_enable = twl_rtc_alarm_irq_enable,
.update_irq_enable = twl_rtc_update_irq_enable,
};

/*----------------------------------------------------------------------*/
Expand Down
Loading

0 comments on commit 51ba60c

Please sign in to comment.