patch-2.4.0-test5 linux/arch/arm/kernel/oldlatches.c

Next file: linux/arch/arm/kernel/process.c
Previous file: linux/arch/arm/kernel/hw-sa1100.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.4.0-test4/linux/arch/arm/kernel/oldlatches.c linux/arch/arm/kernel/oldlatches.c
@@ -3,52 +3,53 @@
  *
  * (c) David Alan Gilbert 1995/1996
  */
+#include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/init.h>
 
 #include <asm/io.h>
 #include <asm/hardware.h>
 
-#ifdef LATCHAADDR
-/*
- * They are static so that everyone who accesses them has to go through here
- */
-static unsigned char LatchACopy;
+static unsigned char latch_a_copy;
+static unsigned char latch_b_copy;
 
 /* newval=(oldval & ~mask)|newdata */
 void oldlatch_aupdate(unsigned char mask,unsigned char newdata)
 {
-    LatchACopy=(LatchACopy & ~mask)|newdata;
-    outb(LatchACopy, LATCHAADDR);
-#ifdef DEBUG
-    printk("oldlatch_A:0x%2x\n",LatchACopy);
-#endif
+	if (machine_is_arc()) {
+		latch_a_copy = (latch_a_copy & ~mask) | newdata;
 
+		printk("Latch: A = 0x%02x\n", latch_a_copy);
+
+		outb(latch_a_copy, LATCHAADDR);
+	} else
+		BUG();
 }
-#endif
 
-#ifdef LATCHBADDR
-static unsigned char LatchBCopy;
 
 /* newval=(oldval & ~mask)|newdata */
 void oldlatch_bupdate(unsigned char mask,unsigned char newdata)
 {
-    LatchBCopy=(LatchBCopy & ~mask)|newdata;
-    outb(LatchBCopy, LATCHBADDR);
-#ifdef DEBUG
-    printk("oldlatch_B:0x%2x\n",LatchBCopy);
-#endif
+	if (machine_is_arc()) {
+		latch_b_copy = (latch_b_copy & ~mask) | newdata;
+
+		printk("Latch: B = 0x%02x\n", latch_b_copy);
+
+		outb(latch_b_copy, LATCHBADDR);
+	} else
+		BUG();
 }
-#endif
 
-void __init oldlatch_init(void)
+static void __init oldlatch_init(void)
 {
-    printk("oldlatch: init\n");
-#ifdef LATCHAADDR
-    oldlatch_aupdate(0xff,0xff);
-#endif
-#ifdef LATCHBADDR
-    oldlatch_bupdate(0xff,0x8); /* Thats no FDC reset...*/
-#endif
-    return ;
+	if (machine_is_arc()) {
+		oldlatch_aupdate(0xff, 0xff);
+		/* Thats no FDC reset...*/
+		oldlatch_bupdate(0xff, LATCHB_FDCRESET);
+	}
 }
+
+initcall(oldlatch_init);
+
+EXPORT_SYMBOL(oldlatch_aupdate);
+EXPORT_SYMBOL(oldlatch_bupdate);

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