@@ -93,6 +93,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;
@@ -555,13 +559,37 @@ void probe_machine(void)
/* Match a class of boards, not a specific device configuration. */
int check_legacy_ioport(unsigned long base_port)
{
- struct device_node *parent, *np = NULL;
+ struct device_node *parent, *np = NULL, *np_aux = NULL;
int ret = -ENODEV;
switch(base_port) {
case I8042_DATA_REG:
- if (!(np = of_find_compatible_node(NULL, NULL, "pnpPNP,303")))
- np = of_find_compatible_node(NULL, NULL, "pnpPNP,f03");
+ np = of_find_compatible_node(NULL, NULL, "pnpPNP,303");
+ if (np) {
+ /*
+ * Attempt to parse DTS for keyboard irq, fallback to
+ * standard.
+ */
+ of_i8042_kbd_irq = irq_of_parse_and_map(np, 0);
+ if (!of_i8042_kbd_irq)
+ of_i8042_kbd_irq = 1;
+ }
+
+ np_aux = of_find_compatible_node(NULL, NULL, "pnpPNP,f03");
+ if (np_aux) {
+ if (!np) {
+ of_node_put(np);
+ np = np_aux;
+ }
+ /*
+ * Attempt to parse DTS for mouse (aux) irq, fallback to
+ * standard.
+ */
+ of_i8042_aux_irq = irq_of_parse_and_map(np_aux, 0);
+ if (!of_i8042_aux_irq)
+ of_i8042_aux_irq = 12;
+ }
+
if (np) {
parent = of_get_parent(np);
of_node_put(np);
@@ -19,6 +19,11 @@
* IRQs.
*/
+#if defined(CONFIG_PPC)
+extern int of_i8042_kbd_irq;
+extern int of_i8042_aux_irq;
+#endif
+
#ifdef __alpha__
# define I8042_KBD_IRQ 1
# define I8042_AUX_IRQ (RTC_PORT(0) == 0x170 ? 9 : 12) /* Jensen is special */
@@ -27,6 +32,9 @@
#include <asm/irq.h>
#elif defined(CONFIG_SH_CAYMAN)
#include <asm/irq.h>
+#elif defined(CONFIG_PPC)
+#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