linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Wanlong Gao <gaowanlong@cn.fujitsu.com>
To: Hui Wang <jason77.wang@gmail.com>
Cc: dmitry.torokhov@gmail.com, s.hauer@pengutronix.de,
	maramaopercheseimorto@gmail.com, linux-input@vger.kernel.org
Subject: Re: [PATCH] input/imx_keypad: add pm suspend and resume functions
Date: Fri, 30 Sep 2011 17:05:44 +0800	[thread overview]
Message-ID: <4E858668.2020203@cn.fujitsu.com> (raw)
In-Reply-To: <4E858509.80303@gmail.com>

On 09/30/2011 04:59 PM, Hui Wang wrote:

> Wanlong Gao wrote:
>> On 09/30/2011 03:54 PM, Hui Wang wrote:
>>
>>   
>>> The imx_keypad driver is set wake capable in the imx_keypad_probe(),
>>> but it doesn't implement suspend and reusme callback interface.
>>>
>>> >From the i.MX series MCU Reference Manual, the kpp (keypad port) is
>>> a major wake up source which can detect any key press even in low
>>> power modes and even when there is no clock.
>>>
>>> Now add suspend and resume callback functions for this driver.
>>>
>>> Signed-off-by: Hui Wang <jason77.wang@gmail.com>
>>> ---

>>   
> The i.MX series kpp is not like other normal kpps on other platforms, 
> the kpp on the i.MX can detect key event and wake up system from low 
> power mode even we disable kpp clock. So i choose to unconditionally 
> disable its clock. I have explain it the commit header.
> 
> "From the i.MX series MCU Reference Manual, the kpp (keypad port) is
> 
> a major wake up source which can detect any key press even in low
> power modes and even when there is no clock.
> "
> 


I see.

>>> +
>>> +static int imx_kbd_resume(struct device *dev)
>>> +{
>>> +	struct platform_device *pdev = to_platform_device(dev);
>>> +	struct imx_keypad *kbd = platform_get_drvdata(pdev);
>>> +	struct input_dev *input_dev = kbd->input_dev;
>>> +
>>> +	mutex_lock(&input_dev->mutex);
>>> +
>>> +	if (device_may_wakeup(&pdev->dev))
>>> +		disable_irq_wake(kbd->irq);
>>> +
>>> +	if (input_dev->users)
>>> +		clk_enable(kbd->clk);
>>> +
>>> +	mutex_unlock(&input_dev->mutex);
>>> +
>>> +	return 0;
>>> +}


But is it need to hold a mutex lock also when *disable_irq_wake()* here ?

Thanks
-Wanlong Gao

  reply	other threads:[~2011-09-30  9:06 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-30  7:54 [PATCH] input/imx_keypad: add pm suspend and resume functions Hui Wang
2011-09-30  8:30 ` Wanlong Gao
2011-09-30  8:59   ` Hui Wang
2011-09-30  9:05     ` Wanlong Gao [this message]
2011-10-09  9:47       ` Hui Wang
2011-09-30  9:12     ` Dmitry Torokhov
2011-10-09  9:49       ` Hui Wang

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=4E858668.2020203@cn.fujitsu.com \
    --to=gaowanlong@cn.fujitsu.com \
    --cc=dmitry.torokhov@gmail.com \
    --cc=jason77.wang@gmail.com \
    --cc=linux-input@vger.kernel.org \
    --cc=maramaopercheseimorto@gmail.com \
    --cc=s.hauer@pengutronix.de \
    /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).