All of lore.kernel.org
 help / color / mirror / Atom feed
From: moinejf@free.fr (Jean-Francois Moine)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 4/5] dmaengine: sun6i: Set default values to burst and bus width
Date: Thu, 10 Mar 2016 11:07:53 +0100	[thread overview]
Message-ID: <7f5fc4733c8145fe146bd2a7e0d8febfddf2fe6b.1457606136.git.moinejf@free.fr> (raw)
In-Reply-To: <cover.1457606136.git.moinejf@free.fr>

When defining the DMA transfer, the sound PCM DMA engine sets only
the burst and bus width values on the DMA side.
This was making the audio transfers to be rejected because of invalid
values on the memory side.

Signed-off-by: Jean-Francois Moine <moinejf@free.fr>
---
 drivers/dma/sun6i-dma.c | 20 ++++++++++++++++----
 1 file changed, 16 insertions(+), 4 deletions(-)

diff --git a/drivers/dma/sun6i-dma.c b/drivers/dma/sun6i-dma.c
index 7c98c0d..c27d572 100644
--- a/drivers/dma/sun6i-dma.c
+++ b/drivers/dma/sun6i-dma.c
@@ -288,19 +288,31 @@ static inline int sun6i_dma_cfg_lli(struct sun6i_dma_lli *lli,
 	if (!config)
 		return -EINVAL;
 
-	src_burst = convert_burst(config->src_maxburst);
+	if (config->src_maxburst == 0)
+		src_burst = convert_burst(config->dst_maxburst);
+	else
+		src_burst = convert_burst(config->src_maxburst);
 	if (src_burst < 0)
 		return src_burst;
 
-	dst_burst = convert_burst(config->dst_maxburst);
+	if (config->dst_maxburst == 0)
+		dst_burst = convert_burst(config->src_maxburst);
+	else
+		dst_burst = convert_burst(config->dst_maxburst);
 	if (dst_burst < 0)
 		return dst_burst;
 
-	src_width = convert_buswidth(config->src_addr_width);
+	if (config->src_addr_width == DMA_SLAVE_BUSWIDTH_UNDEFINED)
+		src_width = convert_buswidth(config->dst_addr_width);
+	else
+		src_width = convert_buswidth(config->src_addr_width);
 	if (src_width < 0)
 		return src_width;
 
-	dst_width = convert_buswidth(config->dst_addr_width);
+	if (config->dst_addr_width == DMA_SLAVE_BUSWIDTH_UNDEFINED)
+		dst_width = convert_buswidth(config->src_addr_width);
+	else
+		dst_width = convert_buswidth(config->dst_addr_width);
 	if (dst_width < 0)
 		return dst_width;
 
-- 
2.7.2

  parent reply	other threads:[~2016-03-10 10:07 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-10 10:35 [PATCH 0/5] dmaengine: sun6i: Fixes and upgrade for audio transfers Jean-Francois Moine
2016-03-10  9:15 ` [PATCH 1/5] dmaengine: sun6i: Fix the access of the IRQ register Jean-Francois Moine
2016-03-11  6:39   ` Vinod Koul
2016-03-11  7:16     ` Jean-Francois Moine
2016-03-11 10:56   ` Maxime Ripard
2016-03-10  9:27 ` [PATCH 2/5] dmaengine: sun6i: Fix impossible settings of burst and bus width Jean-Francois Moine
2016-03-11  6:42   ` Vinod Koul
2016-03-11  7:20     ` Jean-Francois Moine
2016-03-11 10:58   ` Maxime Ripard
2016-03-10  9:56 ` [PATCH 3/5] dmaengine: sun6i: Add 4 as a possible bust value Jean-Francois Moine
2016-03-10 19:52   ` Sergei Shtylyov
2016-03-10 10:07 ` Jean-Francois Moine [this message]
2016-03-11  6:47   ` [PATCH 4/5] dmaengine: sun6i: Set default values to burst and bus width Vinod Koul
2016-03-10 10:21 ` [PATCH 5/5] dmaengine: sun6i: Add cyclic capability Jean-Francois Moine
2016-03-11  7:32   ` Vinod Koul

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=7f5fc4733c8145fe146bd2a7e0d8febfddf2fe6b.1457606136.git.moinejf@free.fr \
    --to=moinejf@free.fr \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.