* [PATCH] input: qt1070: add power management ops
@ 2013-08-13 7:43 Bo Shen
2013-08-14 6:52 ` Nicolas Ferre
0 siblings, 1 reply; 4+ messages in thread
From: Bo Shen @ 2013-08-13 7:43 UTC (permalink / raw)
To: dmitry.torokhov; +Cc: Wenyou.Yang, Bo Shen, linux-arm-kernel, linux-input
Add power management ops for qt1070, it maybe a wakeup source
Signed-off-by: Bo Shen <voice.shen@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,
--
1.7.9.5
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] input: qt1070: add power management ops
2013-08-13 7:43 [PATCH] input: qt1070: add power management ops Bo Shen
@ 2013-08-14 6:52 ` Nicolas Ferre
2013-10-14 5:45 ` Bo Shen
0 siblings, 1 reply; 4+ messages in thread
From: Nicolas Ferre @ 2013-08-14 6:52 UTC (permalink / raw)
To: Bo Shen; +Cc: dmitry.torokhov, Wenyou.Yang, linux-arm-kernel, linux-input
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
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] input: qt1070: add power management ops
2013-08-14 6:52 ` Nicolas Ferre
@ 2013-10-14 5:45 ` Bo Shen
2013-10-16 6:31 ` Dmitry Torokhov
0 siblings, 1 reply; 4+ messages in thread
From: Bo Shen @ 2013-10-14 5:45 UTC (permalink / raw)
To: dmitry.torokhov; +Cc: Nicolas Ferre, Wenyou.Yang, linux-arm-kernel, linux-input
Hi Dmitry,
On 8/14/2013 14:52, Nicolas Ferre wrote:
> 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>
Would this patch be applied with Nicolas' ACK?
Best Regards,
Bo Shen
>> ---
>> 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,
>>
>
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] input: qt1070: add power management ops
2013-10-14 5:45 ` Bo Shen
@ 2013-10-16 6:31 ` Dmitry Torokhov
0 siblings, 0 replies; 4+ messages in thread
From: Dmitry Torokhov @ 2013-10-16 6:31 UTC (permalink / raw)
To: Bo Shen; +Cc: Nicolas Ferre, Wenyou.Yang, linux-arm-kernel, linux-input
Hi Bo,
On Mon, Oct 14, 2013 at 01:45:24PM +0800, Bo Shen wrote:
> Hi Dmitry,
>
> On 8/14/2013 14:52, Nicolas Ferre wrote:
> >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>
>
> Would this patch be applied with Nicolas' ACK?
This patch is already in mainline:
commit 3719b54bc62318db7dd8ac7c39a09dfb991a208f
Author: Bo Shen <voice.shen@atmel.com>
Date: Tue Aug 13 09:46:40 2013 -0700
Input: qt1070 - add power management ops
Add power management ops for qt1070, it may be a wakeup source.
Signed-off-by: Bo Shen <voice.shen@atmel.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Thanks.
--
Dmitry
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2013-10-16 6:31 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-08-13 7:43 [PATCH] input: qt1070: add power management ops Bo Shen
2013-08-14 6:52 ` Nicolas Ferre
2013-10-14 5:45 ` Bo Shen
2013-10-16 6:31 ` Dmitry Torokhov
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).