diff options
author | Jonathan Herman <hermanjl@cs.unc.edu> | 2013-01-17 16:15:55 -0500 |
---|---|---|
committer | Jonathan Herman <hermanjl@cs.unc.edu> | 2013-01-17 16:15:55 -0500 |
commit | 8dea78da5cee153b8af9c07a2745f6c55057fe12 (patch) | |
tree | a8f4d49d63b1ecc92f2fddceba0655b2472c5bd9 /drivers/rtc/rtc-imxdi.c | |
parent | 406089d01562f1e2bf9f089fd7637009ebaad589 (diff) |
Patched in Tegra support.
Diffstat (limited to 'drivers/rtc/rtc-imxdi.c')
-rw-r--r-- | drivers/rtc/rtc-imxdi.c | 24 |
1 files changed, 5 insertions, 19 deletions
diff --git a/drivers/rtc/rtc-imxdi.c b/drivers/rtc/rtc-imxdi.c index 75d307ab37f..d93a9608b1f 100644 --- a/drivers/rtc/rtc-imxdi.c +++ b/drivers/rtc/rtc-imxdi.c | |||
@@ -36,9 +36,7 @@ | |||
36 | #include <linux/platform_device.h> | 36 | #include <linux/platform_device.h> |
37 | #include <linux/rtc.h> | 37 | #include <linux/rtc.h> |
38 | #include <linux/sched.h> | 38 | #include <linux/sched.h> |
39 | #include <linux/spinlock.h> | ||
40 | #include <linux/workqueue.h> | 39 | #include <linux/workqueue.h> |
41 | #include <linux/of.h> | ||
42 | 40 | ||
43 | /* DryIce Register Definitions */ | 41 | /* DryIce Register Definitions */ |
44 | 42 | ||
@@ -394,8 +392,6 @@ static int dryice_rtc_probe(struct platform_device *pdev) | |||
394 | if (imxdi->ioaddr == NULL) | 392 | if (imxdi->ioaddr == NULL) |
395 | return -ENOMEM; | 393 | return -ENOMEM; |
396 | 394 | ||
397 | spin_lock_init(&imxdi->irq_lock); | ||
398 | |||
399 | imxdi->irq = platform_get_irq(pdev, 0); | 395 | imxdi->irq = platform_get_irq(pdev, 0); |
400 | if (imxdi->irq < 0) | 396 | if (imxdi->irq < 0) |
401 | return imxdi->irq; | 397 | return imxdi->irq; |
@@ -409,7 +405,7 @@ static int dryice_rtc_probe(struct platform_device *pdev) | |||
409 | imxdi->clk = clk_get(&pdev->dev, NULL); | 405 | imxdi->clk = clk_get(&pdev->dev, NULL); |
410 | if (IS_ERR(imxdi->clk)) | 406 | if (IS_ERR(imxdi->clk)) |
411 | return PTR_ERR(imxdi->clk); | 407 | return PTR_ERR(imxdi->clk); |
412 | clk_prepare_enable(imxdi->clk); | 408 | clk_enable(imxdi->clk); |
413 | 409 | ||
414 | /* | 410 | /* |
415 | * Initialize dryice hardware | 411 | * Initialize dryice hardware |
@@ -474,13 +470,13 @@ static int dryice_rtc_probe(struct platform_device *pdev) | |||
474 | return 0; | 470 | return 0; |
475 | 471 | ||
476 | err: | 472 | err: |
477 | clk_disable_unprepare(imxdi->clk); | 473 | clk_disable(imxdi->clk); |
478 | clk_put(imxdi->clk); | 474 | clk_put(imxdi->clk); |
479 | 475 | ||
480 | return rc; | 476 | return rc; |
481 | } | 477 | } |
482 | 478 | ||
483 | static int dryice_rtc_remove(struct platform_device *pdev) | 479 | static int __devexit dryice_rtc_remove(struct platform_device *pdev) |
484 | { | 480 | { |
485 | struct imxdi_dev *imxdi = platform_get_drvdata(pdev); | 481 | struct imxdi_dev *imxdi = platform_get_drvdata(pdev); |
486 | 482 | ||
@@ -491,28 +487,18 @@ static int dryice_rtc_remove(struct platform_device *pdev) | |||
491 | 487 | ||
492 | rtc_device_unregister(imxdi->rtc); | 488 | rtc_device_unregister(imxdi->rtc); |
493 | 489 | ||
494 | clk_disable_unprepare(imxdi->clk); | 490 | clk_disable(imxdi->clk); |
495 | clk_put(imxdi->clk); | 491 | clk_put(imxdi->clk); |
496 | 492 | ||
497 | return 0; | 493 | return 0; |
498 | } | 494 | } |
499 | 495 | ||
500 | #ifdef CONFIG_OF | ||
501 | static const struct of_device_id dryice_dt_ids[] = { | ||
502 | { .compatible = "fsl,imx25-rtc" }, | ||
503 | { /* sentinel */ } | ||
504 | }; | ||
505 | |||
506 | MODULE_DEVICE_TABLE(of, dryice_dt_ids); | ||
507 | #endif | ||
508 | |||
509 | static struct platform_driver dryice_rtc_driver = { | 496 | static struct platform_driver dryice_rtc_driver = { |
510 | .driver = { | 497 | .driver = { |
511 | .name = "imxdi_rtc", | 498 | .name = "imxdi_rtc", |
512 | .owner = THIS_MODULE, | 499 | .owner = THIS_MODULE, |
513 | .of_match_table = of_match_ptr(dryice_dt_ids), | ||
514 | }, | 500 | }, |
515 | .remove = dryice_rtc_remove, | 501 | .remove = __devexit_p(dryice_rtc_remove), |
516 | }; | 502 | }; |
517 | 503 | ||
518 | static int __init dryice_rtc_init(void) | 504 | static int __init dryice_rtc_init(void) |