From patchwork Tue Jun 28 11:17:57 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Nicolas Ferre X-Patchwork-Id: 924052 Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by demeter2.kernel.org (8.14.4/8.14.4) with ESMTP id p5SAB415007405 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Tue, 28 Jun 2011 10:11:26 GMT Received: from canuck.infradead.org ([2001:4978:20e::1]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1QbVFq-0003Dq-Cn; Tue, 28 Jun 2011 10:10:50 +0000 Received: from localhost ([127.0.0.1] helo=canuck.infradead.org) by canuck.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1QbVFq-0005rh-2V; Tue, 28 Jun 2011 10:10:50 +0000 Received: from newsmtp5.atmel.com ([204.2.163.5] helo=sjogate2.atmel.com) by canuck.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1QbVFl-0005qn-N2 for linux-arm-kernel@lists.infradead.org; Tue, 28 Jun 2011 10:10:47 +0000 Received: from meyreuil.atmel.fr ([10.159.254.132]) by sjogate2.atmel.com (8.13.6/8.13.6) with ESMTP id p5SA7XY0023946; Tue, 28 Jun 2011 03:07:33 -0700 (PDT) Received: from bendor.rfo.atmel.com ([10.159.245.201]) by meyreuil.atmel.fr (8.11.7p1+Sun/8.11.7) with ESMTP id p5SAAba01760; Tue, 28 Jun 2011 12:10:37 +0200 (MEST) From: Nicolas Ferre To: vinod.koul@intel.com, dan.j.williams@intel.com, linux-arm-kernel@lists.infradead.org Subject: [PATCH 3/3] dmaengine: at_hdmac: add slave config operation Date: Tue, 28 Jun 2011 13:17:57 +0200 Message-Id: <1151852b20789636633095406a180335364f4afb.1309259835.git.nicolas.ferre@atmel.com> X-Mailer: git-send-email 1.7.3 In-Reply-To: References: In-Reply-To: References: MIME-Version: 1.0 X-CRM114-Version: 20090807-BlameThorstenAndJenny ( TRE 0.7.6 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20110628_061045_933874_A997B55E X-CRM114-Status: GOOD ( 11.45 ) X-Spam-Score: -0.0 (/) X-Spam-Report: SpamAssassin version 3.3.1 on canuck.infradead.org summary: Content analysis details: (-0.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 T_RP_MATCHES_RCVD Envelope sender domain matches handover relay domain Cc: Nicolas Ferre , linux-kernel@vger.kernel.org, =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter2.kernel.org [140.211.167.43]); Tue, 28 Jun 2011 10:11:26 +0000 (UTC) X-MIME-Autoconverted: from base64 to 8bit by demeter2.kernel.org id p5SAB415007405 Only change source/destination peripheral register access width. Signed-off-by: Nicolas Ferre Signed-off-by: Uwe Kleine-König --- drivers/dma/at_hdmac.c | 29 +++++++++++++++++++++++++++++ 1 files changed, 29 insertions(+), 0 deletions(-) diff --git a/drivers/dma/at_hdmac.c b/drivers/dma/at_hdmac.c index 7096adb..9cb8044 100644 --- a/drivers/dma/at_hdmac.c +++ b/drivers/dma/at_hdmac.c @@ -954,6 +954,35 @@ static int atc_control(struct dma_chan *chan, enum dma_ctrl_cmd cmd, clear_bit(ATC_IS_PAUSED, &atchan->status); spin_unlock_irqrestore(&atchan->lock, flags); + } else if (cmd == DMA_SLAVE_CONFIG) { + struct dma_slave_config *dmaengine_cfg = (void *)arg; + struct at_dma_slave *atslave = chan->private; + enum dma_slave_buswidth sdma_width; + enum at_dma_slave_width atdma_width; + + /* only modify transfer size width */ + if (!atslave) + return -ENXIO; + + if (dmaengine_cfg->direction == DMA_FROM_DEVICE) + sdma_width = dmaengine_cfg->src_addr_width; + else + sdma_width = dmaengine_cfg->dst_addr_width; + + switch (sdma_width) { + case DMA_SLAVE_BUSWIDTH_1_BYTE: + atdma_width = AT_DMA_SLAVE_WIDTH_8BIT; + break; + case DMA_SLAVE_BUSWIDTH_2_BYTES: + atdma_width = AT_DMA_SLAVE_WIDTH_16BIT; + break; + case DMA_SLAVE_BUSWIDTH_4_BYTES: + atdma_width = AT_DMA_SLAVE_WIDTH_32BIT; + break; + default: + return -EINVAL; + } + atslave->reg_width = atdma_width; } else if (cmd == DMA_TERMINATE_ALL) { struct at_desc *desc, *_desc; /*