From: Vinod Koul <vkoul@kernel.org>
To: h00249924 <hutenghui@huawei.com>
Cc: dmaengine@vger.kernel.org, devicetree@vger.kernel.org,
linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org, suzhuangluan@hisilicon.com,
kongfei@hisilicon.com, liyuequan@hisilicon.com,
cash.qianli@hisilicon.com, huangli295@hisilicon.com,
hantanglei@huawei.com, wangyoulin1@hisilicon.com,
ninggaoyu@hisilicon.com, hanxiaolong3@hisilicon.com,
Youlin Wang <wwx575822@notesmail.huawei.com>,
Dan Williams <dan.j.williams@intel.com>
Subject: [1/3] k3dma: Upgrade k3dma drever to support hisi_asp_dma hardware
Date: Fri, 4 Jan 2019 22:54:05 +0530 [thread overview]
Message-ID: <20190104172405.GR13372@vkoul-mobl.Dlink> (raw)
On 28-12-18, 14:36, h00249924 wrote:
> From: Youlin Wang <wwx575822@notesmail.huawei.com>
>
> There is an new "hisi-pcm-asp-dma-1.0" device added in
> "arch/arm64/boot/dts/hisilicon/hi3660.dtsi".
> So we have to add a matching id in the driver file:
> "{ .compatible = "hisilicon,hisi-pcm-asp-dma-1.0", }"
>
> And also hisi-pcm-asp dma device needs no setting to the clock.
> So we skip this by "if" sentence on id string matching:
> "if (strcasecmp((of_id->compatible), (k3_pdma_dt_ids[0].compatible)) == 0)"
>
> After above this driver will support both k3 and hisi_asp dma hardware.
>
> Signed-off-by: Youlin Wang <wwx575822@notesmail.huawei.com>
> Signed-off-by: Tanglei Han <hantanglei@huawei.com>
> Cc: Dan Williams <dan.j.williams@intel.com>
> Cc: Vinod Koul <vkoul@kernel.org>
> ---
> drivers/dma/k3dma.c | 11 +++++++----
> 1 file changed, 7 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/dma/k3dma.c b/drivers/dma/k3dma.c
> index fdec2b6..10eecc2 100644
> --- a/drivers/dma/k3dma.c
> +++ b/drivers/dma/k3dma.c
> @@ -792,6 +792,7 @@ static int k3_dma_transfer_resume(struct dma_chan *chan)
>
> static const struct of_device_id k3_pdma_dt_ids[] = {
> { .compatible = "hisilicon,k3-dma-1.0", },
> + { .compatible = "hisilicon,hisi-pcm-asp-dma-1.0", },
The binding doc patch should precede this..
> {}
> };
> MODULE_DEVICE_TABLE(of, k3_pdma_dt_ids);
> @@ -835,10 +836,12 @@ static int k3_dma_probe(struct platform_device *op)
> "dma-requests", &d->dma_requests);
> }
>
> - d->clk = devm_clk_get(&op->dev, NULL);
> - if (IS_ERR(d->clk)) {
> - dev_err(&op->dev, "no dma clk\n");
> - return PTR_ERR(d->clk);
> + if (strcasecmp((of_id->compatible), (k3_pdma_dt_ids[0].compatible)) == 0) {
> + d->clk = devm_clk_get(&op->dev, NULL);
who provides clk in this case? how does this scale if you have another
compatible in future for newer version of controller?
> + if (IS_ERR(d->clk)) {
> + dev_err(&op->dev, "no dma clk\n");
> + return PTR_ERR(d->clk);
> + }
> }
>
> irq = platform_get_irq(op, 0);
> --
> 1.9.1
next reply other threads:[~2019-01-04 17:24 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-01-04 17:24 Vinod Koul [this message]
-- strict thread matches above, loose matches on Subject: below --
2019-01-04 17:32 [1/3] k3dma: Upgrade k3dma drever to support hisi_asp_dma hardware John Stultz
2018-12-28 6:36 h00249924
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=20190104172405.GR13372@vkoul-mobl.Dlink \
--to=vkoul@kernel.org \
--cc=cash.qianli@hisilicon.com \
--cc=dan.j.williams@intel.com \
--cc=devicetree@vger.kernel.org \
--cc=dmaengine@vger.kernel.org \
--cc=hantanglei@huawei.com \
--cc=hanxiaolong3@hisilicon.com \
--cc=huangli295@hisilicon.com \
--cc=hutenghui@huawei.com \
--cc=kongfei@hisilicon.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=liyuequan@hisilicon.com \
--cc=ninggaoyu@hisilicon.com \
--cc=suzhuangluan@hisilicon.com \
--cc=wangyoulin1@hisilicon.com \
--cc=wwx575822@notesmail.huawei.com \
/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