From patchwork Tue May 25 08:09:16 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martyn Welch X-Patchwork-Id: 102099 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o4P89NZq018696 for ; Tue, 25 May 2010 08:09:23 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752880Ab0EYIJW (ORCPT ); Tue, 25 May 2010 04:09:22 -0400 Received: from exprod5og104.obsmtp.com ([64.18.0.178]:59050 "EHLO exprod5og104.obsmtp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752720Ab0EYIJV (ORCPT ); Tue, 25 May 2010 04:09:21 -0400 Received: from source ([4.79.213.129]) (using TLSv1) by exprod5ob104.postini.com ([64.18.4.12]) with SMTP ID DSNKS/uFrhGjWCE51ti7ftmqFeYLgmAGDTZH@postini.com; Tue, 25 May 2010 01:09:20 PDT Received: from unknown (HELO cinmlip01.e2k.ad.ge.com) ([3.159.213.48]) by Alpmlip08.e2k.ad.ge.com with ESMTP; 25 May 2010 04:09:18 -0400 Received: from es-j7s4d2j.amer.consind.ge.com ([3.138.54.92]) by cinmlip01.e2k.ad.ge.com with ESMTP; 25 May 2010 04:09:17 -0400 From: Martyn Welch Subject: [PATCH v3] powerpc: Add i8042 keyboard and mouse irq parsing To: Grant Likely , benh@kernel.crashing.org Cc: linuxppc-dev@ozlabs.org, Dmitry Torokhov , linux-input@vger.kernel.org Date: Tue, 25 May 2010 09:09:16 +0100 Message-ID: <20100525080834.29149.70967.stgit@ES-J7S4D2J.amer.consind.ge.com> User-Agent: StGIT/0.13 MIME-Version: 1.0 Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Tue, 25 May 2010 08:09:23 +0000 (UTC) diff --git a/arch/powerpc/kernel/setup-common.c b/arch/powerpc/kernel/setup-common.c index 48f0a00..3d169bb 100644 --- a/arch/powerpc/kernel/setup-common.c +++ b/arch/powerpc/kernel/setup-common.c @@ -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; @@ -567,6 +571,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; diff --git a/drivers/input/serio/i8042-io.h b/drivers/input/serio/i8042-io.h index 847f4aa..5d48bb6 100644 --- a/drivers/input/serio/i8042-io.h +++ b/drivers/input/serio/i8042-io.h @@ -27,6 +27,11 @@ #include #elif defined(CONFIG_SH_CAYMAN) #include +#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