From patchwork Mon Feb 10 15:56:59 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Russell King X-Patchwork-Id: 3619591 X-Patchwork-Delegate: vinod.koul@intel.com Return-Path: X-Original-To: patchwork-dmaengine@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 7B117BF418 for ; Mon, 10 Feb 2014 15:57:05 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 7DE85201DE for ; Mon, 10 Feb 2014 15:57:04 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 78E4D20148 for ; Mon, 10 Feb 2014 15:57:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752842AbaBJP5D (ORCPT ); Mon, 10 Feb 2014 10:57:03 -0500 Received: from gw-1.arm.linux.org.uk ([78.32.30.217]:60049 "EHLO pandora.arm.linux.org.uk" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752180AbaBJP5B (ORCPT ); Mon, 10 Feb 2014 10:57:01 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=arm.linux.org.uk; s=pandora; h=Date:Sender:Message-Id:Subject:Cc:To:From:References:In-Reply-To; bh=hY0zqzAj940RtHHnfMikcUKHAZ4FmQsJ+KCWz/46KkU=; b=MO2EmS74W0yWS/LgUrJ/Jm2wP3iFNxQeRzEbCudp1zs+jZfrHz3zkCx7GyLex6PSHw9N++EOjg5mvko7jY6yn5zQSf/YdN1O5jwmEh8jLmf7dK86TiyEaTWXAHOfae4YLEU0NrKLCQFP+3Q/NcoDi43VCAvd8Rb8vQsXFk7gQms=; Received: from e0022681537dd.dyn.arm.linux.org.uk ([2002:4e20:1eda:1:222:68ff:fe15:37dd]:43920 helo=rmk-PC.arm.linux.org.uk) by pandora.arm.linux.org.uk with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.76) (envelope-from ) id 1WCtEC-000540-4l; Mon, 10 Feb 2014 15:57:00 +0000 Received: from rmk by rmk-PC.arm.linux.org.uk with local (Exim 4.76) (envelope-from ) id 1WCtEB-0006Ws-Ow; Mon, 10 Feb 2014 15:56:59 +0000 In-Reply-To: <20140210155531.GB26684@n2100.arm.linux.org.uk> References: <20140210155531.GB26684@n2100.arm.linux.org.uk> From: Russell King To: dmaengine@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-omap@vger.kernel.org Cc: Dan Williams , Vinod Koul Subject: [PATCH 13/26] dmaengine: omap-dma: move clnk_ctrl setting to preparation functions Message-Id: Date: Mon, 10 Feb 2014 15:56:59 +0000 Sender: dmaengine-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: dmaengine@vger.kernel.org X-Spam-Status: No, score=-7.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=ham 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 Move the clnk_ctrl setup to the preparation functions, saving its value in the omap_desc. This only needs to be set once per descriptor, not for each segment, so set it in omap_dma_start_desc() rather than omap_dma_start(). Signed-off-by: Russell King --- drivers/dma/omap-dma.c | 23 +++++++++-------------- 1 file changed, 9 insertions(+), 14 deletions(-) diff --git a/drivers/dma/omap-dma.c b/drivers/dma/omap-dma.c index 06727a78e883..49609275b2e7 100644 --- a/drivers/dma/omap-dma.c +++ b/drivers/dma/omap-dma.c @@ -59,6 +59,7 @@ struct omap_desc { int16_t fi; /* for OMAP_DMA_SYNC_PACKET */ uint8_t es; /* CSDP_DATA_TYPE_xxx */ uint32_t ccr; /* CCR value */ + uint16_t clnk_ctrl; /* CLNK_CTRL value */ uint16_t cicr; /* CICR value */ uint32_t csdp; /* CSDP value */ @@ -187,18 +188,6 @@ static void omap_dma_start(struct omap_chan *c, struct omap_desc *d) else c->plat->dma_write(0, CDAC, c->dma_ch); - if (!__dma_omap15xx(od->plat->dma_attr) && c->cyclic) { - val = c->plat->dma_read(CLNK_CTRL, c->dma_ch); - - if (dma_omap1()) - val &= ~(1 << 14); - - val |= c->dma_ch | CLNK_CTRL_ENABLE_LNK; - - c->plat->dma_write(val, CLNK_CTRL, c->dma_ch); - } else if (od->plat->errata & DMA_ERRATA_PARALLEL_CHANNELS) - c->plat->dma_write(c->dma_ch, CLNK_CTRL, c->dma_ch); - omap_dma_clear_csr(c); /* Enable interrupts */ @@ -330,6 +319,7 @@ static void omap_dma_start_desc(struct omap_chan *c) c->plat->dma_write(0, cxei, c->dma_ch); c->plat->dma_write(d->fi, cxfi, c->dma_ch); c->plat->dma_write(d->csdp, CSDP, c->dma_ch); + c->plat->dma_write(d->clnk_ctrl, CLNK_CTRL, c->dma_ch); omap_dma_start_sg(c, d, 0); } @@ -645,6 +635,8 @@ static struct dma_async_tx_descriptor *omap_dma_prep_slave_sg( } if (od->plat->errata & DMA_ERRATA_IFRAME_BUFFERING) d->ccr |= CCR_BUFFERING_DISABLE; + if (od->plat->errata & DMA_ERRATA_PARALLEL_CHANNELS) + d->clnk_ctrl = c->dma_ch; /* * Build our scatterlist entries: each contains the address, @@ -725,8 +717,6 @@ static struct dma_async_tx_descriptor *omap_dma_prep_dma_cyclic( d->sglen = 1; d->ccr = 0; - if (__dma_omap15xx(od->plat->dma_attr)) - d->ccr = CCR_AUTO_INIT | CCR_REPEAT; if (dir == DMA_DEV_TO_MEM) d->ccr |= CCR_DST_AMODE_POSTINC | CCR_SRC_AMODE_CONSTANT; else @@ -772,6 +762,11 @@ static struct dma_async_tx_descriptor *omap_dma_prep_dma_cyclic( if (od->plat->errata & DMA_ERRATA_IFRAME_BUFFERING) d->ccr |= CCR_BUFFERING_DISABLE; + if (__dma_omap15xx(od->plat->dma_attr)) + d->ccr |= CCR_AUTO_INIT | CCR_REPEAT; + else + d->clnk_ctrl = c->dma_ch | CLNK_CTRL_ENABLE_LNK; + c->cyclic = true; return vchan_tx_prep(&c->vc, &d->vd, flags);