From: Viresh Kumar <viresh.kumar@linaro.org>
To: Arnd Bergmann <arnd@arndb.de>
Cc: Vinod Koul <vinod.koul@intel.com>, Dan Williams <djbw@fb.com>,
linux-arm-kernel@lists.infradead.org,
devicetree-discuss@lists.ozlabs.org,
Olof Johansson <olof@lixom.net>,
linux-kernel@vger.kernel.org,
Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
Vinod Koul <vinod.koul@linux.intel.com>
Subject: Re: [PATCH 2/4] dmaengine: dw_dmac: move to generic DMA binding
Date: Sat, 16 Feb 2013 08:56:19 +0530 [thread overview]
Message-ID: <CAKohpo=u_b9u1=78+tm-rhVR14P0=2XbLrZEDJrQBY5W8LXiCw@mail.gmail.com> (raw)
In-Reply-To: <1360952512-971558-3-git-send-email-arnd@arndb.de>
On 15 February 2013 23:51, Arnd Bergmann <arnd@arndb.de> wrote:
> diff --git a/Documentation/devicetree/bindings/dma/snps-dma.txt b/Documentation/devicetree/bindings/dma/snps-dma.txt
> +- #dma-cells: must be <3>
> +DMA clients connected to the Designware DMA controller must use the format
> +described in the dma.txt file, using a five-cell specifier for each channel.
s/five/four ?
> +The four cells in order are:
> +
> +1. A phandle pointing to the DMA controller
> +2. The DMA request line number
> +3. Source master for transfers on allocated channel
> +4. Destination master for transfers on allocated channel
> diff --git a/drivers/dma/dw_dmac.c b/drivers/dma/dw_dmac.c
> +static bool dw_dma_generic_filter(struct dma_chan *chan, void *param)
> {
> + dws->cfg_hi = 0xffffffff;
> + dws->cfg_lo = 0xffffffff;
s/0xffffffff/-1 ?
> + dws->src_master = fargs->src;
> + dws->dst_master = fargs->dst;
> + dwc->req = fargs->req;
>
> - return true;
> - }
> - }
> + chan->private = dws;
> +
> + return true;
> +}
> +
> +static struct dma_chan *dw_dma_xlate(struct of_phandle_args *dma_spec,
> + struct of_dma *ofdma)
> +{
> + struct dw_dma *dw = ofdma->of_dma_data;
> + struct dw_dma_filter_args fargs = {
> + .dw = dw,
> + };
> + dma_cap_mask_t cap;
> +
> + if (dma_spec->args_count != 3)
> + return NULL;
> +
> + fargs.req = be32_to_cpup(dma_spec->args+0);
> + fargs.src = be32_to_cpup(dma_spec->args+1);
> + fargs.dst = be32_to_cpup(dma_spec->args+2);
> +
> + if (WARN_ON(fargs.req >= 16 || fargs.src >= 2 || fargs.dst >= 2))
> + return NULL;
>
> - last_dw = dw;
> - last_bus_id = param;
> - return false;
> + dma_cap_zero(cap);
> + dma_cap_set(DMA_SLAVE, cap);
> +
> + /* TODO: there should be a simpler way to do this */
> + return dma_request_channel(cap, dw_dma_generic_filter, &dma_spec->args[0]);
> }
> -EXPORT_SYMBOL(dw_dma_generic_filter);
>
> /* --------------------- Cyclic DMA API extensions -------------------- */
>
> @@ -1510,9 +1529,8 @@ static void dw_dma_off(struct dw_dma *dw)
> static struct dw_dma_platform_data *
> dw_dma_parse_dt(struct platform_device *pdev)
> {
> - struct device_node *sn, *cn, *np = pdev->dev.of_node;
> + struct device_node *np = pdev->dev.of_node;
> struct dw_dma_platform_data *pdata;
> - struct dw_dma_slave *sd;
> u32 tmp, arr[4];
>
> if (!np) {
> @@ -1524,7 +1542,7 @@ dw_dma_parse_dt(struct platform_device *pdev)
> if (!pdata)
> return NULL;
>
> - if (of_property_read_u32(np, "nr_channels", &pdata->nr_channels))
> + if (of_property_read_u32(np, "dma-channels", &pdata->nr_channels))
> return NULL;
next prev parent reply other threads:[~2013-02-16 3:26 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-02-15 18:21 [PATCH 0/4] dw_dmac: introduce generic DMA binding for DT Arnd Bergmann
2013-02-15 18:21 ` [PATCH 1/4] Revert "ARM: SPEAr13xx: Pass DW DMAC platform data from DT" Arnd Bergmann
2013-02-15 18:21 ` [PATCH 2/4] dmaengine: dw_dmac: move to generic DMA binding Arnd Bergmann
2013-02-16 3:26 ` Viresh Kumar [this message]
2013-02-16 10:07 ` Arnd Bergmann
2013-02-16 10:51 ` Russell King - ARM Linux
2013-02-16 13:43 ` Arnd Bergmann
2013-02-16 11:13 ` Andy Shevchenko
2013-02-16 14:00 ` Arnd Bergmann
2013-02-16 14:53 ` Andy Shevchenko
2013-02-16 22:21 ` [PATCHv3 " Arnd Bergmann
2013-02-16 22:54 ` Andy Shevchenko
2013-02-16 23:24 ` [PATCHv4 " Arnd Bergmann
2013-02-16 23:28 ` [PATCHv3 " Arnd Bergmann
2013-02-16 22:23 ` [BONUS PATCH] dmaengine: dw_dmac: simplify master selection Arnd Bergmann
2013-02-15 18:21 ` [PATCH 3/4] spi: pl022: use generic DMA slave configuration if possible Arnd Bergmann
2013-02-15 18:21 ` [PATCH 4/4] serial: pl011: " Arnd Bergmann
2013-02-16 3:26 ` [PATCH 0/4] dw_dmac: introduce generic DMA binding for DT Viresh Kumar
2013-02-20 8:03 ` Vinod Koul
2013-02-20 9:50 ` Arnd Bergmann
2013-02-20 9:58 ` Vinod Koul
2013-02-20 11:10 ` Arnd Bergmann
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='CAKohpo=u_b9u1=78+tm-rhVR14P0=2XbLrZEDJrQBY5W8LXiCw@mail.gmail.com' \
--to=viresh.kumar@linaro.org \
--cc=andriy.shevchenko@linux.intel.com \
--cc=arnd@arndb.de \
--cc=devicetree-discuss@lists.ozlabs.org \
--cc=djbw@fb.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=olof@lixom.net \
--cc=vinod.koul@intel.com \
--cc=vinod.koul@linux.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).