From patchwork Fri Sep 3 22:28:09 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: 155151 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 o83MUEX9007979 for ; Fri, 3 Sep 2010 22:30:15 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754807Ab0ICW3v (ORCPT ); Fri, 3 Sep 2010 18:29:51 -0400 Received: from mail-qy0-f174.google.com ([209.85.216.174]:58245 "EHLO mail-qy0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753746Ab0ICW3t (ORCPT ); Fri, 3 Sep 2010 18:29:49 -0400 Received: by qyk36 with SMTP id 36so499582qyk.19 for ; Fri, 03 Sep 2010 15:29:49 -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=ui+wgIxza4GVUqSK79nRGUrzpLqa/v+xUOPm48l6fYo=; b=HvX6VLL2sHFytmb7t1CRrvTVEuDp2cZP3O8l08AphdDZBgUXT1ATg18AMRZ70vGndO znsfG44MU5F6qfIhNIdaSBRXOMgQr+PNC9ww1E8LRFZ1y9dfFyAdQNkoIDSXiyXvLaTv 7AvSNOoriFg/BfiQdiI4P978gNVH4++Z+OR04= 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=A1YfxlEdfx2sMJUpJmWqvmcc7t9/h3u0UhuCy6HzPVS+o8i9FJQKJ+s3yh/C1kJ7gt OmlnvkA/uqzV2P7/YzKn1utrXs5qrYI3oZ+1rO9wz3ctOFt4phtLdDeLgq5UYNRUxMkH 1zGUwmS7fX/2c0joXkZhiCd0CnagqVZGgqi5k= Received: by 10.229.1.208 with SMTP id 16mr741876qcg.264.1283552988965; Fri, 03 Sep 2010 15:29:48 -0700 (PDT) Received: from localhost.localdomain (pool-173-48-128-43.bstnma.fios.verizon.net [173.48.128.43]) by mx.google.com with ESMTPS id l13sm2505227qck.19.2010.09.03.15.29.45 (version=TLSv1/SSLv3 cipher=RC4-MD5); Fri, 03 Sep 2010 15:29:46 -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 v2 4/6 RESEND] ARM: pxa27x_keypad: added wakeup event handler for keypad interrupts Date: Fri, 3 Sep 2010 18:28:09 -0400 Message-Id: <1283552891-13966-5-git-send-email-mark.brown314@gmail.com> X-Mailer: git-send-email 1.7.0.4 In-Reply-To: <1283552891-13966-1-git-send-email-mark.brown314@gmail.com> References: <1283552891-13966-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]); Fri, 03 Sep 2010 22:30:15 +0000 (UTC) diff --git a/arch/arm/plat-pxa/include/plat/pxa27x_keypad.h b/arch/arm/plat-pxa/include/plat/pxa27x_keypad.h index 7b4eadc..73dacda 100644 --- a/arch/arm/plat-pxa/include/plat/pxa27x_keypad.h +++ b/arch/arm/plat-pxa/include/plat/pxa27x_keypad.h @@ -52,6 +52,7 @@ struct pxa27x_keypad_platform_data { /* key debounce interval */ unsigned int debounce_interval; + void (*clear_wakeup_event)(void); }; 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 0610d10..b36d2be 100644 --- a/drivers/input/keyboard/pxa27x_keypad.c +++ b/drivers/input/keyboard/pxa27x_keypad.c @@ -330,11 +330,21 @@ static void pxa27x_keypad_scan_direct(struct pxa27x_keypad *keypad) keypad->direct_key_state = new_state; } +static void clear_wakeup_event(struct pxa27x_keypad *keypad) +{ + struct pxa27x_keypad_platform_data *pdata = keypad->pdata; + + if (pdata->clear_wakeup_event) + (pdata->clear_wakeup_event)(); +} + static irqreturn_t pxa27x_keypad_irq_handler(int irq, void *dev_id) { struct pxa27x_keypad *keypad = dev_id; unsigned long kpc = keypad_readl(KPC); + clear_wakeup_event(keypad); + if (kpc & KPC_DI) pxa27x_keypad_scan_direct(keypad);