diff mbox

[07/12] spi: sh-msiof: Configure DMA slave bus width

Message ID 1407329949-5695-8-git-send-email-geert+renesas@glider.be (mailing list archive)
State Not Applicable
Headers show

Commit Message

Geert Uytterhoeven Aug. 6, 2014, 12:59 p.m. UTC
The new Renesas R-Car Gen2 DMA Controller driver (rcar-dmac) requires
explicit configuration of the DMA slave bus width.
Hardcode the DMA transfer size to 4 bytes, as MSIOF DMA is limited to
32-bit words.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
 drivers/spi/spi-sh-msiof.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

Comments

Mark Brown Aug. 6, 2014, 8:36 p.m. UTC | #1
On Wed, Aug 06, 2014 at 02:59:04PM +0200, Geert Uytterhoeven wrote:
> The new Renesas R-Car Gen2 DMA Controller driver (rcar-dmac) requires
> explicit configuration of the DMA slave bus width.
> Hardcode the DMA transfer size to 4 bytes, as MSIOF DMA is limited to
> 32-bit words.

Applied, thanks.
diff mbox

Patch

diff --git a/drivers/spi/spi-sh-msiof.c b/drivers/spi/spi-sh-msiof.c
index 887c2084130f..b19cbb4cb4a0 100644
--- a/drivers/spi/spi-sh-msiof.c
+++ b/drivers/spi/spi-sh-msiof.c
@@ -987,10 +987,13 @@  static struct dma_chan *sh_msiof_request_dma_chan(struct device *dev,
 	memset(&cfg, 0, sizeof(cfg));
 	cfg.slave_id = id;
 	cfg.direction = dir;
-	if (dir == DMA_MEM_TO_DEV)
+	if (dir == DMA_MEM_TO_DEV) {
 		cfg.dst_addr = port_addr;
-	else
+		cfg.dst_addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES;
+	} else {
 		cfg.src_addr = port_addr;
+		cfg.src_addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES;
+	}
 
 	ret = dmaengine_slave_config(chan, &cfg);
 	if (ret) {