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>
This commit is contained in:
parent
2ae847a1b1
commit
d6aafa2bf3
|
@ -9,6 +9,7 @@
|
||||||
#include <linux/dmapool.h>
|
#include <linux/dmapool.h>
|
||||||
#include <linux/interrupt.h>
|
#include <linux/interrupt.h>
|
||||||
#include <linux/of_address.h>
|
#include <linux/of_address.h>
|
||||||
|
#include <linux/pm_runtime.h>
|
||||||
#include "dmaengine.h"
|
#include "dmaengine.h"
|
||||||
|
|
||||||
#define DESC_TYPE 27
|
#define DESC_TYPE 27
|
||||||
|
@ -960,6 +961,11 @@ static int cppi41_dma_probe(struct platform_device *pdev)
|
||||||
goto err_remap;
|
goto err_remap;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pm_runtime_enable(&pdev->dev);
|
||||||
|
ret = pm_runtime_get_sync(&pdev->dev);
|
||||||
|
if (ret)
|
||||||
|
goto err_get_sync;
|
||||||
|
|
||||||
cdd->queues_rx = glue_info->queues_rx;
|
cdd->queues_rx = glue_info->queues_rx;
|
||||||
cdd->queues_tx = glue_info->queues_tx;
|
cdd->queues_tx = glue_info->queues_tx;
|
||||||
cdd->td_queue = glue_info->td_queue;
|
cdd->td_queue = glue_info->td_queue;
|
||||||
|
@ -1005,6 +1011,9 @@ err_irq:
|
||||||
err_chans:
|
err_chans:
|
||||||
deinit_cpii41(pdev, cdd);
|
deinit_cpii41(pdev, cdd);
|
||||||
err_init_cppi:
|
err_init_cppi:
|
||||||
|
pm_runtime_put(&pdev->dev);
|
||||||
|
err_get_sync:
|
||||||
|
pm_runtime_disable(&pdev->dev);
|
||||||
iounmap(cdd->usbss_mem);
|
iounmap(cdd->usbss_mem);
|
||||||
iounmap(cdd->ctrl_mem);
|
iounmap(cdd->ctrl_mem);
|
||||||
iounmap(cdd->sched_mem);
|
iounmap(cdd->sched_mem);
|
||||||
|
@ -1029,6 +1038,8 @@ static int cppi41_dma_remove(struct platform_device *pdev)
|
||||||
iounmap(cdd->ctrl_mem);
|
iounmap(cdd->ctrl_mem);
|
||||||
iounmap(cdd->sched_mem);
|
iounmap(cdd->sched_mem);
|
||||||
iounmap(cdd->qmgr_mem);
|
iounmap(cdd->qmgr_mem);
|
||||||
|
pm_runtime_put(&pdev->dev);
|
||||||
|
pm_runtime_disable(&pdev->dev);
|
||||||
kfree(cdd);
|
kfree(cdd);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue