patch-2.4.22 linux-2.4.22/arch/sh/kernel/cf-enabler.c

Next file: linux-2.4.22/arch/sh/kernel/dma.c
Previous file: linux-2.4.22/arch/sh/kernel/Makefile
Back to the patch index
Back to the overall index

diff -urN linux-2.4.21/arch/sh/kernel/cf-enabler.c linux-2.4.22/arch/sh/kernel/cf-enabler.c
@@ -1,4 +1,4 @@
-/* $Id: cf-enabler.c,v 1.8 2001/07/18 12:32:21 gniibe Exp $
+/* $Id: cf-enabler.c,v 1.1.1.1.2.1 2003/06/24 08:52:51 dwmw2 Exp $
  *
  *  linux/drivers/block/cf-enabler.c
  *
@@ -11,7 +11,7 @@
 
 #include <linux/config.h>
 #include <linux/init.h>
-
+#include <linux/delay.h>
 #include <asm/io.h>
 #include <asm/irq.h>
 
@@ -87,7 +87,7 @@
 	return 0;
 }
 
-#if defined(CONFIG_SH_GENERIC) || defined(CONFIG_SH_SOLUTION_ENGINE)
+#if defined(CONFIG_SH_GENERIC) || defined(CONFIG_SH_SOLUTION_ENGINE) || defined(CONFIG_SH_HS7729PCI)
 #include <asm/hitachi_se.h>
 
 /*
@@ -142,15 +142,31 @@
 	ctrl_outw(0x2000, MRSHPC_ICR);
 	ctrl_outb(0x00, PA_MRSHPC_MW2 + 0x206);
 	ctrl_outb(0x42, PA_MRSHPC_MW2 + 0x200);
+
+	if (MACH_HS7729PCI) {
+		/* Empirical evidence shows that we have to delay for
+		   ten milliseconds and then redo the last outb. 
+		   I have no clue why. And all the docs are in Japanese
+		   so I feel no shame in just doing it this way. Besides,
+		   all this is just a crap hack for the fact that we don't
+		   have sensible userspace-less PCMCIA support in 2.4.
+
+		   dwmw2.
+		 */
+		mdelay(10);
+		ctrl_outb(0x42, PA_MRSHPC_MW2 + 0x200);
+	}
+
 	return 0;
 }
 #endif
 
 int __init cf_init(void)
 {
-#if defined(CONFIG_SH_GENERIC) || defined(CONFIG_SH_SOLUTION_ENGINE)
-	if (MACH_SE)
+#if defined(CONFIG_SH_GENERIC) || defined(CONFIG_SH_SOLUTION_ENGINE) || defined(CONFIG_SH_HS7729PCI)
+	if (MACH_SE || MACH_HS7729PCI) {
 		return cf_init_se();
+	}
 #endif
 	return cf_init_default();
 }

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