public inbox for linux-omap@vger.kernel.org
 help / color / mirror / Atom feed
From: Kevin Hilman <khilman@deeprootsystems.com>
To: linux-omap@vger.kernel.org
Cc: Chunqiu Wang <cqwang@motorola.com>
Subject: Re: [PATCH -pm] OMAP3: GPIO: Only enable WAKEUPEN for edge detection GPIOs
Date: Fri, 26 Jun 2009 20:52:04 -0700	[thread overview]
Message-ID: <87k52y9vvf.fsf@deeprootsystems.com> (raw)
In-Reply-To: <1245863619-1222-1-git-send-email-khilman@deeprootsystems.com> (Kevin Hilman's message of "Wed\, 24 Jun 2009 10\:13\:39 -0700")

Kevin Hilman <khilman@deeprootsystems.com> writes:

> From: Chunqiu Wang <cqwang@motorola.com>
>
> According to the GPIO 'Wakeup and Interrupt' section of the TRM[1],
> wake-up requests can only be generated on edge transitions.
>
> Also for OMAP3, only edge GPIOs may lose interrupts when PER enters
> RET/OFF state, this is addressed by gpio prepare|resume idle functions
>
> [1] Section 25.5.3.1 OMAP34xx_ES3.1_TRM_V_Q
>
> Signed-off-by: Chunqiu Wang <cqwang@motorola.com>
> Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>

Pushing to PM branch, and backport to pm-2.6.29.

Kevin

> ---
>  arch/arm/plat-omap/gpio.c |   14 ++++++++++++--
>  1 files changed, 12 insertions(+), 2 deletions(-)
>
> diff --git a/arch/arm/plat-omap/gpio.c b/arch/arm/plat-omap/gpio.c
> index 8e6f511..de61a13 100644
> --- a/arch/arm/plat-omap/gpio.c
> +++ b/arch/arm/plat-omap/gpio.c
> @@ -684,7 +684,11 @@ static inline void set_24xx_gpio_triggering(struct gpio_bank *bank, int gpio,
>  		trigger & IRQ_TYPE_EDGE_FALLING);
>  
>  	if (likely(!(bank->non_wakeup_gpios & gpio_bit))) {
> -		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
> @@ -693,7 +697,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;
> -- 
> 1.6.3.2

      reply	other threads:[~2009-06-27  3:52 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-24 17:13 [PATCH -pm] OMAP3: GPIO: Only enable WAKEUPEN for edge detection GPIOs Kevin Hilman
2009-06-27  3:52 ` Kevin Hilman [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87k52y9vvf.fsf@deeprootsystems.com \
    --to=khilman@deeprootsystems.com \
    --cc=cqwang@motorola.com \
    --cc=linux-omap@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox