From: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
To: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Cc: linux-sh@vger.kernel.org, Vinod Koul <vinod.koul@intel.com>,
Chris Ball <cjb@laptop.org>,
linux-mmc@vger.kernel.org, devicetree-discuss@lists.ozlabs.org,
Rob Herring <rob.herring@calxeda.com>,
Grant Likely <grant.likely@secretlab.ca>,
Magnus Damm <magnus.damm@gmail.com>,
Simon Horman <horms@verge.net.au>,
Guennadi Liakhovetski <g.liakhovetski+renesas@gmail.com>
Subject: Re: [PATCH 1/4] mmc: sh_mmcif: add support for Device Tree DMA bindings
Date: Thu, 06 Jun 2013 20:38:46 +0400 [thread overview]
Message-ID: <51B0BB16.6060401@cogentembedded.com> (raw)
In-Reply-To: <1370533588-23642-2-git-send-email-g.liakhovetski@gmx.de>
Hello.
On 06/06/2013 07:46 PM, Guennadi Liakhovetski wrote:
> To use DMA in the Device Tree case the driver has to be modified
> to use suitable API to obtain DMA channels.
>
> Signed-off-by: Guennadi Liakhovetski <g.liakhovetski+renesas@gmail.com>
> ---
> drivers/mmc/host/sh_mmcif.c | 29 ++++++++++++++++++-----------
> 1 files changed, 18 insertions(+), 11 deletions(-)
>
> diff --git a/drivers/mmc/host/sh_mmcif.c b/drivers/mmc/host/sh_mmcif.c
> index 06caaae..a0937ae 100644
> --- a/drivers/mmc/host/sh_mmcif.c
> +++ b/drivers/mmc/host/sh_mmcif.c
> @@ -386,25 +386,30 @@ static void sh_mmcif_request_dma(struct sh_mmcif_host *host,
>
> host->dma_active = false;
>
> - if (!pdata)
> - return;
> -
> - if (pdata->slave_id_tx <= 0 || pdata->slave_id_rx <= 0)
> - return;
> + if (pdata) {
> + if (pdata->slave_id_tx <= 0 || pdata->slave_id_rx <= 0)
> + return;
> + } else {
> + if (!host->pd->dev.of_node)
Why not *else if*?
> + return;
> + }
>
> /* We can only either use DMA for both Tx and Rx or not use it at all */
> dma_cap_zero(mask);
> dma_cap_set(DMA_SLAVE, mask);
>
> - host->chan_tx = dma_request_channel(mask, shdma_chan_filter,
> - (void *)pdata->slave_id_tx);
> + host->chan_tx = dma_request_slave_channel_compat(mask, shdma_chan_filter,
> + pdata ? (void *)pdata->slave_id_tx : NULL,
> + &host->pd->dev, "tx");
Could you leave the indentation unchanged here?
> @@ -412,15 +417,17 @@ static void sh_mmcif_request_dma(struct sh_mmcif_host *host,
> if (ret < 0)
> goto ecfgtx;
>
> - host->chan_rx = dma_request_channel(mask, shdma_chan_filter,
> - (void *)pdata->slave_id_rx);
> + host->chan_rx = dma_request_slave_channel_compat(mask, shdma_chan_filter,
> + pdata ? (void *)pdata->slave_id_rx : NULL,
> + &host->pd->dev, "rx");
... and here?
WBR, Sergei
next prev parent reply other threads:[~2013-06-06 16:38 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-06-06 15:46 [PATCH 0/4] mmc: MMCIF & SDHI: DT DMA support Guennadi Liakhovetski
2013-06-06 15:46 ` [PATCH 1/4] mmc: sh_mmcif: add support for Device Tree DMA bindings Guennadi Liakhovetski
2013-06-06 16:38 ` Sergei Shtylyov [this message]
2013-06-06 15:46 ` [PATCH 2/4] mmc: sdhi/tmio: make DMA filter implementation specific Guennadi Liakhovetski
[not found] ` <1370533588-23642-1-git-send-email-g.liakhovetski-Mmb7MZpHnFY@public.gmane.org>
2013-06-06 15:46 ` [PATCH 3/4] mmc: sdhi/tmio: switch to using dmaengine_slave_config() Guennadi Liakhovetski
2013-06-06 15:46 ` [PATCH 4/4] mmc: sdhi/tmio: add DT DMA support Guennadi Liakhovetski
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=51B0BB16.6060401@cogentembedded.com \
--to=sergei.shtylyov@cogentembedded.com \
--cc=cjb@laptop.org \
--cc=devicetree-discuss@lists.ozlabs.org \
--cc=g.liakhovetski+renesas@gmail.com \
--cc=g.liakhovetski@gmx.de \
--cc=grant.likely@secretlab.ca \
--cc=horms@verge.net.au \
--cc=linux-mmc@vger.kernel.org \
--cc=linux-sh@vger.kernel.org \
--cc=magnus.damm@gmail.com \
--cc=rob.herring@calxeda.com \
--cc=vinod.koul@intel.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;
as well as URLs for NNTP newsgroup(s).