From: linux@arm.linux.org.uk (Russell King - ARM Linux)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] i2c: at91: add dma support
Date: Wed, 17 Oct 2012 09:38:29 +0100 [thread overview]
Message-ID: <20121017083828.GJ21164@n2100.arm.linux.org.uk> (raw)
In-Reply-To: <1349876587-31182-1-git-send-email-ludovic.desroches@atmel.com>
On Wed, Oct 10, 2012 at 03:43:07PM +0200, ludovic.desroches at atmel.com wrote:
> + txdesc = chan_tx->device->device_prep_slave_sg(chan_tx, &dma->sg,
> + 1, DMA_TO_DEVICE, DMA_PREP_INTERRUPT | DMA_CTRL_ACK, NULL);
No, a while back the DMA engine API changed. It no longer takes
DMA_TO_DEVICE/DMA_FROM_DEVICE but DMA_MEM_TO_DEV and DMA_DEV_TO_MEM.
> + /* Keep in mind that we won't use dma to read the last two bytes */
> + at91_twi_irq_save(dev);
> + dma_addr = dma_map_single(dev->dev, dev->buf, dev->buf_len - 2,
> + DMA_FROM_DEVICE);
Ditto.
> + dma->xfer_in_progress = true;
> + cookie = rxdesc->tx_submit(rxdesc);
> + if (dma_submit_error(cookie)) {
tx_submit never errors (anymore.)
> + slave_config.direction = DMA_TO_DEVICE;
Same comment as for the other directions. Note that DMA engine drivers
really should ignore this parameter now, and DMA engine users should phase
it out.
> + if (dmaengine_slave_config(dma->chan_tx, &slave_config)) {
> + dev_err(dev->dev, "failed to configure tx channel\n");
> + ret = -EINVAL;
> + goto error;
> + }
> +
> + slave_config.direction = DMA_FROM_DEVICE;
Ditto.
prev parent reply other threads:[~2012-10-17 8:38 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-10-10 13:43 [PATCH] i2c: at91: add dma support ludovic.desroches at atmel.com
2012-10-17 7:31 ` Nicolas Ferre
2012-10-17 8:38 ` Russell King - ARM Linux [this message]
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=20121017083828.GJ21164@n2100.arm.linux.org.uk \
--to=linux@arm.linux.org.uk \
--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;
as well as URLs for NNTP newsgroup(s).