summaryrefslogtreecommitdiff
path: root/drivers/dma/sh
diff options
context:
space:
mode:
authorYoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>2019-09-09 09:34:52 +0300
committerVinod Koul <vkoul@kernel.org>2019-10-14 09:56:58 +0300
commitfcf8adb787073ba6c673c1bb9900a059c7f6676f (patch)
tree2bb9fb0072a8c6a84376842e7bf6f8846b22b998 /drivers/dma/sh
parentd832c481bff39a28eb7e9b28485b749cab6b29b3 (diff)
downloadlinux-fcf8adb787073ba6c673c1bb9900a059c7f6676f.tar.xz
dmaengine: rcar-dmac: Add dma-channel-mask property support
This patch adds dma-channel-mask property support not to reserve some DMA channels for some reasons. (for example: a heterogeneous CPU uses it.) Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com> Reviewed-by: Simon Horman <horms+renesas@verge.net.au> Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be> Link: https://lore.kernel.org/r/1568010892-17606-5-git-send-email-yoshihiro.shimoda.uh@renesas.com Signed-off-by: Vinod Koul <vkoul@kernel.org>
Diffstat (limited to 'drivers/dma/sh')
-rw-r--r--drivers/dma/sh/rcar-dmac.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/drivers/dma/sh/rcar-dmac.c b/drivers/dma/sh/rcar-dmac.c
index 542786de69a9..f06016d38a05 100644
--- a/drivers/dma/sh/rcar-dmac.c
+++ b/drivers/dma/sh/rcar-dmac.c
@@ -203,7 +203,7 @@ struct rcar_dmac {
unsigned int n_channels;
struct rcar_dmac_chan *channels;
- unsigned int channels_mask;
+ u32 channels_mask;
DECLARE_BITMAP(modules, 256);
};
@@ -1810,7 +1810,15 @@ static int rcar_dmac_parse_of(struct device *dev, struct rcar_dmac *dmac)
return -EINVAL;
}
+ /*
+ * If the driver is unable to read dma-channel-mask property,
+ * the driver assumes that it can use all channels.
+ */
dmac->channels_mask = GENMASK(dmac->n_channels - 1, 0);
+ of_property_read_u32(np, "dma-channel-mask", &dmac->channels_mask);
+
+ /* If the property has out-of-channel mask, this driver clears it */
+ dmac->channels_mask &= GENMASK(dmac->n_channels - 1, 0);
return 0;
}