From: arnd@arndb.de (Arnd Bergmann)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH RFC 1/7] dma: pl08x: Add support for the DMA slave map
Date: Mon, 07 Nov 2016 20:55:42 +0100 [thread overview]
Message-ID: <3693046.Gh6DJsekH3@wuerfel> (raw)
In-Reply-To: <3d10d013-b18c-e10e-b596-d4d0f8b6e973@samsung.com>
On Monday, November 7, 2016 4:41:58 PM CET Sylwester Nawrocki wrote:
> On 11/05/2016 12:26 AM, Arnd Bergmann wrote:
>
> static const struct dma_slave_map s3c64xx_dma1_slave_map[] = {
> - { "samsung-pcm.1", "tx", (void *)"pcm1_tx" },
> - { "samsung-pcm.1", "rx", (void *)"pcm1_rx" },
> - { "samsung-i2s.1", "tx", (void *)"i2s1_tx" },
> - { "samsung-i2s.1", "rx", (void *)"i2s1_rx" },
> - { "s3c6410-spi.1", "tx", (void *)"spi1_tx" },
> - { "s3c6410-spi.1", "rx", (void *)"spi1_rx" },
> + { "samsung-pcm.1", "tx", (void *)&s3c64xx_dma1_info[0] },
> + { "samsung-pcm.1", "rx", (void *)&s3c64xx_dma1_info[1] },
> + { "samsung-i2s.1", "tx", (void *)&s3c64xx_dma1_info[2] },
> + { "samsung-i2s.1", "rx", (void *)&s3c64xx_dma1_info[3] },
> + { "s3c6410-spi.1", "tx", (void *)&s3c64xx_dma1_info[4] },
> + { "s3c6410-spi.1", "rx", (void *)&s3c64xx_dma1_info[5] },
> };
>
I think you can drop the (void*) cast either way (before and after
this change).
> diff --git a/drivers/dma/amba-pl08x.c b/drivers/dma/amba-pl08x.c
> index d5c75c8..0d1eb2e 100644
> --- a/drivers/dma/amba-pl08x.c
> +++ b/drivers/dma/amba-pl08x.c
> @@ -1793,6 +1793,23 @@ bool pl08x_filter_id(struct dma_chan *chan, void *chan_id)
> }
> EXPORT_SYMBOL_GPL(pl08x_filter_id);
>
> +static bool pl08x_filter_fn(struct dma_chan *chan, void *chan_id)
> +{
> + struct pl08x_dma_chan *plchan;
> +
> + /* Reject channels for devices not bound to this driver */
> + if (chan->device->dev->driver != &pl08x_amba_driver.drv)
> + return false;
This check should not be needed, you only get channels for the
device itself.
> + plchan = to_pl08x_chan(chan);
> +
> + /* Check that the channel is not taken! */
> + if (plchan->cd == chan_id)
> + return true;
What I had in mind was a bit different: Instead of comparing the
channel, I was thinking of modifying the channel itself, something
like:
plchan->signal = chan_id->signal;
plchan->periph_buses = chan_id->periph_buses;
after that, remove the plchan->cd data. Unfortunately, the muxing in
arch/arm/mach-spear/ makes this a bit harder. I'd have to think
about it some more. It may be easier to do this after moving
spear and lpc32xx over to use dma_slave_map.
Arnd
next prev parent reply other threads:[~2016-11-07 19:55 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-11-04 16:14 [PATCH RFC 0/7] DMA: S3C64XX: Conversion to the new channel request API Sylwester Nawrocki
2016-11-04 16:14 ` Sylwester Nawrocki
2016-11-08 15:39 ` Charles Keepax
2016-11-08 16:02 ` Sylwester Nawrocki
2016-11-04 16:14 ` [PATCH RFC 1/7] dma: pl08x: Add support for the DMA slave map Sylwester Nawrocki
2016-11-04 23:26 ` Arnd Bergmann
2016-11-07 15:41 ` Sylwester Nawrocki
2016-11-07 19:55 ` Arnd Bergmann [this message]
2016-11-14 11:51 ` Sylwester Nawrocki
2016-11-04 16:14 ` [PATCH RFC 2/7] ARM: S3C64XX: Add DMA slave maps for PL080 devices Sylwester Nawrocki
2016-11-08 14:44 ` Charles Keepax
2016-11-08 14:55 ` Charles Keepax
2016-11-08 15:53 ` Sylwester Nawrocki
2016-11-10 11:03 ` Charles Keepax
2016-11-10 15:10 ` Sylwester Nawrocki
2016-11-10 15:18 ` Charles Keepax
2016-11-04 16:14 ` [PATCH RFC 3/7] spi: s3c64xx: Do not use platform_data for DMA parameters Sylwester Nawrocki
2016-11-04 17:12 ` Mark Brown
2016-11-07 2:51 ` Andi Shyti
2016-11-04 16:14 ` [PATCH RFC 4/7] ASoC: samsung: i2s: " Sylwester Nawrocki
2016-11-04 17:13 ` Mark Brown
2016-11-04 23:29 ` Arnd Bergmann
2016-11-07 16:02 ` Sylwester Nawrocki
2016-11-07 21:14 ` Arnd Bergmann
2016-11-04 16:14 ` [PATCH RFC 5/7] ASoC: samsung: pcm: " Sylwester Nawrocki
2016-11-04 17:13 ` Mark Brown
2016-11-04 16:14 ` [PATCH RFC 6/7] ARM: S3C64XX: Drop unused DMA fields from struct s3c64xx_spi_csinfo Sylwester Nawrocki
2016-11-04 16:14 ` [PATCH RFC 7/7] ARM: S3C64XX: Drop initialization of unused struct s3c_audio_pdata fields Sylwester Nawrocki
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=3693046.Gh6DJsekH3@wuerfel \
--to=arnd@arndb.de \
--cc=linux-arm-kernel@lists.infradead.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