Skip to contentSkip to conversation

Fix i8042 PS/2 mouse on ARM

PATCH Applied Russell King 3 participants 5 messages Mar 4, 2004 – Mar 5, 2004 Input drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Fix i8042 PS/2 mouse on ARM

Vojtech,

This patch is required on ARM so that we pick up the correct AUX interrupt number. Some machines (eg, NetWinders) use IRQ5 instead of IRQ12 for the PS/2 mouse.

Please comment, and let me know if you're happy to apply it, or whether you're happy for me to do so.

Thanks.

drivers/input/serio/i8042-io.h +2 -0
@@ -25,6 +25,8 @@
 #elif defined(__ia64__)
 # define I8042_KBD_IRQ isa_irq_to_vector(1)
 # define I8042_AUX_IRQ isa_irq_to_vector(12)
+#elif defined(__arm__)
+/* defined in include/asm-arm/arch-*/irqs.h */
 #else
 # define I8042_KBD_IRQ	1
 # define I8042_AUX_IRQ	12
include/asm-arm/arch-ebsa285/irqs.h +2 -2
@@ -91,8 +91,8 @@
 
 #undef RTC_IRQ
 #define RTC_IRQ		IRQ_ISA_RTC_ALARM
-#undef AUX_IRQ
-#define AUX_IRQ		(machine_is_netwinder() ? IRQ_NETWINDER_PS2MOUSE : IRQ_ISA_PS2MOUSE)
+#define I8042_KBD_IRQ	IRQ_ISA_KEYBOARD
+#define I8042_AUX_IRQ	(machine_is_netwinder() ? IRQ_NETWINDER_PS2MOUSE : IRQ_ISA_PS2MOUSE)
 #define IRQ_FLOPPYDISK	IRQ_ISA_FLOPPY
 
 #define irq_canonicalize(_i)	(((_i) == IRQ_ISA_CASCADE) ? IRQ_ISA_2 : _i)
include/asm-arm/arch-shark/irqs.h +2 -1
@@ -8,5 +8,6 @@
 
 #define IRQ_ISA_KEYBOARD	 1
 #define RTC_IRQ			 8
-#define AUX_IRQ			12
+#define I8042_KBD_IRQ		 1
+#define I8042_AUX_IRQ		12
 #define IRQ_HARDDISK            14
Signature · 4 lines
Russell King
 Linux kernel    2.6 ARM Linux   - http://www.arm.linux.org.uk/
 maintainer of:  2.6 PCMCIA      - http://pcmcia.arm.linux.org.uk/
                 2.6 Serial core
#1 lore raw

Almost works.

Somehow the expectations of the line

/* defined in include/asm-arm/arch-*/irqs.h */

fails - the arch-ebsa285/irgs.h is not pulled in in time when compiling i8042. Temporary hardcoded the I8042_KBD_IRQ and I8042_AUX_IRQ to test out, mouse works OK (good news!!!)

So small tweak to the build include sequence is still needed...

Woody

Quoted 48 lines · Russell King

Vojtech,

This patch is required on ARM so that we pick up the correct AUX interrupt number. Some machines (eg, NetWinders) use IRQ5 instead of IRQ12 for the PS/2 mouse.

Please comment, and let me know if you're happy to apply it, or whether you're happy for me to do so.

Thanks.

drivers/input/serio/i8042-io.h +2 -0
@@ -25,6 +25,8 @@
 #elif defined(__ia64__)
 # define   isa_irq_to_vector(1)
 # define I8042_AUX_IRQ isa_irq_to_vector(12)
+#elif defined(__arm__)
+/* defined in include/asm-arm/arch-*/irqs.h */
 #else
 # define I8042_KBD_IRQ	1
 # define I8042_AUX_IRQ	12
include/asm-arm/arch-ebsa285/irqs.h +2 -2
@@ -91,8 +91,8 @@
 
 #undef RTC_IRQ
 #define RTC_IRQ		IRQ_ISA_RTC_ALARM
-#undef AUX_IRQ
-#define AUX_IRQ		(machine_is_netwinder() ? IRQ_NETWINDER_PS2MOUSE : IRQ_ISA_PS2MOUSE)
+#define I8042_KBD_IRQ	IRQ_ISA_KEYBOARD
+#define I8042_AUX_IRQ	(machine_is_netwinder() ? IRQ_NETWINDER_PS2MOUSE : IRQ_ISA_PS2MOUSE)
 #define IRQ_FLOPPYDISK	IRQ_ISA_FLOPPY
 
 #define irq_canonicalize(_i)	(((_i) == IRQ_ISA_CASCADE) ? IRQ_ISA_2 : _i)
include/asm-arm/arch-shark/irqs.h +2 -1
@@ -8,5 +8,6 @@
 
 #define IRQ_ISA_KEYBOARD	 1
 #define RTC_IRQ			 8
-#define AUX_IRQ			12
+#define I8042_KBD_IRQ		 1
+#define I8042_AUX_IRQ		12
 #define IRQ_HARDDISK            14
#2 lore raw
Quoted 1 line · Woody Suwalski

So small tweak to the build include sequence is still needed...

Ok, here's the updated (and tested) patch.

drivers/input/serio/i8042-io.h +3 -0
@@ -25,6 +25,9 @@
 #elif defined(__ia64__)
 # define I8042_KBD_IRQ isa_irq_to_vector(1)
 # define I8042_AUX_IRQ isa_irq_to_vector(12)
+#elif defined(__arm__)
+/* defined in include/asm-arm/arch-xxx/irqs.h */
+#include <asm/irq.h>
 #else
 # define I8042_KBD_IRQ	1
 # define I8042_AUX_IRQ	12
include/asm-arm/arch-ebsa285/irqs.h +2 -2
@@ -91,8 +91,8 @@
 
 #undef RTC_IRQ
 #define RTC_IRQ		IRQ_ISA_RTC_ALARM
-#undef AUX_IRQ
-#define AUX_IRQ		(machine_is_netwinder() ? IRQ_NETWINDER_PS2MOUSE : IRQ_ISA_PS2MOUSE)
+#define I8042_KBD_IRQ	IRQ_ISA_KEYBOARD
+#define I8042_AUX_IRQ	(machine_is_netwinder() ? IRQ_NETWINDER_PS2MOUSE : IRQ_ISA_PS2MOUSE)
 #define IRQ_FLOPPYDISK	IRQ_ISA_FLOPPY
 
 #define irq_canonicalize(_i)	(((_i) == IRQ_ISA_CASCADE) ? IRQ_ISA_2 : _i)
include/asm-arm/arch-shark/irqs.h +2 -1
@@ -8,5 +8,6 @@
 
 #define IRQ_ISA_KEYBOARD	 1
 #define RTC_IRQ			 8
-#define AUX_IRQ			12
+#define I8042_KBD_IRQ		 1
+#define I8042_AUX_IRQ		12
 #define IRQ_HARDDISK            14
Signature · 4 lines
Russell King
 Linux kernel    2.6 ARM Linux   - http://www.arm.linux.org.uk/
 maintainer of:  2.6 PCMCIA      - http://pcmcia.arm.linux.org.uk/
                 2.6 Serial core
#3 lore raw
Quoted 4 lines · Russell King
Quoted 1 line · Woody Suwalski

So small tweak to the build include sequence is still needed...

Ok, here's the updated (and tested) patch.

In my tree now, thanks.

Signature · 2 lines
Vojtech Pavlik
SuSE Labs, SuSE CR
#4 lore raw
In reply to Russell King
Quoted 10 lines · Russell King

Vojtech,

This patch is required on ARM so that we pick up the correct AUX interrupt number. Some machines (eg, NetWinders) use IRQ5 instead of IRQ12 for the PS/2 mouse.

Please comment, and let me know if you're happy to apply it, or whether you're happy for me to do so.

Thanks.

Applied to my tree, thanks.

Signature · 2 lines
Vojtech Pavlik
SuSE Labs, SuSE CR