From patchwork Thu Mar 10 10:07:53 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jean-Francois Moine X-Patchwork-Id: 8555301 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 73334C0553 for ; Thu, 10 Mar 2016 10:54:26 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id A038120351 for ; Thu, 10 Mar 2016 10:54:25 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id BA2392034C for ; Thu, 10 Mar 2016 10:54:24 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1adyD2-0006WT-Rq; Thu, 10 Mar 2016 10:52:48 +0000 Received: from smtp5-g21.free.fr ([212.27.42.5]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1adyCW-0005q0-3L for linux-arm-kernel@lists.infradead.org; Thu, 10 Mar 2016 10:52:18 +0000 Received: from localhost (unknown [IPv6:2a01:e35:2f5c:9de0:6b55:87da:4920:b782]) by smtp5-g21.free.fr (Postfix) with ESMTP id BBA13D480E8; Thu, 10 Mar 2016 11:48:00 +0100 (CET) X-Mailbox-Line: From 7f5fc4733c8145fe146bd2a7e0d8febfddf2fe6b Mon Sep 17 00:00:00 2001 Message-Id: <7f5fc4733c8145fe146bd2a7e0d8febfddf2fe6b.1457606136.git.moinejf@free.fr> In-Reply-To: References: From: Jean-Francois Moine Date: Thu, 10 Mar 2016 11:07:53 +0100 Subject: [PATCH 4/5] dmaengine: sun6i: Set default values to burst and bus width To: Vinod Koul , Maxime Ripard , Chen-Yu Tsai X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160310_025216_527275_6069F319 X-CRM114-Status: UNSURE ( 8.96 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -2.6 (--) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: dmaengine@vger.kernel.org, Jens Kuske , linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 --- 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;