From patchwork Thu Aug 26 09:18:58 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Mark F. Brown" X-Patchwork-Id: 144331 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id o7V2anBh009290 for ; Tue, 31 Aug 2010 02:37:04 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756832Ab0HaCgW (ORCPT ); Mon, 30 Aug 2010 22:36:22 -0400 Received: from mail-qy0-f181.google.com ([209.85.216.181]:54763 "EHLO mail-qy0-f181.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756822Ab0HaCgU (ORCPT ); Mon, 30 Aug 2010 22:36:20 -0400 Received: by qyk33 with SMTP id 33so5926809qyk.19 for ; Mon, 30 Aug 2010 19:36:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:to:cc:subject:date :message-id:x-mailer:in-reply-to:references; bh=cjmPzchGYSJKwwDRlzjzKO88wc9JwTer+/l/MH/FSdc=; b=FFmpRnAZMZCucjN2Ty8+zoEPZCZWr4NKVLnrXXu6vUfOO2zgOOT6OgtoNi34ATIASr smUBR13yiZuyi2uEqGZuzjeG7Hted5fqosoWm8za9hkfmd0wS7g+sJ1OpPbvWZmhjKNm f4SEt+6U8ykzAiXXEoJr5pLY/Tn13E3FPaTnU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; b=C634TXnnjOE4psrJ3XY6oiTl4kSAuNhPK9jOPzlHjvpZ5G+U1olAoFkrnu4spww8kl 9DaU4PnZDnkGz9fmt0jPOpS6e+0N8cgAWSfJ4mI4qO5Wjk3UCzK2X8Mw333tFykjd62q mUiW0fgm0Pl65tXiv9BymVFyFPBwuYlyj/6BI= Received: by 10.224.27.3 with SMTP id g3mr3479361qac.229.1283222179718; Mon, 30 Aug 2010 19:36:19 -0700 (PDT) Received: from localhost.localdomain (pool-173-48-127-202.bstnma.fios.verizon.net [173.48.127.202]) by mx.google.com with ESMTPS id e6sm9145361qcr.41.2010.08.30.19.36.17 (version=TLSv1/SSLv3 cipher=RC4-MD5); Mon, 30 Aug 2010 19:36:19 -0700 (PDT) From: "Mark F. Brown" To: Eric Miao , Haojian Zhuang , "Mark F. Brown" , linux-arm-kernel , linux-kernel@vger.kernel.org, linux-input@vger.kernel.org Cc: "Mark F. Brown" Subject: [PATCH 4/5] ARM: pxa168: added special case handler for keypad interrupts Date: Thu, 26 Aug 2010 05:18:58 -0400 Message-Id: <1282814339-10934-5-git-send-email-mark.brown314@gmail.com> X-Mailer: git-send-email 1.7.0.4 In-Reply-To: <1282814339-10934-1-git-send-email-mark.brown314@gmail.com> References: <1282814339-10934-1-git-send-email-mark.brown314@gmail.com> 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 (demeter1.kernel.org [140.211.167.41]); Tue, 31 Aug 2010 02:37:04 +0000 (UTC) diff --git a/arch/arm/mach-mmp/irq-pxa168.c b/arch/arm/mach-mmp/irq-pxa168.c index 52ff2f0..bfb0984 100644 --- a/arch/arm/mach-mmp/irq-pxa168.c +++ b/arch/arm/mach-mmp/irq-pxa168.c @@ -17,6 +17,8 @@ #include #include +#include +#include #include "common.h" @@ -42,6 +44,19 @@ static struct irq_chip icu_irq_chip = { .unmask = icu_unmask_irq, }; +void handle_pxa168_keypad_irq(unsigned int irq, struct irq_desc *desc) +{ + uint32_t val; + uint32_t mask = APMU_PXA168_KP_WAKE_CLR; + + /* clear keypad wake event */ + val = __raw_readl(APMU_WAKE_CLR); + __raw_writel(val | mask, APMU_WAKE_CLR); + + /* handle irq */ + handle_level_irq(irq, desc); +} + void __init icu_init_irq(void) { int irq; @@ -49,7 +64,13 @@ void __init icu_init_irq(void) for (irq = 0; irq < 64; irq++) { icu_mask_irq(irq); set_irq_chip(irq, &icu_irq_chip); - set_irq_handler(irq, handle_level_irq); + + /* special handler for keypad */ + if (cpu_is_pxa168() && irq == IRQ_PXA168_KEYPAD) + set_irq_handler(irq, handle_pxa168_keypad_irq); + else + set_irq_handler(irq, handle_level_irq); + set_irq_flags(irq, IRQF_VALID); } }