diff options
Diffstat (limited to 'drivers/rtc')
-rw-r--r-- | drivers/rtc/rtc-bfin.c | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/drivers/rtc/rtc-bfin.c b/drivers/rtc/rtc-bfin.c index 23b991d41ef1..56656dd6b2c1 100644 --- a/drivers/rtc/rtc-bfin.c +++ b/drivers/rtc/rtc-bfin.c | |||
@@ -238,12 +238,12 @@ static void bfin_rtc_release(struct device *dev) | |||
238 | free_irq(IRQ_RTC, dev); | 238 | free_irq(IRQ_RTC, dev); |
239 | } | 239 | } |
240 | 240 | ||
241 | static void bfin_rtc_int_set(struct bfin_rtc *rtc, u16 rtc_int) | 241 | static void bfin_rtc_int_set(u16 rtc_int) |
242 | { | 242 | { |
243 | bfin_write_RTC_ISTAT(rtc_int); | 243 | bfin_write_RTC_ISTAT(rtc_int); |
244 | bfin_write_RTC_ICTL(bfin_read_RTC_ICTL() | rtc_int); | 244 | bfin_write_RTC_ICTL(bfin_read_RTC_ICTL() | rtc_int); |
245 | } | 245 | } |
246 | static void bfin_rtc_int_clear(struct bfin_rtc *rtc, u16 rtc_int) | 246 | static void bfin_rtc_int_clear(u16 rtc_int) |
247 | { | 247 | { |
248 | bfin_write_RTC_ICTL(bfin_read_RTC_ICTL() & rtc_int); | 248 | bfin_write_RTC_ICTL(bfin_read_RTC_ICTL() & rtc_int); |
249 | } | 249 | } |
@@ -252,7 +252,7 @@ static void bfin_rtc_int_set_alarm(struct bfin_rtc *rtc) | |||
252 | /* Blackfin has different bits for whether the alarm is | 252 | /* Blackfin has different bits for whether the alarm is |
253 | * more than 24 hours away. | 253 | * more than 24 hours away. |
254 | */ | 254 | */ |
255 | bfin_rtc_int_set(rtc, (rtc->rtc_alarm.tm_yday == -1 ? RTC_ISTAT_ALARM : RTC_ISTAT_ALARM_DAY)); | 255 | bfin_rtc_int_set(rtc->rtc_alarm.tm_yday == -1 ? RTC_ISTAT_ALARM : RTC_ISTAT_ALARM_DAY); |
256 | } | 256 | } |
257 | static int bfin_rtc_ioctl(struct device *dev, unsigned int cmd, unsigned long arg) | 257 | static int bfin_rtc_ioctl(struct device *dev, unsigned int cmd, unsigned long arg) |
258 | { | 258 | { |
@@ -266,21 +266,21 @@ static int bfin_rtc_ioctl(struct device *dev, unsigned int cmd, unsigned long ar | |||
266 | switch (cmd) { | 266 | switch (cmd) { |
267 | case RTC_PIE_ON: | 267 | case RTC_PIE_ON: |
268 | dev_dbg_stamp(dev); | 268 | dev_dbg_stamp(dev); |
269 | bfin_rtc_int_set(rtc, RTC_ISTAT_STOPWATCH); | 269 | bfin_rtc_int_set(RTC_ISTAT_STOPWATCH); |
270 | bfin_write_RTC_SWCNT(rtc->rtc_dev->irq_freq); | 270 | bfin_write_RTC_SWCNT(rtc->rtc_dev->irq_freq); |
271 | break; | 271 | break; |
272 | case RTC_PIE_OFF: | 272 | case RTC_PIE_OFF: |
273 | dev_dbg_stamp(dev); | 273 | dev_dbg_stamp(dev); |
274 | bfin_rtc_int_clear(rtc, ~RTC_ISTAT_STOPWATCH); | 274 | bfin_rtc_int_clear(~RTC_ISTAT_STOPWATCH); |
275 | break; | 275 | break; |
276 | 276 | ||
277 | case RTC_UIE_ON: | 277 | case RTC_UIE_ON: |
278 | dev_dbg_stamp(dev); | 278 | dev_dbg_stamp(dev); |
279 | bfin_rtc_int_set(rtc, RTC_ISTAT_SEC); | 279 | bfin_rtc_int_set(RTC_ISTAT_SEC); |
280 | break; | 280 | break; |
281 | case RTC_UIE_OFF: | 281 | case RTC_UIE_OFF: |
282 | dev_dbg_stamp(dev); | 282 | dev_dbg_stamp(dev); |
283 | bfin_rtc_int_clear(rtc, ~RTC_ISTAT_SEC); | 283 | bfin_rtc_int_clear(~RTC_ISTAT_SEC); |
284 | break; | 284 | break; |
285 | 285 | ||
286 | case RTC_AIE_ON: | 286 | case RTC_AIE_ON: |
@@ -289,7 +289,7 @@ static int bfin_rtc_ioctl(struct device *dev, unsigned int cmd, unsigned long ar | |||
289 | break; | 289 | break; |
290 | case RTC_AIE_OFF: | 290 | case RTC_AIE_OFF: |
291 | dev_dbg_stamp(dev); | 291 | dev_dbg_stamp(dev); |
292 | bfin_rtc_int_clear(rtc, ~(RTC_ISTAT_ALARM | RTC_ISTAT_ALARM_DAY)); | 292 | bfin_rtc_int_clear(~(RTC_ISTAT_ALARM | RTC_ISTAT_ALARM_DAY)); |
293 | break; | 293 | break; |
294 | 294 | ||
295 | default: | 295 | default: |
@@ -435,12 +435,10 @@ static int __devexit bfin_rtc_remove(struct platform_device *pdev) | |||
435 | #ifdef CONFIG_PM | 435 | #ifdef CONFIG_PM |
436 | static int bfin_rtc_suspend(struct platform_device *pdev, pm_message_t state) | 436 | static int bfin_rtc_suspend(struct platform_device *pdev, pm_message_t state) |
437 | { | 437 | { |
438 | struct bfin_rtc *rtc = dev_get_drvdata(&pdev->dev); | ||
439 | |||
440 | if (device_may_wakeup(&pdev->dev)) | 438 | if (device_may_wakeup(&pdev->dev)) |
441 | enable_irq_wake(IRQ_RTC); | 439 | enable_irq_wake(IRQ_RTC); |
442 | else | 440 | else |
443 | bfin_rtc_int_clear(rtc, -1); | 441 | bfin_rtc_int_clear(-1); |
444 | 442 | ||
445 | return 0; | 443 | return 0; |
446 | } | 444 | } |