linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: Anson Huang <b20788@freescale.com>
Cc: sachin.kamat@linaro.org, linux-input@vger.kernel.org
Subject: Re: [PATCH] Input: gpio_keys: support wakeup system from freeze mode
Date: Mon, 23 Dec 2013 16:30:36 -0800	[thread overview]
Message-ID: <20131224003036.GA16590@core.coreip.homeip.net> (raw)
In-Reply-To: <1387822880-30382-1-git-send-email-b20788@freescale.com>

Hi Anson,

On Mon, Dec 23, 2013 at 01:21:20PM -0500, Anson Huang wrote:
> For "freeze" mode of suspend, cpu will go into idle and
> those wakeup sources' irq should NOT be disabled during
> devices suspend, so we need to add IRQF_NO_SUSPEND flag
> for those wakeup sources.
> 
> Steps to test this patch:
> 
> 1. echo freeze > /sys/power/state;
> 2. press gpio key which has wakeup function, then system
>    will resume.

I do no think this is correct approach, otheriwse every driver that can
be a wakeup source would have to use IRQF_NO_SUSPEND flag. The driver
does use enable_irq_wake() in its suspend path, and platform code should
perform all necessary work for this IRQ to be usable as a wakeup source.

Thanks.

> 
> Signed-off-by: Anson Huang <b20788@freescale.com>
> ---
>  drivers/input/keyboard/gpio_keys.c |    2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/input/keyboard/gpio_keys.c b/drivers/input/keyboard/gpio_keys.c
> index 2db1324..aadb1db 100644
> --- a/drivers/input/keyboard/gpio_keys.c
> +++ b/drivers/input/keyboard/gpio_keys.c
> @@ -473,6 +473,8 @@ static int gpio_keys_setup_key(struct platform_device *pdev,
>  
>  		isr = gpio_keys_gpio_isr;
>  		irqflags = IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING;
> +		if (bdata->button->wakeup)
> +			irqflags |= IRQF_NO_SUSPEND;
>  
>  	} else {
>  		if (!button->irq) {
> -- 
> 1.7.9.5
> 
> 

-- 
Dmitry

  reply	other threads:[~2013-12-24  0:30 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-23 18:21 [PATCH] Input: gpio_keys: support wakeup system from freeze mode Anson Huang
2013-12-24  0:30 ` Dmitry Torokhov [this message]
2013-12-24  2:29   ` Anson.Huang
2013-12-26 23:35     ` Dmitry Torokhov

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=20131224003036.GA16590@core.coreip.homeip.net \
    --to=dmitry.torokhov@gmail.com \
    --cc=b20788@freescale.com \
    --cc=linux-input@vger.kernel.org \
    --cc=sachin.kamat@linaro.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;
as well as URLs for NNTP newsgroup(s).