]> asedeno.scripts.mit.edu Git - linux.git/blobdiff - drivers/dma/fsl-edma-common.c
Merge tag 'wireless-drivers-for-davem-2019-10-15' of git://git.kernel.org/pub/scm...
[linux.git] / drivers / dma / fsl-edma-common.c
index 44d92c34dec31d4850566ca8d1809e623164e785..b1a7ca91701a80365e74e2f0d6669b8816297629 100644 (file)
@@ -90,8 +90,21 @@ static void mux_configure8(struct fsl_edma_chan *fsl_chan, void __iomem *addr,
        iowrite8(val8, addr + off);
 }
 
+static void mux_configure32(struct fsl_edma_chan *fsl_chan, void __iomem *addr,
+                           u32 off, u32 slot, bool enable)
+{
+       u32 val;
+
+       if (enable)
+               val = EDMAMUX_CHCFG_ENBL << 24 | slot;
+       else
+               val = EDMAMUX_CHCFG_DIS;
+
+       iowrite32(val, addr + off * 4);
+}
+
 void fsl_edma_chan_mux(struct fsl_edma_chan *fsl_chan,
-                       unsigned int slot, bool enable)
+                      unsigned int slot, bool enable)
 {
        u32 ch = fsl_chan->vchan.chan.chan_id;
        void __iomem *muxaddr;
@@ -103,7 +116,10 @@ void fsl_edma_chan_mux(struct fsl_edma_chan *fsl_chan,
        muxaddr = fsl_chan->edma->muxbase[ch / chans_per_mux];
        slot = EDMAMUX_CHCFG_SOURCE(slot);
 
-       mux_configure8(fsl_chan, muxaddr, ch_off, slot, enable);
+       if (fsl_chan->edma->drvdata->version == v3)
+               mux_configure32(fsl_chan, muxaddr, ch_off, slot, enable);
+       else
+               mux_configure8(fsl_chan, muxaddr, ch_off, slot, enable);
 }
 EXPORT_SYMBOL_GPL(fsl_edma_chan_mux);