RTC: Cleanup rtc_class_ops->update_irq_enable()
authorJohn Stultz <john.stultz@linaro.org>
Thu, 3 Feb 2011 20:13:50 +0000 (12:13 -0800)
committerJohn Stultz <john.stultz@linaro.org>
Wed, 9 Mar 2011 19:23:37 +0000 (11:23 -0800)
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 <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>
17 files changed:
drivers/rtc/rtc-cmos.c
drivers/rtc/rtc-ds1511.c
drivers/rtc/rtc-ds1553.c
drivers/rtc/rtc-ds3232.c
drivers/rtc/rtc-jz4740.c
drivers/rtc/rtc-mc13xxx.c
drivers/rtc/rtc-mpc5121.c
drivers/rtc/rtc-mxc.c
drivers/rtc/rtc-nuc900.c
drivers/rtc/rtc-pcap.c
drivers/rtc/rtc-pcf50633.c
drivers/rtc/rtc-pxa.c
drivers/rtc/rtc-stmp3xxx.c
drivers/rtc/rtc-twl.c
drivers/rtc/rtc-wm831x.c
drivers/rtc/rtc-wm8350.c
include/linux/rtc.h

index bdb1f8e2042a72fc3655d879f423fe6992926197..dc2a0ba969cef74f7af07bed92fa512ef7ddb989 100644 (file)
@@ -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)
@@ -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,
 };
 
 /*----------------------------------------------------------------*/
index 37268e97de49e8f6d741dfd5e88271bb87f6566d..3fffd708711f52fd646692b068fd3d8e8aef0655 100644 (file)
@@ -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
index ff432e2ca275a14311165a7e65f93326d3379f6b..fee41b97c9e89e3835734454a720fb772ed17202 100644 (file)
@@ -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,
index 950735415a7c9cf934057fd465b22ddbdd5d6650..27b7bf672ac624249b2a64abda0464af5d74f2cc 100644 (file)
@@ -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;
@@ -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,
index 2e16f72c90569fdb0fe6e26b16f6257e1604de2b..b6473631d18213e80ba404ec93b4ffe13d83e92d 100644 (file)
@@ -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);
@@ -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,
 };
 
index 5314b153bfba73f795d11b2099534af19c0098a5..c420064695598edbe9cdc42c5767d35cc21d2811 100644 (file)
@@ -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)
 {
@@ -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)
index dfcdf0901d21e74ec4995d7b957fba2675a00537..b40c1ff1ebc8e4b5e003a32312664e5be07ee6d1 100644 (file)
@@ -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,
index 0b06c1e03fd5b764d12d482c27e13cb19a00e14a..826ab64a8fa91d1a4524e7e3e7a2ae2ce565fec8 100644 (file)
@@ -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.
  */
@@ -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)
index ddb0857e15a4af29033c3dcb628c10a116462f76..781068d62f23256b9429899661dc023bb68e555c 100644 (file)
@@ -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);
@@ -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)
index 25c0b3fd44f1ba901f96b0b8582a6941335640b4..a633abc428966a91384d92f2613113a3a8861eab 100644 (file)
@@ -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)
index 16edf94ab42f2826f20024ef3a57778f8e15a0c6..f90c574f9d055a8cffb8398c03b51c83327c0d50 100644 (file)
@@ -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;
@@ -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)
index a1fdc802598a4773dd78abf5e092a253336306b0..fc9f4991574be31d2f1f576416889336acc03e0e 100644 (file)
@@ -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);
@@ -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,
 };
 
index 7e7d0c806f2db8eaea1da72cbf3e3052649a7f1b..572e9534b591e78412c6a96cae600bfb762d0889 100644 (file)
@@ -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);
@@ -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,
index ed1b86828124e217ff3bfbf6483d0ab1afa7d216..f9a2799c44d6e177f154f23f938acb8de47db208 100644 (file)
@@ -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.
  *
@@ -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,
 };
 
 /*----------------------------------------------------------------------*/
index 82931dc65c0bbc505460f4c3c1710accd3453723..bdc909bd56da0f4c7c615349df6f43023bd52517 100644 (file)
@@ -315,21 +315,6 @@ static int wm831x_rtc_alarm_irq_enable(struct device *dev,
                return wm831x_rtc_stop_alarm(wm831x_rtc);
 }
 
-static int wm831x_rtc_update_irq_enable(struct device *dev,
-                                       unsigned int enabled)
-{
-       struct wm831x_rtc *wm831x_rtc = dev_get_drvdata(dev);
-       int val;
-
-       if (enabled)
-               val = 1 << WM831X_RTC_PINT_FREQ_SHIFT;
-       else
-               val = 0;
-
-       return wm831x_set_bits(wm831x_rtc->wm831x, WM831X_RTC_CONTROL,
-                              WM831X_RTC_PINT_FREQ_MASK, val);
-}
-
 static irqreturn_t wm831x_alm_irq(int irq, void *data)
 {
        struct wm831x_rtc *wm831x_rtc = data;
@@ -354,7 +339,6 @@ static const struct rtc_class_ops wm831x_rtc_ops = {
        .read_alarm = wm831x_rtc_readalarm,
        .set_alarm = wm831x_rtc_setalarm,
        .alarm_irq_enable = wm831x_rtc_alarm_irq_enable,
-       .update_irq_enable = wm831x_rtc_update_irq_enable,
 };
 
 #ifdef CONFIG_PM
index 3d0dc76b38af24ef47e35b209da51a04e70d2087..66421426e404521c5ecafda56c49e0e34df594f9 100644 (file)
@@ -302,26 +302,6 @@ static int wm8350_rtc_setalarm(struct device *dev, struct rtc_wkalrm *alrm)
        return ret;
 }
 
-static int wm8350_rtc_update_irq_enable(struct device *dev,
-                                       unsigned int enabled)
-{
-       struct wm8350 *wm8350 = dev_get_drvdata(dev);
-
-       /* Suppress duplicate changes since genirq nests enable and
-        * disable calls. */
-       if (enabled == wm8350->rtc.update_enabled)
-               return 0;
-
-       if (enabled)
-               wm8350_unmask_irq(wm8350, WM8350_IRQ_RTC_SEC);
-       else
-               wm8350_mask_irq(wm8350, WM8350_IRQ_RTC_SEC);
-
-       wm8350->rtc.update_enabled = enabled;
-
-       return 0;
-}
-
 static irqreturn_t wm8350_rtc_alarm_handler(int irq, void *data)
 {
        struct wm8350 *wm8350 = data;
@@ -357,7 +337,6 @@ static const struct rtc_class_ops wm8350_rtc_ops = {
        .read_alarm = wm8350_rtc_readalarm,
        .set_alarm = wm8350_rtc_setalarm,
        .alarm_irq_enable = wm8350_rtc_alarm_irq_enable,
-       .update_irq_enable = wm8350_rtc_update_irq_enable,
 };
 
 #ifdef CONFIG_PM
index 741a51cc44607163efef64cbf7c2201c671ccd44..2ca7e8a78060f24057d1c2290e05289393092e27 100644 (file)
@@ -149,7 +149,6 @@ struct rtc_class_ops {
        int (*set_mmss)(struct device *, unsigned long secs);
        int (*read_callback)(struct device *, int data);
        int (*alarm_irq_enable)(struct device *, unsigned int enabled);
-       int (*update_irq_enable)(struct device *, unsigned int enabled);
 };
 
 #define RTC_DEVICE_NAME_SIZE 20