Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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 <martyn.welch@ge.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>

authored by

Martyn Welch and committed by
Benjamin Herrenschmidt
540c6c39 68581e93

+18
+13
arch/powerpc/kernel/setup-common.c
··· 94 94 .orig_video_points = 16 95 95 }; 96 96 97 + /* Variables required to store legacy IO irq routing */ 98 + int of_i8042_kbd_irq; 99 + int of_i8042_aux_irq; 100 + 97 101 #ifdef __DO_IRQ_CANON 98 102 /* XXX should go elsewhere eventually */ 99 103 int ppc_do_canonicalize_irqs; ··· 579 575 np = of_find_compatible_node(NULL, NULL, "pnpPNP,f03"); 580 576 if (np) { 581 577 parent = of_get_parent(np); 578 + 579 + of_i8042_kbd_irq = irq_of_parse_and_map(parent, 0); 580 + if (!of_i8042_kbd_irq) 581 + of_i8042_kbd_irq = 1; 582 + 583 + of_i8042_aux_irq = irq_of_parse_and_map(parent, 1); 584 + if (!of_i8042_aux_irq) 585 + of_i8042_aux_irq = 12; 586 + 582 587 of_node_put(np); 583 588 np = parent; 584 589 break;
+5
drivers/input/serio/i8042-io.h
··· 27 27 #include <asm/irq.h> 28 28 #elif defined(CONFIG_SH_CAYMAN) 29 29 #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 30 35 #else 31 36 # define I8042_KBD_IRQ 1 32 37 # define I8042_AUX_IRQ 12