linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: Shiraz Hashim <shiraz.hashim@st.com>
Cc: spear-devel@list.st.com, linux-input@vger.kernel.org
Subject: Re: [PATCH 2/6] input/spear_keyboard: fix clock handling during suspend/resume
Date: Sat, 7 Jul 2012 18:11:55 -0700	[thread overview]
Message-ID: <20120708011155.GE19007@core.coreip.homeip.net> (raw)
In-Reply-To: <1341211814-15173-2-git-send-email-shiraz.hashim@st.com>

Hi Shiraz,

On Mon, Jul 02, 2012 at 12:20:10PM +0530, Shiraz Hashim wrote:
> SPEAr keyboard should normally disable clock during suspend and enable it
> during resume.
> 
> For cases where it is expected to act as a wakeup source the clock can
> remain in the same state i.e. kept enabled if it is being used.
> 
> Signed-off-by: Shiraz Hashim <shiraz.hashim@st.com>
> ---
>  drivers/input/keyboard/spear-keyboard.c |   12 ++++++------
>  1 file changed, 6 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/input/keyboard/spear-keyboard.c b/drivers/input/keyboard/spear-keyboard.c
> index 67d9afb..ef147f3 100644
> --- a/drivers/input/keyboard/spear-keyboard.c
> +++ b/drivers/input/keyboard/spear-keyboard.c
> @@ -318,12 +318,12 @@ static int spear_kbd_suspend(struct device *dev)
>  
>  	mutex_lock(&input_dev->mutex);
>  
> -	if (input_dev->users)
> -		clk_enable(kbd->clk);
> -
>  	if (device_may_wakeup(&pdev->dev)) {
>  		if (!enable_irq_wake(kbd->irq))
>  			kbd->irq_wake = 1;
> +	} else {
> +		if (input_dev->users)
> +			clk_disable(kbd->clk);
>  	}

This patch does not apply to mainline version of the driver because the
change introducing handling for enable_irq_wake() failures was rejected
from mainline. I also have not appplied the 6th patch in the series
because it depends on this one.

Also, don't you need to enable clock if device is marked as wakeup
source but happens to have no active users?

Thanks.

-- 
Dmitry

  reply	other threads:[~2012-07-08  1:12 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-02  6:50 [PATCH 1/6] input/spear-keyboard: fix disable device_init_wakeup in remove Shiraz Hashim
2012-07-02  6:50 ` [PATCH 2/6] input/spear_keyboard: fix clock handling during suspend/resume Shiraz Hashim
2012-07-08  1:11   ` Dmitry Torokhov [this message]
2012-07-09  4:03     ` Shiraz Hashim
2012-07-09  6:35   ` [PATCH V2 " Shiraz Hashim
2012-07-02  6:50 ` [PATCH 3/6] input/spear_keyboard: use correct io accessors Shiraz Hashim
2012-07-02  6:50 ` [PATCH 4/6] input/spear_keyboard: rename bit definitions to reflect register Shiraz Hashim
2012-07-02  6:50 ` [PATCH 5/6] input/spear_keyboard: generalize keyboard frequency configuration Shiraz Hashim
2012-07-02  6:50 ` [PATCH 6/6] input/spear_keyboard: reconfigure operating frequency on suspend Shiraz Hashim
2012-07-09  6:36   ` [PATCH V2 " Shiraz Hashim

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=20120708011155.GE19007@core.coreip.homeip.net \
    --to=dmitry.torokhov@gmail.com \
    --cc=linux-input@vger.kernel.org \
    --cc=shiraz.hashim@st.com \
    --cc=spear-devel@list.st.com \
    /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).