From patchwork Wed Jun 15 20:40:45 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ambresh K X-Patchwork-Id: 883552 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter2.kernel.org (8.14.4/8.14.4) with ESMTP id p5FKf8L7025429 for ; Wed, 15 Jun 2011 20:41:08 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752725Ab1FOUkt (ORCPT ); Wed, 15 Jun 2011 16:40:49 -0400 Received: from comal.ext.ti.com ([198.47.26.152]:38277 "EHLO comal.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752248Ab1FOUks (ORCPT ); Wed, 15 Jun 2011 16:40:48 -0400 Received: from dlep35.itg.ti.com ([157.170.170.118]) by comal.ext.ti.com (8.13.7/8.13.7) with ESMTP id p5FKel83031490 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 15 Jun 2011 15:40:47 -0500 Received: from dlep26.itg.ti.com (smtp-le.itg.ti.com [157.170.170.27]) by dlep35.itg.ti.com (8.13.7/8.13.8) with ESMTP id p5FKelcL018618; Wed, 15 Jun 2011 15:40:47 -0500 (CDT) Received: from dlee74.ent.ti.com (localhost [127.0.0.1]) by dlep26.itg.ti.com (8.13.8/8.13.8) with ESMTP id p5FKeljj017429; Wed, 15 Jun 2011 15:40:47 -0500 (CDT) Received: from dlelxv24.itg.ti.com (172.17.1.199) by dlee74.ent.ti.com (157.170.170.8) with Microsoft SMTP Server id 8.3.106.1; Wed, 15 Jun 2011 15:40:47 -0500 Received: from legion.dal.design.ti.com (legion.dal.design.ti.com [128.247.22.53]) by dlelxv24.itg.ti.com (8.13.8/8.13.8) with ESMTP id p5FKekuK003780; Wed, 15 Jun 2011 15:40:46 -0500 Received: from localhost (a0393775.am.dhcp.ti.com [146.252.40.26]) by legion.dal.design.ti.com (8.11.7p1+Sun/8.11.7) with ESMTP id p5FKekf19497; Wed, 15 Jun 2011 15:40:46 -0500 (CDT) From: Ambresh K To: linux kernel CC: Philippe Mazet , Kevin Hilman , Grant Likely , Colin Cross , linux omap Subject: [PATCH] OMAP4: GPIO: Fix missing interrupts during device wakeup due to IOPAD. Date: Wed, 15 Jun 2011 13:40:45 -0700 Message-ID: <1308170445-30665-1-git-send-email-ambresh@ti.com> X-Mailer: git-send-email 1.7.0.4 MIME-Version: 1.0 Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter2.kernel.org [140.211.167.43]); Wed, 15 Jun 2011 20:41:08 +0000 (UTC) From: Ambresh K If gpio pins from bank[2-5] are marked as wakeup enable and if the wake is through gpio IO pad wakeup, then that wakeup gpio interrupt is lost. In the current implementation, GPIO driver stores the context of DATAIN of all the gpio in the bank. During GPIO resuming, it checks DATAIN with wakeup enabled pins of gpio bank. If there is status change, then manually toggle GPIO_LEVELDETECT to generate pseudo interrupt. Reported-by: Philippe Mazet Tested-by: Philippe Mazet Signed-off-by: Ambresh K --- drivers/gpio/gpio-omap.c | 5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/gpio/gpio-omap.c b/drivers/gpio/gpio-omap.c index 6c51191..eaf3d78 100644 --- a/drivers/gpio/gpio-omap.c +++ b/drivers/gpio/gpio-omap.c @@ -477,8 +477,9 @@ static inline void set_24xx_gpio_triggering(struct gpio_bank *bank, int gpio, + OMAP24XX_GPIO_CLEARWKUENA); } } - /* This part needs to be executed always for OMAP34xx */ - if (cpu_is_omap34xx() || (bank->non_wakeup_gpios & gpio_bit)) { + /* This part needs to be executed always for OMAP{34xx, 44xx} */ + if (cpu_is_omap34xx() || cpu_is_omap44xx() || + (bank->non_wakeup_gpios & gpio_bit)) { /* * Log the edge gpio and manually trigger the IRQ * after resume if the input level changes