Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754541AbbBNWsN (ORCPT ); Sat, 14 Feb 2015 17:48:13 -0500 Received: from smtp04.smtpout.orange.fr ([80.12.242.126]:50068 "EHLO smtp.smtpout.orange.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754439AbbBNWsJ (ORCPT ); Sat, 14 Feb 2015 17:48:09 -0500 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 Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, dmaengine@vger.kernel.org, Robert Jarzmik 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> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2450 Lines: 73 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 */ -- 2.1.0 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/