All of lore.kernel.org
 help / color / mirror / Atom feed
From: Nicolas Ferre <nicolas.ferre@atmel.com>
To: Bo Shen <voice.shen@atmel.com>
Cc: dmitry.torokhov@gmail.com, Wenyou.Yang@atmel.com,
	linux-arm-kernel@lists.infradead.org,
	linux-input@vger.kernel.org
Subject: Re: [PATCH] input: qt1070: add power management ops
Date: Wed, 14 Aug 2013 08:52:17 +0200	[thread overview]
Message-ID: <520B2921.3000906@atmel.com> (raw)
In-Reply-To: <1376379826-28808-1-git-send-email-voice.shen@atmel.com>

On 13/08/2013 09:43, Bo Shen :
> Add power management ops for qt1070, it maybe a wakeup source
>
> Signed-off-by: Bo Shen <voice.shen@atmel.com>

Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>

> ---
>   drivers/input/keyboard/qt1070.c |   25 +++++++++++++++++++++++++
>   1 file changed, 25 insertions(+)
>
> diff --git a/drivers/input/keyboard/qt1070.c b/drivers/input/keyboard/qt1070.c
> index 42b773b..deefe5a 100644
> --- a/drivers/input/keyboard/qt1070.c
> +++ b/drivers/input/keyboard/qt1070.c
> @@ -243,6 +243,30 @@ static int qt1070_remove(struct i2c_client *client)
>   	return 0;
>   }
>
> +#ifdef CONFIG_PM_SLEEP
> +static int qt1070_suspend(struct device *dev)
> +{
> +	struct qt1070_data *data = dev_get_drvdata(dev);
> +
> +	if (device_may_wakeup(dev))
> +		enable_irq_wake(data->irq);
> +
> +	return 0;
> +}
> +
> +static int qt1070_resume(struct device *dev)
> +{
> +	struct qt1070_data *data = dev_get_drvdata(dev);
> +
> +	if (device_may_wakeup(dev))
> +		disable_irq_wake(data->irq);
> +
> +	return 0;
> +}
> +#endif
> +
> +static SIMPLE_DEV_PM_OPS(qt1070_pm_ops, qt1070_suspend, qt1070_resume);
> +
>   static const struct i2c_device_id qt1070_id[] = {
>   	{ "qt1070", 0 },
>   	{ },
> @@ -253,6 +277,7 @@ static struct i2c_driver qt1070_driver = {
>   	.driver	= {
>   		.name	= "qt1070",
>   		.owner	= THIS_MODULE,
> +		.pm	= &qt1070_pm_ops,
>   	},
>   	.id_table	= qt1070_id,
>   	.probe		= qt1070_probe,
>


-- 
Nicolas Ferre

WARNING: multiple messages have this Message-ID (diff)
From: nicolas.ferre@atmel.com (Nicolas Ferre)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] input: qt1070: add power management ops
Date: Wed, 14 Aug 2013 08:52:17 +0200	[thread overview]
Message-ID: <520B2921.3000906@atmel.com> (raw)
In-Reply-To: <1376379826-28808-1-git-send-email-voice.shen@atmel.com>

On 13/08/2013 09:43, Bo Shen :
> Add power management ops for qt1070, it maybe a wakeup source
>
> Signed-off-by: Bo Shen <voice.shen@atmel.com>

Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>

> ---
>   drivers/input/keyboard/qt1070.c |   25 +++++++++++++++++++++++++
>   1 file changed, 25 insertions(+)
>
> diff --git a/drivers/input/keyboard/qt1070.c b/drivers/input/keyboard/qt1070.c
> index 42b773b..deefe5a 100644
> --- a/drivers/input/keyboard/qt1070.c
> +++ b/drivers/input/keyboard/qt1070.c
> @@ -243,6 +243,30 @@ static int qt1070_remove(struct i2c_client *client)
>   	return 0;
>   }
>
> +#ifdef CONFIG_PM_SLEEP
> +static int qt1070_suspend(struct device *dev)
> +{
> +	struct qt1070_data *data = dev_get_drvdata(dev);
> +
> +	if (device_may_wakeup(dev))
> +		enable_irq_wake(data->irq);
> +
> +	return 0;
> +}
> +
> +static int qt1070_resume(struct device *dev)
> +{
> +	struct qt1070_data *data = dev_get_drvdata(dev);
> +
> +	if (device_may_wakeup(dev))
> +		disable_irq_wake(data->irq);
> +
> +	return 0;
> +}
> +#endif
> +
> +static SIMPLE_DEV_PM_OPS(qt1070_pm_ops, qt1070_suspend, qt1070_resume);
> +
>   static const struct i2c_device_id qt1070_id[] = {
>   	{ "qt1070", 0 },
>   	{ },
> @@ -253,6 +277,7 @@ static struct i2c_driver qt1070_driver = {
>   	.driver	= {
>   		.name	= "qt1070",
>   		.owner	= THIS_MODULE,
> +		.pm	= &qt1070_pm_ops,
>   	},
>   	.id_table	= qt1070_id,
>   	.probe		= qt1070_probe,
>


-- 
Nicolas Ferre

  reply	other threads:[~2013-08-14  6:52 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-13  7:43 [PATCH] input: qt1070: add power management ops Bo Shen
2013-08-13  7:43 ` Bo Shen
2013-08-14  6:52 ` Nicolas Ferre [this message]
2013-08-14  6:52   ` Nicolas Ferre
2013-10-14  5:45   ` Bo Shen
2013-10-14  5:45     ` Bo Shen
2013-10-16  6:31     ` Dmitry Torokhov
2013-10-16  6:31       ` 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=520B2921.3000906@atmel.com \
    --to=nicolas.ferre@atmel.com \
    --cc=Wenyou.Yang@atmel.com \
    --cc=dmitry.torokhov@gmail.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-input@vger.kernel.org \
    --cc=voice.shen@atmel.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.