From: Robert Jarzmik <robert.jarzmik@free.fr>
To: Vinod Koul <vinod.koul@intel.com>, Arnd Bergmann <arnd@arndb.de>,
Olof Johansson <olof@lixom.net>, Daniel Mack <zonque@gmail.com>,
Haojian Zhuang <haojian.zhuang@gmail.com>
Cc: linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org, dmaengine@vger.kernel.org,
Robert Jarzmik <robert.jarzmik@free.fr>
Subject: [PATCH RFC 2/2] ARM: pxa: transition to dmaengine phase 1
Date: Sat, 14 Feb 2015 23:47:33 +0100 [thread overview]
Message-ID: <1423954053-21760-3-git-send-email-robert.jarzmik@free.fr> (raw)
In-Reply-To: <1423954053-21760-1-git-send-email-robert.jarzmik@free.fr>
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 <robert.jarzmik@free.fr>
---
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
next prev parent reply other threads:[~2015-02-14 22:48 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-02-14 22:47 [PATCH RFC 0/2] Prepare smooth PXA transition to dmaengine Robert Jarzmik
2015-02-14 22:47 ` [PATCH RFC 1/2] dma: mmp_dma: add support for legacy transition Robert Jarzmik
2015-02-14 22:47 ` Robert Jarzmik [this message]
2015-02-16 10:28 ` [PATCH RFC 2/2] ARM: pxa: transition to dmaengine phase 1 Arnd Bergmann
2015-02-16 11:12 ` robert.jarzmik
2015-02-16 11:33 ` Arnd Bergmann
2015-02-16 11:37 ` Daniel Mack
2015-02-16 11:14 ` Vasily Khoruzhick
2015-02-16 11:23 ` Daniel Mack
2015-02-16 16:54 ` Robert Jarzmik
2015-02-16 17:00 ` Vasily Khoruzhick
2015-02-16 18:03 ` Robert Jarzmik
2015-02-17 20:39 ` [PATCH v2 1/2] dma: mmp_dma: add support for legacy transition Robert Jarzmik
2015-02-17 20:39 ` [PATCH v2 2/2] ARM: pxa: transition to dmaengine phase 1 Robert Jarzmik
2015-02-19 10:29 ` [PATCH v2 1/2] dma: mmp_dma: add support for legacy transition Daniel Mack
2015-02-19 19:53 ` Robert Jarzmik
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1423954053-21760-3-git-send-email-robert.jarzmik@free.fr \
--to=robert.jarzmik@free.fr \
--cc=arnd@arndb.de \
--cc=dmaengine@vger.kernel.org \
--cc=haojian.zhuang@gmail.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=olof@lixom.net \
--cc=vinod.koul@intel.com \
--cc=zonque@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).