aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/rtc/rtc-m48t59.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/rtc/rtc-m48t59.c')
-rw-r--r--drivers/rtc/rtc-m48t59.c21
1 files changed, 6 insertions, 15 deletions
diff --git a/drivers/rtc/rtc-m48t59.c b/drivers/rtc/rtc-m48t59.c
index a99a0b554eb8..3978f4caf724 100644
--- a/drivers/rtc/rtc-m48t59.c
+++ b/drivers/rtc/rtc-m48t59.c
@@ -263,30 +263,21 @@ static int m48t59_rtc_setalarm(struct device *dev, struct rtc_wkalrm *alrm)
263/* 263/*
264 * Handle commands from user-space 264 * Handle commands from user-space
265 */ 265 */
266static int m48t59_rtc_ioctl(struct device *dev, unsigned int cmd, 266static int m48t59_rtc_alarm_irq_enable(struct device *dev, unsigned int enabled)
267 unsigned long arg)
268{ 267{
269 struct platform_device *pdev = to_platform_device(dev); 268 struct platform_device *pdev = to_platform_device(dev);
270 struct m48t59_plat_data *pdata = pdev->dev.platform_data; 269 struct m48t59_plat_data *pdata = pdev->dev.platform_data;
271 struct m48t59_private *m48t59 = platform_get_drvdata(pdev); 270 struct m48t59_private *m48t59 = platform_get_drvdata(pdev);
272 unsigned long flags; 271 unsigned long flags;
273 int ret = 0;
274 272
275 spin_lock_irqsave(&m48t59->lock, flags); 273 spin_lock_irqsave(&m48t59->lock, flags);
276 switch (cmd) { 274 if (enabled)
277 case RTC_AIE_OFF: /* alarm interrupt off */
278 M48T59_WRITE(0x00, M48T59_INTR);
279 break;
280 case RTC_AIE_ON: /* alarm interrupt on */
281 M48T59_WRITE(M48T59_INTR_AFE, M48T59_INTR); 275 M48T59_WRITE(M48T59_INTR_AFE, M48T59_INTR);
282 break; 276 else
283 default: 277 M48T59_WRITE(0x00, M48T59_INTR);
284 ret = -ENOIOCTLCMD;
285 break;
286 }
287 spin_unlock_irqrestore(&m48t59->lock, flags); 278 spin_unlock_irqrestore(&m48t59->lock, flags);
288 279
289 return ret; 280 return 0;
290} 281}
291 282
292static int m48t59_rtc_proc(struct device *dev, struct seq_file *seq) 283static int m48t59_rtc_proc(struct device *dev, struct seq_file *seq)
@@ -330,12 +321,12 @@ static irqreturn_t m48t59_rtc_interrupt(int irq, void *dev_id)
330} 321}
331 322
332static const struct rtc_class_ops m48t59_rtc_ops = { 323static const struct rtc_class_ops m48t59_rtc_ops = {
333 .ioctl = m48t59_rtc_ioctl,
334 .read_time = m48t59_rtc_read_time, 324 .read_time = m48t59_rtc_read_time,
335 .set_time = m48t59_rtc_set_time, 325 .set_time = m48t59_rtc_set_time,
336 .read_alarm = m48t59_rtc_readalarm, 326 .read_alarm = m48t59_rtc_readalarm,
337 .set_alarm = m48t59_rtc_setalarm, 327 .set_alarm = m48t59_rtc_setalarm,
338 .proc = m48t59_rtc_proc, 328 .proc = m48t59_rtc_proc,
329 .alarm_irq_enable = m48t59_rtc_alarm_irq_enable,
339}; 330};
340 331
341static const struct rtc_class_ops m48t02_rtc_ops = { 332static const struct rtc_class_ops m48t02_rtc_ops = {