From: yibin.gong@nxp.com
To: robh@kernel.org, shawnguo@kernel.org, s.hauer@pengutronix.de,
festevam@gmail.com, mark.rutland@arm.com, vkoul@kernel.org,
dan.j.williams@intel.com
Cc: linux-imx@nxp.com, linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org, dmaengine@vger.kernel.org,
devicetree@vger.kernel.org, kernel@pengutronix.de
Subject: [PATCH v2 1/7] dmaengine: fsl-edma: add dmamux_nr for next version
Date: Mon, 27 May 2019 16:51:12 +0800 [thread overview]
Message-ID: <20190527085118.40423-2-yibin.gong@nxp.com> (raw)
In-Reply-To: <20190527085118.40423-1-yibin.gong@nxp.com>
From: Robin Gong <yibin.gong@nxp.com>
Next version of edma such as edmav2 on i.mx7ulp has only one dmamux.
Add dmamux_nr instead of static macro define 'DMAMUX_NR'. No any
function change here.
Signed-off-by: Robin Gong <yibin.gong@nxp.com>
---
drivers/dma/fsl-edma-common.h | 1 +
drivers/dma/fsl-edma.c | 11 ++++++-----
2 files changed, 7 insertions(+), 5 deletions(-)
diff --git a/drivers/dma/fsl-edma-common.h b/drivers/dma/fsl-edma-common.h
index c53f76e..21a9cfd 100644
--- a/drivers/dma/fsl-edma-common.h
+++ b/drivers/dma/fsl-edma-common.h
@@ -145,6 +145,7 @@ struct fsl_edma_engine {
void __iomem *membase;
void __iomem *muxbase[DMAMUX_NR];
struct clk *muxclk[DMAMUX_NR];
+ u32 dmamux_nr;
struct mutex fsl_edma_mutex;
u32 n_chans;
int txirq;
diff --git a/drivers/dma/fsl-edma.c b/drivers/dma/fsl-edma.c
index d641ef8..7b65ef4 100644
--- a/drivers/dma/fsl-edma.c
+++ b/drivers/dma/fsl-edma.c
@@ -96,7 +96,7 @@ static struct dma_chan *fsl_edma_xlate(struct of_phandle_args *dma_spec,
struct fsl_edma_engine *fsl_edma = ofdma->of_dma_data;
struct dma_chan *chan, *_chan;
struct fsl_edma_chan *fsl_chan;
- unsigned long chans_per_mux = fsl_edma->n_chans / DMAMUX_NR;
+ unsigned long chans_per_mux = fsl_edma->n_chans / fsl_edma->dmamux_nr;
if (dma_spec->args_count != 2)
return NULL;
@@ -206,6 +206,7 @@ static int fsl_edma_probe(struct platform_device *pdev)
return -ENOMEM;
fsl_edma->version = v1;
+ fsl_edma->dmamux_nr = DMAMUX_NR;
fsl_edma->n_chans = chans;
mutex_init(&fsl_edma->fsl_edma_mutex);
@@ -217,7 +218,7 @@ static int fsl_edma_probe(struct platform_device *pdev)
fsl_edma_setup_regs(fsl_edma);
regs = &fsl_edma->regs;
- for (i = 0; i < DMAMUX_NR; i++) {
+ for (i = 0; i < fsl_edma->dmamux_nr; i++) {
char clkname[32];
res = platform_get_resource(pdev, IORESOURCE_MEM, 1 + i);
@@ -295,7 +296,7 @@ static int fsl_edma_probe(struct platform_device *pdev)
if (ret) {
dev_err(&pdev->dev,
"Can't register Freescale eDMA engine. (%d)\n", ret);
- fsl_disable_clocks(fsl_edma, DMAMUX_NR);
+ fsl_disable_clocks(fsl_edma, fsl_edma->dmamux_nr);
return ret;
}
@@ -304,7 +305,7 @@ static int fsl_edma_probe(struct platform_device *pdev)
dev_err(&pdev->dev,
"Can't register Freescale eDMA of_dma. (%d)\n", ret);
dma_async_device_unregister(&fsl_edma->dma_dev);
- fsl_disable_clocks(fsl_edma, DMAMUX_NR);
+ fsl_disable_clocks(fsl_edma, fsl_edma->dmamux_nr);
return ret;
}
@@ -323,7 +324,7 @@ static int fsl_edma_remove(struct platform_device *pdev)
fsl_edma_cleanup_vchan(&fsl_edma->dma_dev);
of_dma_controller_free(np);
dma_async_device_unregister(&fsl_edma->dma_dev);
- fsl_disable_clocks(fsl_edma, DMAMUX_NR);
+ fsl_disable_clocks(fsl_edma, fsl_edma->dmamux_nr);
return 0;
}
--
2.7.4
next prev parent reply other threads:[~2019-05-27 8:50 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-05-27 8:51 [PATCH v2 0/7] add edma2 for i.mx7ulp yibin.gong
2019-05-27 8:51 ` yibin.gong [this message]
2019-05-27 8:51 ` [PATCH v2 2/7] dmaengine: mcf-edma: update to 'dmamux_nr' yibin.gong
2019-05-27 8:51 ` [PATCH v2 3/7] dmaengine: fsl-edma-common: move dmamux register to another single function yibin.gong
2019-05-27 8:51 ` [PATCH v2 4/7] dmaengine: fsl-edma-common: version check for v2 instead yibin.gong
2019-05-27 9:08 ` Sascha Hauer
2019-05-27 9:52 ` Robin Gong
2019-05-27 8:51 ` [PATCH v2 5/7] dt-bindings: dma: fsl-edma: add new i.mx7ulp-edma yibin.gong
2019-05-27 8:51 ` [PATCH v2 6/7] dmaengine: fsl-edma: add i.mx7ulp edma2 version support yibin.gong
2019-05-27 9:05 ` Sascha Hauer
2019-05-27 10:04 ` Robin Gong
2019-05-27 10:10 ` Vinod Koul
2019-05-27 8:51 ` [PATCH v2 7/7] ARM: dts: imx7ulp: add edma device node yibin.gong
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190527085118.40423-2-yibin.gong@nxp.com \
--to=yibin.gong@nxp.com \
--cc=dan.j.williams@intel.com \
--cc=devicetree@vger.kernel.org \
--cc=dmaengine@vger.kernel.org \
--cc=festevam@gmail.com \
--cc=kernel@pengutronix.de \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-imx@nxp.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=robh@kernel.org \
--cc=s.hauer@pengutronix.de \
--cc=shawnguo@kernel.org \
--cc=vkoul@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).