All of lore.kernel.org
 help / color / mirror / Atom feed
From: Shiraz Hashim <shiraz.hashim@st.com>
To: Dmitry Torokhov <dmitry.torokhov@gmail.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: Mon, 9 Jul 2012 09:33:12 +0530	[thread overview]
Message-ID: <20120709040312.GC2020@localhost.localdomain> (raw)
In-Reply-To: <20120708011155.GE19007@core.coreip.homeip.net>

Hi Dmitry,

On Sat, Jul 07, 2012 at 06:11:55PM -0700, Dmitry Torokhov wrote:
> 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.

Oh. Sorry, I should have been careful. I would clean up and send V2
for this.

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

The keyboard is initialized and programmed in open and disabled in
close, so I thought even if I just enable the clock in suspend
(without open being called) it would not be able to generate the
wakeup interrupt.

--
regards
Shiraz

  reply	other threads:[~2012-07-09  4:03 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
2012-07-09  4:03     ` Shiraz Hashim [this message]
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=20120709040312.GC2020@localhost.localdomain \
    --to=shiraz.hashim@st.com \
    --cc=dmitry.torokhov@gmail.com \
    --cc=linux-input@vger.kernel.org \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.