From 2d5e1399928ff76d431891ba91a3eaf671197ff6 Mon Sep 17 00:00:00 2001 From: Jaejoon Yoo Date: Thu, 18 Jan 2018 13:25:32 +0900 Subject: [PATCH] [COMMON] dma: Modify dma code for kernel 4.14 Change-Id: Ifaadf8bf3cdf19a126fc109a9da05cdf44c05359 Signed-off-by: Jaejoon Yoo --- drivers/dma/pl330.c | 17 ++++++++++++++++- drivers/dma/samsung-dma.c | 6 +++--- 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/drivers/dma/pl330.c b/drivers/dma/pl330.c index b6afd6f0cffd..73e1fc300679 100644 --- a/drivers/dma/pl330.c +++ b/drivers/dma/pl330.c @@ -29,7 +29,9 @@ #include #include "dmaengine.h" +#ifdef CONFIG_EXYNOS_PD #include +#endif #define PL330_MAX_CHAN 8 #define PL330_MAX_IRQS 32 @@ -752,6 +754,18 @@ static inline int _emit_MOV(unsigned dry_run, u8 buf[], return SZ_DMAMOV; } +static inline u32 _emit_NOP(unsigned dry_run, u8 buf[]) +{ + if (dry_run) + return SZ_DMANOP; + + buf[0] = CMD_DMANOP; + + PL330_DBGCMD_DUMP(SZ_DMANOP, "\tDMANOP\n"); + + return SZ_DMANOP; +} + static inline u32 _emit_RMB(unsigned dry_run, u8 buf[]) { if (dry_run) @@ -2947,6 +2961,7 @@ int pl330_dma_debug(struct dma_chan *chan) struct dma_pl330_chan *pch = to_pchan(chan); void __iomem *regs; struct pl330_thread *thrd; + unsigned idx; if (unlikely(!pch)) return -EINVAL; @@ -3003,7 +3018,6 @@ int pl330_dma_getposition(struct dma_chan *chan, struct dma_pl330_chan *pch = to_pchan(chan); void __iomem *regs; struct pl330_thread *thrd; - int idx; if (unlikely(!pch)) return -EINVAL; @@ -3269,6 +3283,7 @@ pl330_probe(struct amba_device *adev, const struct amba_id *id) pl330->lpa_nb.priority = 0; ret = exynos_pm_register_notifier(&pl330->lpa_nb); + if (ret) { dev_err(&adev->dev, "failed to register pm notifier\n"); goto probe_err3; diff --git a/drivers/dma/samsung-dma.c b/drivers/dma/samsung-dma.c index 3814dc9520f3..424fab5e2d83 100644 --- a/drivers/dma/samsung-dma.c +++ b/drivers/dma/samsung-dma.c @@ -31,10 +31,10 @@ static unsigned long samsung_dmadev_request(enum dma_ch dma_ch, { channel = (unsigned long)dma_request_slave_channel(dev, ch_name); return channel; + } else { + pr_err("No channel: %s\n", __func__); + return 0; } - else - return (u64)dma_request_channel(mask, pl330_filter, - (void *)dma_ch); } static int samsung_dmadev_release(unsigned long ch, void *param) -- 2.20.1