]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
RTC: Clean out UIE icotl implementations
authorJohn Stultz <john.stultz@linaro.org>
Sat, 5 Feb 2011 00:16:12 +0000 (16:16 -0800)
committerJohn Stultz <john.stultz@linaro.org>
Wed, 9 Mar 2011 19:24:54 +0000 (11:24 -0800)
With the generic RTC rework, the UIE mode irqs are handled
in the generic layer, and only hardware specific ioctls
get passed down to the rtc driver layer.

So this patch removes the UIE mode ioctl handling in the rtc
driver layer, which never get used.

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>
drivers/rtc/rtc-at91rm9200.c
drivers/rtc/rtc-at91sam9.c
drivers/rtc/rtc-bfin.c
drivers/rtc/rtc-davinci.c
drivers/rtc/rtc-omap.c
drivers/rtc/rtc-pl030.c
drivers/rtc/rtc-rs5c372.c
drivers/rtc/rtc-sa1100.c
drivers/rtc/rtc-sh.c

index 26d1cf5d19ae4046899925d8a294d6417cc09401..518a76ec71cab46717903154db6713870593dcdb 100644 (file)
@@ -183,33 +183,6 @@ static int at91_rtc_setalarm(struct device *dev, struct rtc_wkalrm *alrm)
        return 0;
 }
 
-/*
- * Handle commands from user-space
- */
-static int at91_rtc_ioctl(struct device *dev, unsigned int cmd,
-                       unsigned long arg)
-{
-       int ret = 0;
-
-       pr_debug("%s(): cmd=%08x, arg=%08lx.\n", __func__, cmd, arg);
-
-       /* important:  scrub old status before enabling IRQs */
-       switch (cmd) {
-       case RTC_UIE_OFF:       /* update off */
-               at91_sys_write(AT91_RTC_IDR, AT91_RTC_SECEV);
-               break;
-       case RTC_UIE_ON:        /* update on */
-               at91_sys_write(AT91_RTC_SCCR, AT91_RTC_SECEV);
-               at91_sys_write(AT91_RTC_IER, AT91_RTC_SECEV);
-               break;
-       default:
-               ret = -ENOIOCTLCMD;
-               break;
-       }
-
-       return ret;
-}
-
 static int at91_rtc_alarm_irq_enable(struct device *dev, unsigned int enabled)
 {
        pr_debug("%s(): cmd=%08x\n", __func__, enabled);
@@ -269,7 +242,6 @@ static irqreturn_t at91_rtc_interrupt(int irq, void *dev_id)
 }
 
 static const struct rtc_class_ops at91_rtc_ops = {
-       .ioctl          = at91_rtc_ioctl,
        .read_time      = at91_rtc_readtime,
        .set_time       = at91_rtc_settime,
        .read_alarm     = at91_rtc_readalarm,
index 5469c52cba3dc64d60504b32e51e0f2c46bdeb9a..a3ad957507dc9ebce9a360c85330e067d5576f9f 100644 (file)
@@ -216,33 +216,6 @@ static int at91_rtc_setalarm(struct device *dev, struct rtc_wkalrm *alrm)
        return 0;
 }
 
-/*
- * Handle commands from user-space
- */
-static int at91_rtc_ioctl(struct device *dev, unsigned int cmd,
-                       unsigned long arg)
-{
-       struct sam9_rtc *rtc = dev_get_drvdata(dev);
-       int ret = 0;
-       u32 mr = rtt_readl(rtc, MR);
-
-       dev_dbg(dev, "ioctl: cmd=%08x, arg=%08lx, mr %08x\n", cmd, arg, mr);
-
-       switch (cmd) {
-       case RTC_UIE_OFF:               /* update off */
-               rtt_writel(rtc, MR, mr & ~AT91_RTT_RTTINCIEN);
-               break;
-       case RTC_UIE_ON:                /* update on */
-               rtt_writel(rtc, MR, mr | AT91_RTT_RTTINCIEN);
-               break;
-       default:
-               ret = -ENOIOCTLCMD;
-               break;
-       }
-
-       return ret;
-}
-
 static int at91_rtc_alarm_irq_enable(struct device *dev, unsigned int enabled)
 {
        struct sam9_rtc *rtc = dev_get_drvdata(dev);
@@ -303,7 +276,6 @@ static irqreturn_t at91_rtc_interrupt(int irq, void *_rtc)
 }
 
 static const struct rtc_class_ops at91_rtc_ops = {
-       .ioctl          = at91_rtc_ioctl,
        .read_time      = at91_rtc_readtime,
        .set_time       = at91_rtc_settime,
        .read_alarm     = at91_rtc_readalarm,
index 17971d93354d2041c860e8dfd57f29d60ff6536e..ca9cff85ab8a8f6d34faf6173524184daca730b2 100644 (file)
@@ -240,32 +240,6 @@ static void bfin_rtc_int_set_alarm(struct bfin_rtc *rtc)
         */
        bfin_rtc_int_set(rtc->rtc_alarm.tm_yday == -1 ? RTC_ISTAT_ALARM : RTC_ISTAT_ALARM_DAY);
 }
-static int bfin_rtc_ioctl(struct device *dev, unsigned int cmd, unsigned long arg)
-{
-       struct bfin_rtc *rtc = dev_get_drvdata(dev);
-       int ret = 0;
-
-       dev_dbg_stamp(dev);
-
-       bfin_rtc_sync_pending(dev);
-
-       switch (cmd) {
-       case RTC_UIE_ON:
-               dev_dbg_stamp(dev);
-               bfin_rtc_int_set(RTC_ISTAT_SEC);
-               break;
-       case RTC_UIE_OFF:
-               dev_dbg_stamp(dev);
-               bfin_rtc_int_clear(~RTC_ISTAT_SEC);
-               break;
-
-       default:
-               dev_dbg_stamp(dev);
-               ret = -ENOIOCTLCMD;
-       }
-
-       return ret;
-}
 
 static int bfin_rtc_alarm_irq_enable(struct device *dev, unsigned int enabled)
 {
@@ -358,7 +332,6 @@ static int bfin_rtc_proc(struct device *dev, struct seq_file *seq)
 }
 
 static struct rtc_class_ops bfin_rtc_ops = {
-       .ioctl         = bfin_rtc_ioctl,
        .read_time     = bfin_rtc_read_time,
        .set_time      = bfin_rtc_set_time,
        .read_alarm    = bfin_rtc_read_alarm,
index dfd98a235ad17a8942891b166715e653b7637888..8d46838dff8a0aaac95e032211bd9945f2ced1c4 100644 (file)
@@ -231,10 +231,6 @@ davinci_rtc_ioctl(struct device *dev, unsigned int cmd, unsigned long arg)
        case RTC_WIE_OFF:
                rtc_ctrl &= ~PRTCSS_RTC_CTRL_WEN;
                break;
-       case RTC_UIE_OFF:
-       case RTC_UIE_ON:
-               ret = -ENOTTY;
-               break;
        default:
                ret = -ENOIOCTLCMD;
        }
index b4dbf3a319b30d52aff0e939c3d3f6638d7e8f4f..de0dd7b1f146e0e7fff07bd30487b1da9add0ca1 100644 (file)
@@ -135,44 +135,6 @@ static irqreturn_t rtc_irq(int irq, void *rtc)
        return IRQ_HANDLED;
 }
 
-#ifdef CONFIG_RTC_INTF_DEV
-
-static int
-omap_rtc_ioctl(struct device *dev, unsigned int cmd, unsigned long arg)
-{
-       u8 reg;
-
-       switch (cmd) {
-       case RTC_UIE_OFF:
-       case RTC_UIE_ON:
-               break;
-       default:
-               return -ENOIOCTLCMD;
-       }
-
-       local_irq_disable();
-       rtc_wait_not_busy();
-       reg = rtc_read(OMAP_RTC_INTERRUPTS_REG);
-       switch (cmd) {
-       /* UIE = Update Interrupt Enable (1/second) */
-       case RTC_UIE_OFF:
-               reg &= ~OMAP_RTC_INTERRUPTS_IT_TIMER;
-               break;
-       case RTC_UIE_ON:
-               reg |= OMAP_RTC_INTERRUPTS_IT_TIMER;
-               break;
-       }
-       rtc_wait_not_busy();
-       rtc_write(reg, OMAP_RTC_INTERRUPTS_REG);
-       local_irq_enable();
-
-       return 0;
-}
-
-#else
-#define        omap_rtc_ioctl  NULL
-#endif
-
 static int omap_rtc_alarm_irq_enable(struct device *dev, unsigned int enabled)
 {
        u8 reg;
@@ -313,7 +275,6 @@ static int omap_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alm)
 }
 
 static struct rtc_class_ops omap_rtc_ops = {
-       .ioctl          = omap_rtc_ioctl,
        .read_time      = omap_rtc_read_time,
        .set_time       = omap_rtc_set_time,
        .read_alarm     = omap_rtc_read_alarm,
index bbdb2f02798a13187c91475696fa9f84594f8f47..d554368c9f577dfc8c9a3d1d57f706543b460ad0 100644 (file)
@@ -35,11 +35,6 @@ static irqreturn_t pl030_interrupt(int irq, void *dev_id)
        return IRQ_HANDLED;
 }
 
-static int pl030_ioctl(struct device *dev, unsigned int cmd, unsigned long arg)
-{
-       return -ENOIOCTLCMD;
-}
-
 static int pl030_read_alarm(struct device *dev, struct rtc_wkalrm *alrm)
 {
        struct pl030_rtc *rtc = dev_get_drvdata(dev);
@@ -96,7 +91,6 @@ static int pl030_set_time(struct device *dev, struct rtc_time *tm)
 }
 
 static const struct rtc_class_ops pl030_ops = {
-       .ioctl          = pl030_ioctl,
        .read_time      = pl030_read_time,
        .set_time       = pl030_set_time,
        .read_alarm     = pl030_read_alarm,
index 6aaa1550e3b1ebe7094d3d33107fb34bb44779e7..85c1b848dd72383b6253fbef04d2fa870719d076 100644 (file)
@@ -281,57 +281,6 @@ static int rs5c372_rtc_set_time(struct device *dev, struct rtc_time *tm)
        return rs5c372_set_datetime(to_i2c_client(dev), tm);
 }
 
-#if defined(CONFIG_RTC_INTF_DEV) || defined(CONFIG_RTC_INTF_DEV_MODULE)
-
-static int
-rs5c_rtc_ioctl(struct device *dev, unsigned int cmd, unsigned long arg)
-{
-       struct i2c_client       *client = to_i2c_client(dev);
-       struct rs5c372          *rs5c = i2c_get_clientdata(client);
-       unsigned char           buf;
-       int                     status, addr;
-
-       buf = rs5c->regs[RS5C_REG_CTRL1];
-       switch (cmd) {
-       case RTC_UIE_OFF:
-       case RTC_UIE_ON:
-               /* some 327a modes use a different IRQ pin for 1Hz irqs */
-               if (rs5c->type == rtc_rs5c372a
-                               && (buf & RS5C372A_CTRL1_SL1))
-                       return -ENOIOCTLCMD;
-       default:
-               return -ENOIOCTLCMD;
-       }
-
-       status = rs5c_get_regs(rs5c);
-       if (status < 0)
-               return status;
-
-       addr = RS5C_ADDR(RS5C_REG_CTRL1);
-       switch (cmd) {
-       case RTC_UIE_OFF:       /* update off */
-               buf &= ~RS5C_CTRL1_CT_MASK;
-               break;
-       case RTC_UIE_ON:        /* update on */
-               buf &= ~RS5C_CTRL1_CT_MASK;
-               buf |= RS5C_CTRL1_CT4;
-               break;
-       }
-
-       if (i2c_smbus_write_byte_data(client, addr, buf) < 0) {
-               printk(KERN_WARNING "%s: can't update alarm\n",
-                       rs5c->rtc->name);
-               status = -EIO;
-       } else
-               rs5c->regs[RS5C_REG_CTRL1] = buf;
-
-       return status;
-}
-
-#else
-#define        rs5c_rtc_ioctl  NULL
-#endif
-
 
 static int rs5c_rtc_alarm_irq_enable(struct device *dev, unsigned int enabled)
 {
@@ -480,7 +429,6 @@ static int rs5c372_rtc_proc(struct device *dev, struct seq_file *seq)
 
 static const struct rtc_class_ops rs5c372_rtc_ops = {
        .proc           = rs5c372_rtc_proc,
-       .ioctl          = rs5c_rtc_ioctl,
        .read_time      = rs5c372_rtc_read_time,
        .set_time       = rs5c372_rtc_set_time,
        .read_alarm     = rs5c_read_alarm,
index d1a2b0bc3b24211d6a2b28adc43a19afaee74606..a9189337a2c5606072ce89dc993197cb7565a3b8 100644 (file)
@@ -293,24 +293,6 @@ static void sa1100_rtc_release(struct device *dev)
 }
 
 
-static int sa1100_rtc_ioctl(struct device *dev, unsigned int cmd,
-               unsigned long arg)
-{
-       switch (cmd) {
-       case RTC_UIE_OFF:
-               spin_lock_irq(&sa1100_rtc_lock);
-               RTSR &= ~RTSR_HZE;
-               spin_unlock_irq(&sa1100_rtc_lock);
-               return 0;
-       case RTC_UIE_ON:
-               spin_lock_irq(&sa1100_rtc_lock);
-               RTSR |= RTSR_HZE;
-               spin_unlock_irq(&sa1100_rtc_lock);
-               return 0;
-       }
-       return -ENOIOCTLCMD;
-}
-
 static int sa1100_rtc_alarm_irq_enable(struct device *dev, unsigned int enabled)
 {
        spin_lock_irq(&sa1100_rtc_lock);
@@ -386,7 +368,6 @@ static const struct rtc_class_ops sa1100_rtc_ops = {
        .open = sa1100_rtc_open,
        .read_callback = sa1100_rtc_read_callback,
        .release = sa1100_rtc_release,
-       .ioctl = sa1100_rtc_ioctl,
        .read_time = sa1100_rtc_read_time,
        .set_time = sa1100_rtc_set_time,
        .read_alarm = sa1100_rtc_read_alarm,
index 148544979a548136fe7f94536f4ac708c5376bdb..e55dc1ac83ab5bd229093a786ba08544bef73d5d 100644 (file)
@@ -344,27 +344,6 @@ static inline void sh_rtc_setcie(struct device *dev, unsigned int enable)
        spin_unlock_irq(&rtc->lock);
 }
 
-static int sh_rtc_ioctl(struct device *dev, unsigned int cmd, unsigned long arg)
-{
-       struct sh_rtc *rtc = dev_get_drvdata(dev);
-       unsigned int ret = 0;
-
-       switch (cmd) {
-       case RTC_UIE_OFF:
-               rtc->periodic_freq &= ~PF_OXS;
-               sh_rtc_setcie(dev, 0);
-               break;
-       case RTC_UIE_ON:
-               rtc->periodic_freq |= PF_OXS;
-               sh_rtc_setcie(dev, 1);
-               break;
-       default:
-               ret = -ENOIOCTLCMD;
-       }
-
-       return ret;
-}
-
 static int sh_rtc_alarm_irq_enable(struct device *dev, unsigned int enabled)
 {
        sh_rtc_setaie(dev, enabled);
@@ -598,7 +577,6 @@ static int sh_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *wkalrm)
 }
 
 static struct rtc_class_ops sh_rtc_ops = {
-       .ioctl          = sh_rtc_ioctl,
        .read_time      = sh_rtc_read_time,
        .set_time       = sh_rtc_set_time,
        .read_alarm     = sh_rtc_read_alarm,