Skip to content

Commit

Permalink
RTC: Clean out UIE icotl implementations
Browse files Browse the repository at this point in the history
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 <[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 51ba60c commit e428c6a
Show file tree
Hide file tree
Showing 9 changed files with 0 additions and 225 deletions.
28 changes: 0 additions & 28 deletions drivers/rtc/rtc-at91rm9200.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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,
Expand Down
28 changes: 0 additions & 28 deletions drivers/rtc/rtc-at91sam9.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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,
Expand Down
27 changes: 0 additions & 27 deletions drivers/rtc/rtc-bfin.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down Expand Up @@ -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,
Expand Down
4 changes: 0 additions & 4 deletions drivers/rtc/rtc-davinci.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
39 changes: 0 additions & 39 deletions drivers/rtc/rtc-omap.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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,
Expand Down
6 changes: 0 additions & 6 deletions drivers/rtc/rtc-pl030.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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,
Expand Down
52 changes: 0 additions & 52 deletions drivers/rtc/rtc-rs5c372.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down Expand Up @@ -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,
Expand Down
19 changes: 0 additions & 19 deletions drivers/rtc/rtc-sa1100.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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,
Expand Down
22 changes: 0 additions & 22 deletions drivers/rtc/rtc-sh.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit e428c6a

Please sign in to comment.