From patchwork Mon May 3 23:26:13 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kevin Hilman X-Patchwork-Id: 96631 X-Patchwork-Delegate: tony@atomide.com Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o43NQUx8005200 for ; Mon, 3 May 2010 23:26:30 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759786Ab0ECX02 (ORCPT ); Mon, 3 May 2010 19:26:28 -0400 Received: from mail-gw0-f46.google.com ([74.125.83.46]:39677 "EHLO mail-gw0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1759763Ab0ECX02 (ORCPT ); Mon, 3 May 2010 19:26:28 -0400 Received: by gwj19 with SMTP id 19so1462337gwj.19 for ; Mon, 03 May 2010 16:26:27 -0700 (PDT) Received: by 10.101.50.13 with SMTP id c13mr3791880ank.76.1272929186951; Mon, 03 May 2010 16:26:26 -0700 (PDT) Received: from localhost (deeprootsystems.com [216.254.16.51]) by mx.google.com with ESMTPS id 21sm4696991iwn.3.2010.05.03.16.26.25 (version=TLSv1/SSLv3 cipher=RC4-MD5); Mon, 03 May 2010 16:26:26 -0700 (PDT) From: Kevin Hilman To: linux-omap@vger.kernel.org Cc: Chunqiu Wang Subject: [PATCH 2/6] OMAP3: GPIO: Only enable WAKEUPEN for edge detection GPIOs Date: Mon, 3 May 2010 16:26:13 -0700 Message-Id: <1272929177-22685-3-git-send-email-khilman@deeprootsystems.com> X-Mailer: git-send-email 1.7.0.2 In-Reply-To: <1272929177-22685-1-git-send-email-khilman@deeprootsystems.com> References: <1272929177-22685-1-git-send-email-khilman@deeprootsystems.com> 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.3 (demeter.kernel.org [140.211.167.41]); Mon, 03 May 2010 23:26:30 +0000 (UTC) diff --git a/arch/arm/plat-omap/gpio.c b/arch/arm/plat-omap/gpio.c index 678fd08..4d43cda 100644 --- a/arch/arm/plat-omap/gpio.c +++ b/arch/arm/plat-omap/gpio.c @@ -724,7 +724,11 @@ static inline void set_24xx_gpio_triggering(struct gpio_bank *bank, int gpio, OMAP4_GPIO_IRQWAKEN0); } } else { - if (trigger != 0) + /* + * GPIO wakeup request can only be generated on edge + * transitions + */ + if (trigger & IRQ_TYPE_EDGE_BOTH) __raw_writel(1 << gpio, bank->base + OMAP24XX_GPIO_SETWKUENA); else @@ -734,7 +738,13 @@ static inline void set_24xx_gpio_triggering(struct gpio_bank *bank, int gpio, } /* This part needs to be executed always for OMAP34xx */ if (cpu_is_omap34xx() || (bank->non_wakeup_gpios & gpio_bit)) { - if (trigger != 0) + /* + * Log the edge gpio and manually trigger the IRQ + * after resume if the input level changes + * to avoid irq lost during PER RET/OFF mode + * Applies for omap2 non-wakeup gpio and all omap3 gpios + */ + if (trigger & IRQ_TYPE_EDGE_BOTH) bank->enabled_non_wakeup_gpios |= gpio_bit; else bank->enabled_non_wakeup_gpios &= ~gpio_bit;