[COMMON] dma: Modify dma code for kernel 4.14
authorJaejoon Yoo <joonyj7.yoo@samsung.com>
Thu, 18 Jan 2018 04:25:32 +0000 (13:25 +0900)
committerTaekki Kim <taekki.kim@samsung.com>
Mon, 14 May 2018 05:42:48 +0000 (14:42 +0900)
Change-Id: Ifaadf8bf3cdf19a126fc109a9da05cdf44c05359
Signed-off-by: Jaejoon Yoo <joonyj7.yoo@samsung.com>
drivers/dma/pl330.c
drivers/dma/samsung-dma.c

index b6afd6f0cffd7c9c690dfb6d0eea40959f74c697..73e1fc300679d3161f869505c7bf4f6bfe299093 100644 (file)
@@ -29,7 +29,9 @@
 #include <linux/pm_runtime.h>
 
 #include "dmaengine.h"
+#ifdef CONFIG_EXYNOS_PD
 #include <soc/samsung/exynos-pm.h>
+#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;
index 3814dc9520f31506fc8eaac851965deeab564715..424fab5e2d83721fdd4f4d8f11faba3be6a16529 100644 (file)
@@ -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)