From patchwork Tue Aug 31 07:05:53 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Miao X-Patchwork-Id: 144581 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 o7V76G5s024904 for ; Tue, 31 Aug 2010 07:06:16 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756735Ab0HaHGP (ORCPT ); Tue, 31 Aug 2010 03:06:15 -0400 Received: from mail-wy0-f174.google.com ([74.125.82.174]:44232 "EHLO mail-wy0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756326Ab0HaHGP convert rfc822-to-8bit (ORCPT ); Tue, 31 Aug 2010 03:06:15 -0400 Received: by wyb35 with SMTP id 35so7531409wyb.19 for ; Tue, 31 Aug 2010 00:06:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:mime-version:received:in-reply-to :references:from:date:message-id:subject:to:cc:content-type :content-transfer-encoding; bh=d7L75dZ1cBIqFVtv/ha2kxpzU/PmTR37TE9/9bQhU7s=; b=ABOcRnJ4jCE5GBdM4iZw2nUYiwjQBZ/Ue7lP1E61MfoCjVuaAYSkaPcSS59HdETe0h 0U2vOX8sW4hKrA/4rrGHw+mkaow56OkbSm7926KdHP4aljasiIHOpiDoPwMh7TYbf54D ApRhMbDUln3Imb25EEYJQYQO6hrHSUwXrju/k= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type:content-transfer-encoding; b=cTzehbIsXqtYMrQFD4jE+iR/wdmuipezSDMS4J3afsROYVIZiPZN59LY7gtZfS4FCm ajUyjidhmMvgtM0RonGwdKBYHALBy9SlY8zQ2NRLroWoX/yfHZXOWgAVuPEKu/htcqv7 NkB+cwnxkBjAvenuweceCqVO/lXsEL3g022oI= Received: by 10.216.11.130 with SMTP id 2mr5865517wex.100.1283238373193; Tue, 31 Aug 2010 00:06:13 -0700 (PDT) MIME-Version: 1.0 Received: by 10.216.181.81 with HTTP; Tue, 31 Aug 2010 00:05:53 -0700 (PDT) In-Reply-To: References: <1282814339-10934-1-git-send-email-mark.brown314@gmail.com> <1282814339-10934-5-git-send-email-mark.brown314@gmail.com> From: Eric Miao Date: Tue, 31 Aug 2010 15:05:53 +0800 Message-ID: Subject: Re: [PATCH 4/5] ARM: pxa168: added special case handler for keypad interrupts To: "Mark F. Brown" Cc: Haojian Zhuang , Haojian Zhuang , linux-arm-kernel , linux-kernel , linux-input 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 07:06:18 +0000 (UTC) diff --git a/arch/arm/mach-mmp/include/mach/pxa168.h b/arch/arm/mach-mmp/include/mach/pxa168.h index 27e1bc7..d2b7946 100644 --- a/arch/arm/mach-mmp/include/mach/pxa168.h +++ b/arch/arm/mach-mmp/include/mach/pxa168.h @@ -5,6 +5,7 @@ struct sys_timer; extern struct sys_timer pxa168_timer; extern void __init pxa168_init_irq(void); +extern void pxa168_clear_keypad_wakeup(void); #include #include @@ -97,4 +98,10 @@ static inline int pxa168_add_nand(struct pxa3xx_nand_platform_data *info) { return pxa_register_device(&pxa168_device_nand, info, sizeof(*info)); } + +static inline int pxa168_add_keypad(struct pxa27x_keypad_platform_data *info) +{ + info->clear_wakeup = pxa168_clear_keypad_wakeup; + return pxa_register_device(&pxa168_device_keypad, info, sizeof(*info)); +} #endif /* __ASM_MACH_PXA168_H */ diff --git a/arch/arm/mach-pxa/include/mach/pxa27x_keypad.h b/arch/arm/mach-pxa/include/mach/pxa27x_keypad.h index 7b4eadc..3a6bfe7 100644 --- a/arch/arm/mach-pxa/include/mach/pxa27x_keypad.h +++ b/arch/arm/mach-pxa/include/mach/pxa27x_keypad.h @@ -52,6 +52,7 @@ struct pxa27x_keypad_platform_data { /* key debounce interval */ unsigned int debounce_interval; + void (*clear_wakeup); }; extern void pxa_set_keypad_info(struct pxa27x_keypad_platform_data *info); diff --git a/drivers/input/keyboard/pxa27x_keypad.c b/drivers/input/keyboard/pxa27x_keypad.c index f32404f..3fb94fe 100644 --- a/drivers/input/keyboard/pxa27x_keypad.c +++ b/drivers/input/keyboard/pxa27x_keypad.c @@ -330,10 +330,20 @@ static void pxa27x_keypad_scan_direct(struct pxa27x_keypad *keypad) keypad->direct_key_state = new_state; } +static void clear_wakeup(struct pxa27x_keypad *keypad) +{ + struct pxa27x_keypad_platform_data *pdata = keypad->pdata; + + if (pdata->clear_wakeup) + (pdata->clear_wakeup)(); +} + static irqreturn_t pxa27x_keypad_irq_handler(int irq, void *dev_id) { struct pxa27x_keypad *keypad = dev_id; - unsigned long kpc = keypad_readl(KPC); + unsigned long kpc; + + kpc = keypad_readl(KPC); if (kpc & KPC_DI)