Skip to content

Commit 540c6c3

Browse files
mwelchukozbenh
authored andcommitted
powerpc: Add i8042 keyboard and mouse irq parsing
Currently the irqs for the i8042, which historically provides keyboard and mouse (aux) support, is hardwired in the driver rather than parsing the dts. This patch modifies the powerpc legacy IO code to attempt to parse the device tree for this information, failing back to the hardcoded values if it fails. Signed-off-by: Martyn Welch <[email protected]> Signed-off-by: Benjamin Herrenschmidt <[email protected]>
1 parent 68581e9 commit 540c6c3

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

arch/powerpc/kernel/setup-common.c

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,10 @@ struct screen_info screen_info = {
9494
.orig_video_points = 16
9595
};
9696

97+
/* Variables required to store legacy IO irq routing */
98+
int of_i8042_kbd_irq;
99+
int of_i8042_aux_irq;
100+
97101
#ifdef __DO_IRQ_CANON
98102
/* XXX should go elsewhere eventually */
99103
int ppc_do_canonicalize_irqs;
@@ -575,6 +579,15 @@ int check_legacy_ioport(unsigned long base_port)
575579
np = of_find_compatible_node(NULL, NULL, "pnpPNP,f03");
576580
if (np) {
577581
parent = of_get_parent(np);
582+
583+
of_i8042_kbd_irq = irq_of_parse_and_map(parent, 0);
584+
if (!of_i8042_kbd_irq)
585+
of_i8042_kbd_irq = 1;
586+
587+
of_i8042_aux_irq = irq_of_parse_and_map(parent, 1);
588+
if (!of_i8042_aux_irq)
589+
of_i8042_aux_irq = 12;
590+
578591
of_node_put(np);
579592
np = parent;
580593
break;

drivers/input/serio/i8042-io.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,11 @@
2727
#include <asm/irq.h>
2828
#elif defined(CONFIG_SH_CAYMAN)
2929
#include <asm/irq.h>
30+
#elif defined(CONFIG_PPC)
31+
extern int of_i8042_kbd_irq;
32+
extern int of_i8042_aux_irq;
33+
# define I8042_KBD_IRQ of_i8042_kbd_irq
34+
# define I8042_AUX_IRQ of_i8042_aux_irq
3035
#else
3136
# define I8042_KBD_IRQ 1
3237
# define I8042_AUX_IRQ 12

0 commit comments

Comments
 (0)