diff options
author | Olof Johansson <olof@lixom.net> | 2012-09-16 22:28:42 -0400 |
---|---|---|
committer | Olof Johansson <olof@lixom.net> | 2012-09-16 22:28:42 -0400 |
commit | e640ca0fcb8b616c92a660605fddd1cc9e4bde1d (patch) | |
tree | 1d942cf747504b3db772bca447be7eea4228c722 /drivers/rtc | |
parent | 5ec8d8c96e20f4997881c8f259607cc8e47825e2 (diff) | |
parent | cf3a6ec2c0a499ef019d25d4dbc79df66e7d3f0c (diff) |
Merge tag 'cleanup-omap-tags-for-v3.7' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap into next/cleanup
From Tony Lindgren:
Remove the ancient omap specific atags that are no longer needed.
At some point we were planning to pass the bootloader information
with custom atags that did not work out too well.
There's no need for these any longer as the kernel has been booting
fine without them for quite some time. And Now we have device tree
support that can be used instead.
* tag 'cleanup-omap-tags-for-v3.7' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap:
ARM: OMAP: remove plat/board.h file
ARM: OMAP: move debug_card_init() function
ARM: OMAP1: move lcd pdata out of arch/arm/*
ARM: OMAP1: move omap1_bl pdata out of arch/arm/*
ARM: OMAP: remove the omap custom tags
ARM: OMAP1: remove the crystal type tag parsing
ARM: OMAP: remove the sti console workaround
ARM: OMAP: omap3evm: cleanup revision bits
ARM: OMAP: cleanup struct omap_board_config_kernel
+ sync to 3.6-rc5
Diffstat (limited to 'drivers/rtc')
-rw-r--r-- | drivers/rtc/rtc-at91sam9.c | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/drivers/rtc/rtc-at91sam9.c b/drivers/rtc/rtc-at91sam9.c index 831868904e02..1dd61f402b04 100644 --- a/drivers/rtc/rtc-at91sam9.c +++ b/drivers/rtc/rtc-at91sam9.c | |||
@@ -58,6 +58,7 @@ struct sam9_rtc { | |||
58 | struct rtc_device *rtcdev; | 58 | struct rtc_device *rtcdev; |
59 | u32 imr; | 59 | u32 imr; |
60 | void __iomem *gpbr; | 60 | void __iomem *gpbr; |
61 | int irq; | ||
61 | }; | 62 | }; |
62 | 63 | ||
63 | #define rtt_readl(rtc, field) \ | 64 | #define rtt_readl(rtc, field) \ |
@@ -292,7 +293,7 @@ static int __devinit at91_rtc_probe(struct platform_device *pdev) | |||
292 | { | 293 | { |
293 | struct resource *r, *r_gpbr; | 294 | struct resource *r, *r_gpbr; |
294 | struct sam9_rtc *rtc; | 295 | struct sam9_rtc *rtc; |
295 | int ret; | 296 | int ret, irq; |
296 | u32 mr; | 297 | u32 mr; |
297 | 298 | ||
298 | r = platform_get_resource(pdev, IORESOURCE_MEM, 0); | 299 | r = platform_get_resource(pdev, IORESOURCE_MEM, 0); |
@@ -302,10 +303,18 @@ static int __devinit at91_rtc_probe(struct platform_device *pdev) | |||
302 | return -ENODEV; | 303 | return -ENODEV; |
303 | } | 304 | } |
304 | 305 | ||
306 | irq = platform_get_irq(pdev, 0); | ||
307 | if (irq < 0) { | ||
308 | dev_err(&pdev->dev, "failed to get interrupt resource\n"); | ||
309 | return irq; | ||
310 | } | ||
311 | |||
305 | rtc = kzalloc(sizeof *rtc, GFP_KERNEL); | 312 | rtc = kzalloc(sizeof *rtc, GFP_KERNEL); |
306 | if (!rtc) | 313 | if (!rtc) |
307 | return -ENOMEM; | 314 | return -ENOMEM; |
308 | 315 | ||
316 | rtc->irq = irq; | ||
317 | |||
309 | /* platform setup code should have handled this; sigh */ | 318 | /* platform setup code should have handled this; sigh */ |
310 | if (!device_can_wakeup(&pdev->dev)) | 319 | if (!device_can_wakeup(&pdev->dev)) |
311 | device_init_wakeup(&pdev->dev, 1); | 320 | device_init_wakeup(&pdev->dev, 1); |
@@ -345,11 +354,10 @@ static int __devinit at91_rtc_probe(struct platform_device *pdev) | |||
345 | } | 354 | } |
346 | 355 | ||
347 | /* register irq handler after we know what name we'll use */ | 356 | /* register irq handler after we know what name we'll use */ |
348 | ret = request_irq(AT91_ID_SYS, at91_rtc_interrupt, | 357 | ret = request_irq(rtc->irq, at91_rtc_interrupt, IRQF_SHARED, |
349 | IRQF_SHARED, | ||
350 | dev_name(&rtc->rtcdev->dev), rtc); | 358 | dev_name(&rtc->rtcdev->dev), rtc); |
351 | if (ret) { | 359 | if (ret) { |
352 | dev_dbg(&pdev->dev, "can't share IRQ %d?\n", AT91_ID_SYS); | 360 | dev_dbg(&pdev->dev, "can't share IRQ %d?\n", rtc->irq); |
353 | rtc_device_unregister(rtc->rtcdev); | 361 | rtc_device_unregister(rtc->rtcdev); |
354 | goto fail_register; | 362 | goto fail_register; |
355 | } | 363 | } |
@@ -386,7 +394,7 @@ static int __devexit at91_rtc_remove(struct platform_device *pdev) | |||
386 | 394 | ||
387 | /* disable all interrupts */ | 395 | /* disable all interrupts */ |
388 | rtt_writel(rtc, MR, mr & ~(AT91_RTT_ALMIEN | AT91_RTT_RTTINCIEN)); | 396 | rtt_writel(rtc, MR, mr & ~(AT91_RTT_ALMIEN | AT91_RTT_RTTINCIEN)); |
389 | free_irq(AT91_ID_SYS, rtc); | 397 | free_irq(rtc->irq, rtc); |
390 | 398 | ||
391 | rtc_device_unregister(rtc->rtcdev); | 399 | rtc_device_unregister(rtc->rtcdev); |
392 | 400 | ||
@@ -423,7 +431,7 @@ static int at91_rtc_suspend(struct platform_device *pdev, | |||
423 | rtc->imr = mr & (AT91_RTT_ALMIEN | AT91_RTT_RTTINCIEN); | 431 | rtc->imr = mr & (AT91_RTT_ALMIEN | AT91_RTT_RTTINCIEN); |
424 | if (rtc->imr) { | 432 | if (rtc->imr) { |
425 | if (device_may_wakeup(&pdev->dev) && (mr & AT91_RTT_ALMIEN)) { | 433 | if (device_may_wakeup(&pdev->dev) && (mr & AT91_RTT_ALMIEN)) { |
426 | enable_irq_wake(AT91_ID_SYS); | 434 | enable_irq_wake(rtc->irq); |
427 | /* don't let RTTINC cause wakeups */ | 435 | /* don't let RTTINC cause wakeups */ |
428 | if (mr & AT91_RTT_RTTINCIEN) | 436 | if (mr & AT91_RTT_RTTINCIEN) |
429 | rtt_writel(rtc, MR, mr & ~AT91_RTT_RTTINCIEN); | 437 | rtt_writel(rtc, MR, mr & ~AT91_RTT_RTTINCIEN); |
@@ -441,7 +449,7 @@ static int at91_rtc_resume(struct platform_device *pdev) | |||
441 | 449 | ||
442 | if (rtc->imr) { | 450 | if (rtc->imr) { |
443 | if (device_may_wakeup(&pdev->dev)) | 451 | if (device_may_wakeup(&pdev->dev)) |
444 | disable_irq_wake(AT91_ID_SYS); | 452 | disable_irq_wake(rtc->irq); |
445 | mr = rtt_readl(rtc, MR); | 453 | mr = rtt_readl(rtc, MR); |
446 | rtt_writel(rtc, MR, mr | rtc->imr); | 454 | rtt_writel(rtc, MR, mr | rtc->imr); |
447 | } | 455 | } |