From f53f066c25036210036730d64c876ea586114425 Mon Sep 17 00:00:00 2001 From: Eric Miao Date: Fri, 22 Jun 2007 05:40:17 +0100 Subject: [ARM] 4451/1: pxa: make dma.c generic and remove cpu specific dma code Since the number of dma channels varies between pxa25x and pxa27x, it introduces some specific code in dma.c. This patch moves the specific code to pxa25x.c and pxa27x.c and makes dma.c more generic. 1. add pxa_init_dma() for dma initialization, the number of channels are passed in by the argument 2. add a "prio" field to the "struct pxa_dma_channel" for the channel priority, and is initialized in pxa_init_dma() 3. use a general priority comparison with the channels "prio" field so to remove the processor specific pxa_for_each_dma_prio macro, this is not lightning fast as the original one, but it is acceptable as it happens when requesting dma, which is usually not so performance critical Signed-off-by: eric miao Acked-by: Nicolas Pitre Signed-off-by: Russell King --- arch/arm/mach-pxa/pxa25x.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'arch/arm/mach-pxa/pxa25x.c') diff --git a/arch/arm/mach-pxa/pxa25x.c b/arch/arm/mach-pxa/pxa25x.c index a8796aea835..13437582342 100644 --- a/arch/arm/mach-pxa/pxa25x.c +++ b/arch/arm/mach-pxa/pxa25x.c @@ -25,6 +25,7 @@ #include #include #include +#include #include "generic.h" @@ -137,7 +138,11 @@ void __init pxa25x_init_irq(void) static int __init pxa25x_init(void) { + int ret = 0; + if (cpu_is_pxa21x() || cpu_is_pxa25x()) { + if ((ret = pxa_init_dma(16))) + return ret; #ifdef CONFIG_PM pm_set_ops(&pxa25x_pm_ops); #endif -- cgit v1.2.3-70-g09d2