diff options
Diffstat (limited to 'drivers/rtc/rtc-rs5c372.c')
-rw-r--r-- | drivers/rtc/rtc-rs5c372.c | 52 |
1 files changed, 0 insertions, 52 deletions
diff --git a/drivers/rtc/rtc-rs5c372.c b/drivers/rtc/rtc-rs5c372.c index 6aaa1550e3b..85c1b848dd7 100644 --- a/drivers/rtc/rtc-rs5c372.c +++ b/drivers/rtc/rtc-rs5c372.c | |||
@@ -281,57 +281,6 @@ static int rs5c372_rtc_set_time(struct device *dev, struct rtc_time *tm) | |||
281 | return rs5c372_set_datetime(to_i2c_client(dev), tm); | 281 | return rs5c372_set_datetime(to_i2c_client(dev), tm); |
282 | } | 282 | } |
283 | 283 | ||
284 | #if defined(CONFIG_RTC_INTF_DEV) || defined(CONFIG_RTC_INTF_DEV_MODULE) | ||
285 | |||
286 | static int | ||
287 | rs5c_rtc_ioctl(struct device *dev, unsigned int cmd, unsigned long arg) | ||
288 | { | ||
289 | struct i2c_client *client = to_i2c_client(dev); | ||
290 | struct rs5c372 *rs5c = i2c_get_clientdata(client); | ||
291 | unsigned char buf; | ||
292 | int status, addr; | ||
293 | |||
294 | buf = rs5c->regs[RS5C_REG_CTRL1]; | ||
295 | switch (cmd) { | ||
296 | case RTC_UIE_OFF: | ||
297 | case RTC_UIE_ON: | ||
298 | /* some 327a modes use a different IRQ pin for 1Hz irqs */ | ||
299 | if (rs5c->type == rtc_rs5c372a | ||
300 | && (buf & RS5C372A_CTRL1_SL1)) | ||
301 | return -ENOIOCTLCMD; | ||
302 | default: | ||
303 | return -ENOIOCTLCMD; | ||
304 | } | ||
305 | |||
306 | status = rs5c_get_regs(rs5c); | ||
307 | if (status < 0) | ||
308 | return status; | ||
309 | |||
310 | addr = RS5C_ADDR(RS5C_REG_CTRL1); | ||
311 | switch (cmd) { | ||
312 | case RTC_UIE_OFF: /* update off */ | ||
313 | buf &= ~RS5C_CTRL1_CT_MASK; | ||
314 | break; | ||
315 | case RTC_UIE_ON: /* update on */ | ||
316 | buf &= ~RS5C_CTRL1_CT_MASK; | ||
317 | buf |= RS5C_CTRL1_CT4; | ||
318 | break; | ||
319 | } | ||
320 | |||
321 | if (i2c_smbus_write_byte_data(client, addr, buf) < 0) { | ||
322 | printk(KERN_WARNING "%s: can't update alarm\n", | ||
323 | rs5c->rtc->name); | ||
324 | status = -EIO; | ||
325 | } else | ||
326 | rs5c->regs[RS5C_REG_CTRL1] = buf; | ||
327 | |||
328 | return status; | ||
329 | } | ||
330 | |||
331 | #else | ||
332 | #define rs5c_rtc_ioctl NULL | ||
333 | #endif | ||
334 | |||
335 | 284 | ||
336 | static int rs5c_rtc_alarm_irq_enable(struct device *dev, unsigned int enabled) | 285 | static int rs5c_rtc_alarm_irq_enable(struct device *dev, unsigned int enabled) |
337 | { | 286 | { |
@@ -480,7 +429,6 @@ static int rs5c372_rtc_proc(struct device *dev, struct seq_file *seq) | |||
480 | 429 | ||
481 | static const struct rtc_class_ops rs5c372_rtc_ops = { | 430 | static const struct rtc_class_ops rs5c372_rtc_ops = { |
482 | .proc = rs5c372_rtc_proc, | 431 | .proc = rs5c372_rtc_proc, |
483 | .ioctl = rs5c_rtc_ioctl, | ||
484 | .read_time = rs5c372_rtc_read_time, | 432 | .read_time = rs5c372_rtc_read_time, |
485 | .set_time = rs5c372_rtc_set_time, | 433 | .set_time = rs5c372_rtc_set_time, |
486 | .read_alarm = rs5c_read_alarm, | 434 | .read_alarm = rs5c_read_alarm, |