From patchwork Thu Jul 14 14:04:14 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sascha Hauer X-Patchwork-Id: 975062 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.4) with ESMTP id p6EE21tp027793 for ; Thu, 14 Jul 2011 14:04:34 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755171Ab1GNOEd (ORCPT ); Thu, 14 Jul 2011 10:04:33 -0400 Received: from metis.ext.pengutronix.de ([92.198.50.35]:43051 "EHLO metis.ext.pengutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755149Ab1GNOEd (ORCPT ); Thu, 14 Jul 2011 10:04:33 -0400 Received: from octopus.hi.pengutronix.de ([2001:6f8:1178:2:215:17ff:fe12:23b0]) by metis.ext.pengutronix.de with esmtp (Exim 4.72) (envelope-from ) id 1QhMWi-0006PP-Qb; Thu, 14 Jul 2011 16:04:28 +0200 Received: from sha by octopus.hi.pengutronix.de with local (Exim 4.76) (envelope-from ) id 1QhMWd-00009A-Nn; Thu, 14 Jul 2011 16:04:23 +0200 From: Sascha Hauer To: juergen.lambrecht@gmail.com Cc: Wolfram Sang , Sascha Hauer , Vinod Koul , Chris Ball , linux-mmc@vger.kernel.org, Liam Girdwood , Mark Brown , alsa-devel@alsa-project.org Subject: [PATCH 11/20] ARM i.MX dma: Fix burstsize settings Date: Thu, 14 Jul 2011 16:04:14 +0200 Message-Id: <1310652263-27948-11-git-send-email-s.hauer@pengutronix.de> X-Mailer: git-send-email 1.7.5.4 In-Reply-To: <1310652263-27948-1-git-send-email-s.hauer@pengutronix.de> References: <1310652263-27948-1-git-send-email-s.hauer@pengutronix.de> X-SA-Exim-Connect-IP: 2001:6f8:1178:2:215:17ff:fe12:23b0 X-SA-Exim-Mail-From: sha@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-mmc@vger.kernel.org Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Thu, 14 Jul 2011 14:04:50 +0000 (UTC) From: Wolfram Sang Already upstreamed. dmaengine expects the maxburst parameter in words, not bytes. The imxdma driver and its users do this wrong. Fix this. As a side note the imx-pcm-dma-mx2 driver was 'fixed' to work with imx-dma. This broke the driver with imx-sdma support which correctly takes the maxburst parameter in words. This patch puts the sdma based sound back to work. Signed-off-by: Sascha Hauer Cc: Vinod Koul Cc: Chris Ball Cc: linux-mmc@vger.kernel.org Cc: Liam Girdwood Cc: Mark Brown Cc: alsa-devel@alsa-project.org --- drivers/dma/imx-dma.c | 3 ++- sound/soc/imx/imx-pcm-dma-mx2.c | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/dma/imx-dma.c b/drivers/dma/imx-dma.c index e18eaab..d99f71c 100644 --- a/drivers/dma/imx-dma.c +++ b/drivers/dma/imx-dma.c @@ -135,7 +135,8 @@ static int imxdma_control(struct dma_chan *chan, enum dma_ctrl_cmd cmd, if (ret) return ret; - imx_dma_config_burstlen(imxdmac->imxdma_channel, imxdmac->watermark_level); + imx_dma_config_burstlen(imxdmac->imxdma_channel, + imxdmac->watermark_level * imxdmac->word_size); return 0; default: diff --git a/sound/soc/imx/imx-pcm-dma-mx2.c b/sound/soc/imx/imx-pcm-dma-mx2.c index 4173b3d..43fdc24f 100644 --- a/sound/soc/imx/imx-pcm-dma-mx2.c +++ b/sound/soc/imx/imx-pcm-dma-mx2.c @@ -110,12 +110,12 @@ static int imx_ssi_dma_alloc(struct snd_pcm_substream *substream, slave_config.direction = DMA_TO_DEVICE; slave_config.dst_addr = dma_params->dma_addr; slave_config.dst_addr_width = buswidth; - slave_config.dst_maxburst = dma_params->burstsize * buswidth; + slave_config.dst_maxburst = dma_params->burstsize; } else { slave_config.direction = DMA_FROM_DEVICE; slave_config.src_addr = dma_params->dma_addr; slave_config.src_addr_width = buswidth; - slave_config.src_maxburst = dma_params->burstsize * buswidth; + slave_config.src_maxburst = dma_params->burstsize; } ret = dmaengine_slave_config(iprtd->dma_chan, &slave_config);