dmaengine: rcar-dmac: clear pertinence number of channels
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Thu, 3 Mar 2016 08:25:53 +0000 (17:25 +0900)
committerVinod Koul <vinod.koul@intel.com>
Thu, 3 Mar 2016 16:21:14 +0000 (21:51 +0530)
DMACHCLR clears each channels, but its channel number is based on
its SoC or IP. Current driver is using fixed 0x7fff (= for 15ch),
it is not good match for Gen3 or Gen2 Audio DMAC. This patch fixes it

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Acked-by: Geert Uytterhoeven <geert+renesas@glider.be>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
drivers/dma/sh/rcar-dmac.c

index 7820d07e7beea7dd0e4a93f12fd9c3ea99ef2bf8..dfb17926297bd4f095a77b8105725335fa7c1aff 100644 (file)
@@ -413,7 +413,7 @@ static int rcar_dmac_init(struct rcar_dmac *dmac)
        u16 dmaor;
 
        /* Clear all channels and enable the DMAC globally. */
-       rcar_dmac_write(dmac, RCAR_DMACHCLR, 0x7fff);
+       rcar_dmac_write(dmac, RCAR_DMACHCLR, GENMASK(dmac->n_channels - 1, 0));
        rcar_dmac_write(dmac, RCAR_DMAOR,
                        RCAR_DMAOR_PRI_FIXED | RCAR_DMAOR_DME);