aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/rtc/rtc-mrst.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/rtc/rtc-mrst.c')
-rw-r--r--drivers/rtc/rtc-mrst.c31
1 files changed, 5 insertions, 26 deletions
diff --git a/drivers/rtc/rtc-mrst.c b/drivers/rtc/rtc-mrst.c
index bcd0cf63eb16..1db62db8469d 100644
--- a/drivers/rtc/rtc-mrst.c
+++ b/drivers/rtc/rtc-mrst.c
@@ -255,42 +255,21 @@ static int mrst_irq_set_state(struct device *dev, int enabled)
255 return 0; 255 return 0;
256} 256}
257 257
258#if defined(CONFIG_RTC_INTF_DEV) || defined(CONFIG_RTC_INTF_DEV_MODULE)
259
260/* Currently, the vRTC doesn't support UIE ON/OFF */ 258/* Currently, the vRTC doesn't support UIE ON/OFF */
261static int 259static int mrst_rtc_alarm_irq_enable(struct device *dev, unsigned int enabled)
262mrst_rtc_ioctl(struct device *dev, unsigned int cmd, unsigned long arg)
263{ 260{
264 struct mrst_rtc *mrst = dev_get_drvdata(dev); 261 struct mrst_rtc *mrst = dev_get_drvdata(dev);
265 unsigned long flags; 262 unsigned long flags;
266 263
267 switch (cmd) {
268 case RTC_AIE_OFF:
269 case RTC_AIE_ON:
270 if (!mrst->irq)
271 return -EINVAL;
272 break;
273 default:
274 /* PIE ON/OFF is handled by mrst_irq_set_state() */
275 return -ENOIOCTLCMD;
276 }
277
278 spin_lock_irqsave(&rtc_lock, flags); 264 spin_lock_irqsave(&rtc_lock, flags);
279 switch (cmd) { 265 if (enabled)
280 case RTC_AIE_OFF: /* alarm off */
281 mrst_irq_disable(mrst, RTC_AIE);
282 break;
283 case RTC_AIE_ON: /* alarm on */
284 mrst_irq_enable(mrst, RTC_AIE); 266 mrst_irq_enable(mrst, RTC_AIE);
285 break; 267 else
286 } 268 mrst_irq_disable(mrst, RTC_AIE);
287 spin_unlock_irqrestore(&rtc_lock, flags); 269 spin_unlock_irqrestore(&rtc_lock, flags);
288 return 0; 270 return 0;
289} 271}
290 272
291#else
292#define mrst_rtc_ioctl NULL
293#endif
294 273
295#if defined(CONFIG_RTC_INTF_PROC) || defined(CONFIG_RTC_INTF_PROC_MODULE) 274#if defined(CONFIG_RTC_INTF_PROC) || defined(CONFIG_RTC_INTF_PROC_MODULE)
296 275
@@ -317,13 +296,13 @@ static int mrst_procfs(struct device *dev, struct seq_file *seq)
317#endif 296#endif
318 297
319static const struct rtc_class_ops mrst_rtc_ops = { 298static const struct rtc_class_ops mrst_rtc_ops = {
320 .ioctl = mrst_rtc_ioctl,
321 .read_time = mrst_read_time, 299 .read_time = mrst_read_time,
322 .set_time = mrst_set_time, 300 .set_time = mrst_set_time,
323 .read_alarm = mrst_read_alarm, 301 .read_alarm = mrst_read_alarm,
324 .set_alarm = mrst_set_alarm, 302 .set_alarm = mrst_set_alarm,
325 .proc = mrst_procfs, 303 .proc = mrst_procfs,
326 .irq_set_state = mrst_irq_set_state, 304 .irq_set_state = mrst_irq_set_state,
305 .alarm_irq_enable = mrst_rtc_alarm_irq_enable,
327}; 306};
328 307
329static struct mrst_rtc mrst_rtc; 308static struct mrst_rtc mrst_rtc;