patch-2.2.8 linux/include/asm-arm/arch-ebsa285/keyboard.h

Next file: linux/include/asm-arm/arch-ebsa285/memory.h
Previous file: linux/include/asm-arm/arch-ebsa285/irqs.h
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.2.7/linux/include/asm-arm/arch-ebsa285/keyboard.h linux/include/asm-arm/arch-ebsa285/keyboard.h
@@ -6,16 +6,10 @@
  * (C) 1998 Russell King
  * (C) 1998 Phil Blundell
  */
-
-#include <linux/config.h>
 #include <asm/irq.h>
 #include <asm/system.h>
 
-#define NR_SCANCODES 128
-
-#ifdef CONFIG_CATS
-
-#define KEYBOARD_IRQ		IRQ_ISA(1)
+extern int have_isa_bridge;
 
 extern int pckbd_setkeycode(unsigned int scancode, unsigned int keycode);
 extern int pckbd_getkeycode(unsigned int scancode);
@@ -26,40 +20,52 @@
 extern void pckbd_init_hw(void);
 extern unsigned char pckbd_sysrq_xlate[128];
 
-#define kbd_setkeycode			pckbd_setkeycode
-#define kbd_getkeycode			pckbd_getkeycode
-#define kbd_translate(sc, kcp, ufp, rm) ({ *ufp = sc & 0200; \
-		pckbd_translate(sc & 0x7f, kcp, rm);})
+#define KEYBOARD_IRQ			IRQ_ISA_KEYBOARD
 
-#define kbd_unexpected_up		pckbd_unexpected_up
-#define kbd_leds			pckbd_leds
-#define kbd_init_hw()			\
-		do { if (machine_is_cats()) pckbd_init_hw(); } while (0)
-#define kbd_sysrq_xlate			pckbd_sysrq_xlate
-#define kbd_disable_irq()
-#define kbd_enable_irq()
+#define NR_SCANCODES 128
 
-#define SYSRQ_KEY	0x54
+#define kbd_setkeycode(sc,kc)				\
+	({						\
+		int __ret;				\
+		if (have_isa_bridge)			\
+			__ret = pckbd_setkeycode(sc,kc);\
+		else					\
+			__ret = -EINVAL;		\
+		__ret;					\
+	})
+
+#define kbd_getkeycode(sc)				\
+	({						\
+		int __ret;				\
+		if (have_isa_bridge)			\
+			__ret = pckbd_getkeycode(sc);	\
+		else					\
+			__ret = -EINVAL;		\
+		__ret;					\
+	})
+
+#define kbd_translate(sc, kcp, rm)			\
+	({						\
+		pckbd_translate(sc, kcp, rm);		\
+	})
 
-#else
+#define kbd_unexpected_up		pckbd_unexpected_up
 
-/* Dummy keyboard definitions */
+#define kbd_leds(leds)					\
+	do {						\
+		if (have_isa_bridge)			\
+			pckbd_leds(leds);		\
+	} while (0)
+
+#define kbd_init_hw()					\
+	do {						\
+		if (have_isa_bridge)			\
+			pckbd_init_hw();		\
+	} while (0)
 
-#define kbd_setkeycode(sc,kc)		(-EINVAL)
-#define kbd_getkeycode(sc)		(-EINVAL)
+#define kbd_sysrq_xlate			pckbd_sysrq_xlate
 
-/* Prototype: int kbd_translate(scancode, *keycode, *up_flag, raw_mode)
- * Returns  : 0 to ignore scancode, *keycode set to keycode, *up_flag
- *            set to 0200 if scancode indicates release
- */
-#define kbd_translate(sc, kcp, ufp, rm)	(1)
-#define kbd_unexpected_up(kc)		(0200)
-#define kbd_leds(leds)
-#define kbd_init_hw()
-//#define kbd_sysrq_xlate			ps2kbd_sysrq_xlate
 #define kbd_disable_irq()
 #define kbd_enable_irq()
 
-#define SYSRQ_KEY	13
-
-#endif
+#define SYSRQ_KEY	0x54

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