]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
powerpc: Add i8042 keyboard and mouse irq parsing
authorMartyn Welch <martyn.welch@ge.com>
Mon, 24 May 2010 22:09:16 +0000 (22:09 +0000)
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>
Fri, 9 Jul 2010 01:28:33 +0000 (11:28 +1000)
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>
arch/powerpc/kernel/setup-common.c
drivers/input/serio/i8042-io.h

index 5e4d852f640c7f5c6535b9e420ae74da94e942cb..8b6ada66060b5ae87c7daae74c5833b8b3e90648 100644 (file)
@@ -94,6 +94,10 @@ struct screen_info screen_info = {
        .orig_video_points = 16
 };
 
+/* Variables required to store legacy IO irq routing */
+int of_i8042_kbd_irq;
+int of_i8042_aux_irq;
+
 #ifdef __DO_IRQ_CANON
 /* XXX should go elsewhere eventually */
 int ppc_do_canonicalize_irqs;
@@ -575,6 +579,15 @@ int check_legacy_ioport(unsigned long base_port)
                        np = of_find_compatible_node(NULL, NULL, "pnpPNP,f03");
                if (np) {
                        parent = of_get_parent(np);
+
+                       of_i8042_kbd_irq = irq_of_parse_and_map(parent, 0);
+                       if (!of_i8042_kbd_irq)
+                               of_i8042_kbd_irq = 1;
+
+                       of_i8042_aux_irq = irq_of_parse_and_map(parent, 1);
+                       if (!of_i8042_aux_irq)
+                               of_i8042_aux_irq = 12;
+
                        of_node_put(np);
                        np = parent;
                        break;
index 847f4aad7ed560f2c5d9b91f8ba34079b6c99d7c..5d48bb66aa738dd85e72f2d47f4b3ad3e88dd57e 100644 (file)
 #include <asm/irq.h>
 #elif defined(CONFIG_SH_CAYMAN)
 #include <asm/irq.h>
+#elif defined(CONFIG_PPC)
+extern int of_i8042_kbd_irq;
+extern int of_i8042_aux_irq;
+# define I8042_KBD_IRQ  of_i8042_kbd_irq
+# define I8042_AUX_IRQ  of_i8042_aux_irq
 #else
 # define I8042_KBD_IRQ 1
 # define I8042_AUX_IRQ 12