patch-2.4.0-test5 linux/arch/arm/kernel/dma-footbridge.c

Next file: linux/arch/arm/kernel/dma-isa.c
Previous file: linux/arch/arm/kernel/dma-dummy.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.4.0-test4/linux/arch/arm/kernel/dma-footbridge.c linux/arch/arm/kernel/dma-footbridge.c
@@ -15,94 +15,44 @@
 #include <linux/sched.h>
 #include <linux/init.h>
 
+#include <asm/dec21285.h>
 #include <asm/dma.h>
 #include <asm/io.h>
 
 #include "dma.h"
-#include "dma-isa.h"
 
-#ifdef CONFIG_ISA_DMA
-static int has_isa_dma;
-#else
-#define has_isa_dma 0
-#endif
+extern void isa_init_dma(dma_t *dma);
 
-int arch_request_dma(dmach_t channel, dma_t *dma, const char *dev_name)
+#if 0
+static int fb_dma_request(dmach_t channel, dma_t *dma)
 {
-	switch (channel) {
-	case _DC21285_DMA(0):
-	case _DC21285_DMA(1):	/* 21285 internal channels */
-		return 0;
-
-	case _ISA_DMA(0) ... _ISA_DMA(7):
-		if (has_isa_dma)
-			return isa_request_dma(channel - _ISA_DMA(0), dma, dev_name);
-	}
-
 	return -EINVAL;
 }
 
-void arch_free_dma(dmach_t channel, dma_t *dma)
-{
-	/* nothing to do */
-}
-
-int arch_get_dma_residue(dmach_t channel, dma_t *dma)
-{
-	int residue = 0;
-
-	switch (channel) {
-	case _DC21285_DMA(0):
-	case _DC21285_DMA(1):
-		break;
-
-	case _ISA_DMA(0) ... _ISA_DMA(7):
-		if (has_isa_dma)
-			residue = isa_get_dma_residue(channel - _ISA_DMA(0), dma);
-	}
-	return residue;
-}
-
-void arch_enable_dma(dmach_t channel, dma_t *dma)
+static void fb_dma_enable(dmach_t channel, dma_t *dma)
 {
-	switch (channel) {
-	case _DC21285_DMA(0):
-	case _DC21285_DMA(1):
-		/*
-		 * Not yet implemented
-		 */
-		break;
-
-	case _ISA_DMA(0) ... _ISA_DMA(7):
-		if (has_isa_dma)
-			isa_enable_dma(channel - _ISA_DMA(0), dma);
-	}
 }
 
-void arch_disable_dma(dmach_t channel, dma_t *dma)
+static void fb_dma_disable(dmach_t channel, dma_t *dma)
 {
-	switch (channel) {
-	case _DC21285_DMA(0):
-	case _DC21285_DMA(1):
-		/*
-		 * Not yet implemented
-		 */
-		break;
-
-	case _ISA_DMA(0) ... _ISA_DMA(7):
-		if (has_isa_dma)
-			isa_disable_dma(channel - _ISA_DMA(0), dma);
-	}
 }
 
-int arch_set_dma_speed(dmach_t channel, dma_t *dma, int cycle_ns)
-{
-	return 0;
-}
+static struct dma_ops fb_dma_ops = {
+	type:		"fb",
+	request:	fb_dma_request,
+	enable:		fb_dma_enable,
+	disable:	fb_dma_disable,
+};
+#endif
 
 void __init arch_dma_init(dma_t *dma)
 {
+#if 0
+	dma[_DC21285_DMA(0)].d_ops = &fb_dma_ops;
+	dma[_DC21285_DMA(1)].d_ops = &fb_dma_ops;
+#endif
 #ifdef CONFIG_ISA_DMA
-	has_isa_dma = isa_init_dma();
+	if (footbridge_cfn_mode())
+		isa_init_dma(dma + _ISA_DMA(0));
 #endif
 }

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)