diff options
author | Sebastian Andrzej Siewior <bigeasy@linutronix.de> | 2013-08-20 12:35:53 -0400 |
---|---|---|
committer | Felipe Balbi <balbi@ti.com> | 2013-08-27 15:19:52 -0400 |
commit | d6aafa2bf3bc1ca43405a4b753d91d7549224fdc (patch) | |
tree | a060e8d5bd5c875522ee1466a45621cfebfdfb7f /drivers/dma/cppi41.c | |
parent | 2ae847a1b10f3da5931fc9d04cc5950624418cf4 (diff) |
dma: cpp41: enable pm_runtime during init
With enabled pm_runtime in the kernel the device won't work because it
is not "on" during the probe function. This patch enables the device via
pm_runtime on probe so it remains activated.
Acked-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Diffstat (limited to 'drivers/dma/cppi41.c')
-rw-r--r-- | drivers/dma/cppi41.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/drivers/dma/cppi41.c b/drivers/dma/cppi41.c index e69617889953..6c4e64f2f3e7 100644 --- a/drivers/dma/cppi41.c +++ b/drivers/dma/cppi41.c | |||
@@ -9,6 +9,7 @@ | |||
9 | #include <linux/dmapool.h> | 9 | #include <linux/dmapool.h> |
10 | #include <linux/interrupt.h> | 10 | #include <linux/interrupt.h> |
11 | #include <linux/of_address.h> | 11 | #include <linux/of_address.h> |
12 | #include <linux/pm_runtime.h> | ||
12 | #include "dmaengine.h" | 13 | #include "dmaengine.h" |
13 | 14 | ||
14 | #define DESC_TYPE 27 | 15 | #define DESC_TYPE 27 |
@@ -960,6 +961,11 @@ static int cppi41_dma_probe(struct platform_device *pdev) | |||
960 | goto err_remap; | 961 | goto err_remap; |
961 | } | 962 | } |
962 | 963 | ||
964 | pm_runtime_enable(&pdev->dev); | ||
965 | ret = pm_runtime_get_sync(&pdev->dev); | ||
966 | if (ret) | ||
967 | goto err_get_sync; | ||
968 | |||
963 | cdd->queues_rx = glue_info->queues_rx; | 969 | cdd->queues_rx = glue_info->queues_rx; |
964 | cdd->queues_tx = glue_info->queues_tx; | 970 | cdd->queues_tx = glue_info->queues_tx; |
965 | cdd->td_queue = glue_info->td_queue; | 971 | cdd->td_queue = glue_info->td_queue; |
@@ -1005,6 +1011,9 @@ err_irq: | |||
1005 | err_chans: | 1011 | err_chans: |
1006 | deinit_cpii41(pdev, cdd); | 1012 | deinit_cpii41(pdev, cdd); |
1007 | err_init_cppi: | 1013 | err_init_cppi: |
1014 | pm_runtime_put(&pdev->dev); | ||
1015 | err_get_sync: | ||
1016 | pm_runtime_disable(&pdev->dev); | ||
1008 | iounmap(cdd->usbss_mem); | 1017 | iounmap(cdd->usbss_mem); |
1009 | iounmap(cdd->ctrl_mem); | 1018 | iounmap(cdd->ctrl_mem); |
1010 | iounmap(cdd->sched_mem); | 1019 | iounmap(cdd->sched_mem); |
@@ -1029,6 +1038,8 @@ static int cppi41_dma_remove(struct platform_device *pdev) | |||
1029 | iounmap(cdd->ctrl_mem); | 1038 | iounmap(cdd->ctrl_mem); |
1030 | iounmap(cdd->sched_mem); | 1039 | iounmap(cdd->sched_mem); |
1031 | iounmap(cdd->qmgr_mem); | 1040 | iounmap(cdd->qmgr_mem); |
1041 | pm_runtime_put(&pdev->dev); | ||
1042 | pm_runtime_disable(&pdev->dev); | ||
1032 | kfree(cdd); | 1043 | kfree(cdd); |
1033 | return 0; | 1044 | return 0; |
1034 | } | 1045 | } |