From patchwork Sat Feb 14 22:47:33 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robert Jarzmik X-Patchwork-Id: 5828931 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 3C8D7BF440 for ; Sat, 14 Feb 2015 22:51:20 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id DA0B22021F for ; Sat, 14 Feb 2015 22:51:18 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id CFA2F201C8 for ; Sat, 14 Feb 2015 22:51:17 +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 1YMlVu-0000Xx-R0; Sat, 14 Feb 2015 22:48:38 +0000 Received: from smtp04.smtpout.orange.fr ([80.12.242.126] helo=smtp.smtpout.orange.fr) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1YMlVj-0000SQ-P8 for linux-arm-kernel@lists.infradead.org; Sat, 14 Feb 2015 22:48:28 +0000 Received: from beldin.home ([109.220.218.8]) by mwinf5d51 with ME id sNnm1p00A0BTmwl03No7ij; Sat, 14 Feb 2015 23:48:07 +0100 X-ME-Helo: beldin.home X-ME-Date: Sat, 14 Feb 2015 23:48:07 +0100 X-ME-IP: 109.220.218.8 From: Robert Jarzmik To: Vinod Koul , Arnd Bergmann , Olof Johansson , Daniel Mack , Haojian Zhuang Subject: [PATCH RFC 2/2] ARM: pxa: transition to dmaengine phase 1 Date: Sat, 14 Feb 2015 23:47:33 +0100 Message-Id: <1423954053-21760-3-git-send-email-robert.jarzmik@free.fr> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1423954053-21760-1-git-send-email-robert.jarzmik@free.fr> References: <1423954053-21760-1-git-send-email-robert.jarzmik@free.fr> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150214_144828_178639_446454DF X-CRM114-Status: GOOD ( 12.64 ) X-Spam-Score: 0.0 (/) Cc: dmaengine@vger.kernel.org, Robert Jarzmik , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , 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, T_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 In order to slowly transition pxa to dmaengine, the legacy code will now rely on dmaengine to request a channel. This implies that PXA architecture selects DMADEVICES and MMP_PDMA, which is not pretty. Yet it enables PXA drivers to be ported one by one, with part of them using dmaengine, and the other part using the legacy code. Signed-off-by: Robert Jarzmik --- arch/arm/Kconfig | 2 ++ arch/arm/plat-pxa/dma.c | 4 +++- arch/arm/plat-pxa/include/plat/dma.h | 1 + 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index bb358d2..cc23f2b 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig @@ -617,10 +617,12 @@ config ARCH_PXA select CLKDEV_LOOKUP select CLKSRC_MMIO select CLKSRC_OF + select DMADEVICES select GENERIC_CLOCKEVENTS select GPIO_PXA select HAVE_IDE select IRQ_DOMAIN + select MMP_PDMA select MULTI_IRQ_HANDLER select PLAT_PXA select SPARSE_IRQ diff --git a/arch/arm/plat-pxa/dma.c b/arch/arm/plat-pxa/dma.c index 054fc5a..e5094a6 100644 --- a/arch/arm/plat-pxa/dma.c +++ b/arch/arm/plat-pxa/dma.c @@ -294,7 +294,8 @@ int pxa_request_dma (char *name, pxa_dma_prio prio, /* try grabbing a DMA channel with the requested priority */ for (i = 0; i < num_dma_channels; i++) { if ((dma_channels[i].prio == prio) && - !dma_channels[i].name) { + !dma_channels[i].name && + !mmp_pdma_toggle_reserved_channel(i)) { found = 1; break; } @@ -331,6 +332,7 @@ void pxa_free_dma (int dma_ch) local_irq_save(flags); DCSR(dma_ch) = DCSR_STARTINTR|DCSR_ENDINTR|DCSR_BUSERR; dma_channels[dma_ch].name = NULL; + mmp_pdma_toggle_reserved_channel(dma_ch); local_irq_restore(flags); } EXPORT_SYMBOL(pxa_free_dma); diff --git a/arch/arm/plat-pxa/include/plat/dma.h b/arch/arm/plat-pxa/include/plat/dma.h index a7b91dc..f4c6339 100644 --- a/arch/arm/plat-pxa/include/plat/dma.h +++ b/arch/arm/plat-pxa/include/plat/dma.h @@ -81,5 +81,6 @@ int pxa_request_dma (char *name, void *data); void pxa_free_dma (int dma_ch); +extern int mmp_pdma_toggle_reserved_channel(int legacy_channel); #endif /* __PLAT_DMA_H */