diff options
Diffstat (limited to 'drivers/rtc/rtc-bfin.c')
-rw-r--r-- | drivers/rtc/rtc-bfin.c | 33 |
1 files changed, 4 insertions, 29 deletions
diff --git a/drivers/rtc/rtc-bfin.c b/drivers/rtc/rtc-bfin.c index 17971d93354d..90d866272c8e 100644 --- a/drivers/rtc/rtc-bfin.c +++ b/drivers/rtc/rtc-bfin.c | |||
@@ -20,9 +20,9 @@ | |||
20 | * write would be discarded and things quickly fall apart. | 20 | * write would be discarded and things quickly fall apart. |
21 | * | 21 | * |
22 | * To keep this delay from significantly degrading performance (we, in theory, | 22 | * To keep this delay from significantly degrading performance (we, in theory, |
23 | * would have to sleep for up to 1 second everytime we wanted to write a | 23 | * would have to sleep for up to 1 second every time we wanted to write a |
24 | * register), we only check the write pending status before we start to issue | 24 | * register), we only check the write pending status before we start to issue |
25 | * a new write. We bank on the idea that it doesnt matter when the sync | 25 | * a new write. We bank on the idea that it doesn't matter when the sync |
26 | * happens so long as we don't attempt another write before it does. The only | 26 | * happens so long as we don't attempt another write before it does. The only |
27 | * time userspace would take this penalty is when they try and do multiple | 27 | * time userspace would take this penalty is when they try and do multiple |
28 | * operations right after another ... but in this case, they need to take the | 28 | * operations right after another ... but in this case, they need to take the |
@@ -240,32 +240,6 @@ static void bfin_rtc_int_set_alarm(struct bfin_rtc *rtc) | |||
240 | */ | 240 | */ |
241 | bfin_rtc_int_set(rtc->rtc_alarm.tm_yday == -1 ? RTC_ISTAT_ALARM : RTC_ISTAT_ALARM_DAY); | 241 | bfin_rtc_int_set(rtc->rtc_alarm.tm_yday == -1 ? RTC_ISTAT_ALARM : RTC_ISTAT_ALARM_DAY); |
242 | } | 242 | } |
243 | static int bfin_rtc_ioctl(struct device *dev, unsigned int cmd, unsigned long arg) | ||
244 | { | ||
245 | struct bfin_rtc *rtc = dev_get_drvdata(dev); | ||
246 | int ret = 0; | ||
247 | |||
248 | dev_dbg_stamp(dev); | ||
249 | |||
250 | bfin_rtc_sync_pending(dev); | ||
251 | |||
252 | switch (cmd) { | ||
253 | case RTC_UIE_ON: | ||
254 | dev_dbg_stamp(dev); | ||
255 | bfin_rtc_int_set(RTC_ISTAT_SEC); | ||
256 | break; | ||
257 | case RTC_UIE_OFF: | ||
258 | dev_dbg_stamp(dev); | ||
259 | bfin_rtc_int_clear(~RTC_ISTAT_SEC); | ||
260 | break; | ||
261 | |||
262 | default: | ||
263 | dev_dbg_stamp(dev); | ||
264 | ret = -ENOIOCTLCMD; | ||
265 | } | ||
266 | |||
267 | return ret; | ||
268 | } | ||
269 | 243 | ||
270 | static int bfin_rtc_alarm_irq_enable(struct device *dev, unsigned int enabled) | 244 | static int bfin_rtc_alarm_irq_enable(struct device *dev, unsigned int enabled) |
271 | { | 245 | { |
@@ -276,6 +250,8 @@ static int bfin_rtc_alarm_irq_enable(struct device *dev, unsigned int enabled) | |||
276 | bfin_rtc_int_set_alarm(rtc); | 250 | bfin_rtc_int_set_alarm(rtc); |
277 | else | 251 | else |
278 | bfin_rtc_int_clear(~(RTC_ISTAT_ALARM | RTC_ISTAT_ALARM_DAY)); | 252 | bfin_rtc_int_clear(~(RTC_ISTAT_ALARM | RTC_ISTAT_ALARM_DAY)); |
253 | |||
254 | return 0; | ||
279 | } | 255 | } |
280 | 256 | ||
281 | static int bfin_rtc_read_time(struct device *dev, struct rtc_time *tm) | 257 | static int bfin_rtc_read_time(struct device *dev, struct rtc_time *tm) |
@@ -358,7 +334,6 @@ static int bfin_rtc_proc(struct device *dev, struct seq_file *seq) | |||
358 | } | 334 | } |
359 | 335 | ||
360 | static struct rtc_class_ops bfin_rtc_ops = { | 336 | static struct rtc_class_ops bfin_rtc_ops = { |
361 | .ioctl = bfin_rtc_ioctl, | ||
362 | .read_time = bfin_rtc_read_time, | 337 | .read_time = bfin_rtc_read_time, |
363 | .set_time = bfin_rtc_set_time, | 338 | .set_time = bfin_rtc_set_time, |
364 | .read_alarm = bfin_rtc_read_alarm, | 339 | .read_alarm = bfin_rtc_read_alarm, |