From patchwork Thu Aug 26 15:27:35 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: 155071 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 o83LoSaN003647 for ; Fri, 3 Sep 2010 21:50:29 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757711Ab0ICVtR (ORCPT ); Fri, 3 Sep 2010 17:49:17 -0400 Received: from mail-vw0-f46.google.com ([209.85.212.46]:52205 "EHLO mail-vw0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757683Ab0ICVtN (ORCPT ); Fri, 3 Sep 2010 17:49:13 -0400 Received: by vws3 with SMTP id 3so1656283vws.19 for ; Fri, 03 Sep 2010 14:49:13 -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=Fr4vcUS81zXtvikE7C2H1WppqGkU8KSkYNLSjOd5vyb7Ejy+ob7kEhbScYfWgpYnJY /v4NSuwnAMndHGyg6fENVXv01/bHbBxEczMCex1aK1yQXPiyJAKaor3E1uc6W8tN81Gn JJlbDAkfJLRkZUJB2hsAK7BsedzJRNiHiWcjQ= 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=hID1v2Uu4wlUHccQBeONbPxfqYCBDvALcJGVM0alFaExipfeTYoaTnB70bwfEmZ9vs +a6KvyHIovRLKnBioiQsop9svIp0VIclBv8Pjzc3O3neU1hp1/VZtefyUH1ftshSX4xA kyM/vtuJ1Ws57LmlWhxSUQ6TRVsF+AmgYf+ns= Received: by 10.220.62.202 with SMTP id y10mr823344vch.198.1283550552872; Fri, 03 Sep 2010 14:49:12 -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 j34sm1012664vcs.4.2010.09.03.14.49.11 (version=TLSv1/SSLv3 cipher=RC4-MD5); Fri, 03 Sep 2010 14:49:12 -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] ARM: pxa27x_keypad: added wakeup event handler for keypad interrupts Date: Thu, 26 Aug 2010 11:27:35 -0400 Message-Id: <1282836457-5651-5-git-send-email-mark.brown314@gmail.com> X-Mailer: git-send-email 1.7.0.4 In-Reply-To: <1282836457-5651-1-git-send-email-mark.brown314@gmail.com> References: <1282836457-5651-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 21:50:29 +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);