From: Lee Jones <hidden> Date: 2012-10-11 14:15:47
From: Jonas Aaberg <redacted>
Disable hardware if active when suspending if the hw can not
wake the system from suspend.
Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: linux-input@vger.kernel.org
Acked-by: Lee Jones <redacted>
Signed-off-by: Jonas Aaberg <redacted>
Signed-off-by: Philippe Langlais <redacted>
Reviewed-by: Bengt Jonsson <redacted>
---
drivers/input/keyboard/gpio_keys.c | 13 +++++++++++++
1 file changed, 13 insertions(+)
@@ -695,6 +698,8 @@ static int __devinit gpio_keys_probe(struct platform_device *pdev)input->id.product=0x0001;input->id.version=0x0100;+pm_runtime_enable(&pdev->dev);+/* Enable auto repeat feature of Linux input subsystem */if(pdata->rep)__set_bit(EV_REP,input->evbit);
@@ -760,6 +765,8 @@ static int __devexit gpio_keys_remove(struct platform_device *pdev)structinput_dev*input=ddata->input;inti;+pm_runtime_disable(&pdev->dev);+sysfs_remove_group(&pdev->dev.kobj,&gpio_keys_attr_group);device_init_wakeup(&pdev->dev,0);
@@ -796,8 +803,8 @@ static int gpio_keys_suspend(struct device *dev)}}else{ddata->enable_after_suspend=ddata->enabled;-if(ddata->enabled)-gpio_keys_close(ddata->input);+if(ddata->enabled&&ddata->disable)+ddata->disable(dev);}return0;
@@ -817,8 +824,9 @@ static int gpio_keys_resume(struct device *dev)gpio_keys_gpio_report_event(bdata);}-if(!device_may_wakeup(dev)&&ddata->enable_after_suspend)-gpio_keys_open(ddata->input);+if(!device_may_wakeup(dev)&&ddata->enable_after_suspend+&&ddata->enable)+ddata->enable(dev);input_sync(ddata->input);
@@ -526,6 +527,7 @@ static int gpio_keys_open(struct input_dev *input){structgpio_keys_drvdata*ddata=input_get_drvdata(input);+pm_runtime_get_sync(input->dev.parent);
I am not an expert of the runtime.
However would be grateful if you explain me what it actually do.
Also I did not see any runtime suspend/ resume handlers populated.
@@ -526,6 +527,7 @@ static int gpio_keys_open(struct input_dev *input){structgpio_keys_drvdata*ddata=input_get_drvdata(input);+pm_runtime_get_sync(input->dev.parent);
I am not an expert of the runtime.
However would be grateful if you explain me what it actually do.
Also I did not see any runtime suspend/ resume handlers populated.
--
Lee Jones
Linaro ST-Ericsson Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
I am not an expert of the runtime.
However would be grateful if you explain me what it actually do.
This increase the reference count of the runtime status container
for the device. _sync makes sure it happens now.
Consult:
Documentation/power/runtime_pm.txt
Also I did not see any runtime suspend/ resume handlers populated.
It is not necessary to handle the power state at the driver level,
it can just as well be handled by the voltage/power domain,
or at the class, type or bus level.
But the individual driver has to notify the system upward if it
needs to be powered on or when it may or must be relaxed.
Yours,
Linus Walleij
Hi Lee,
On Thu, Oct 11, 2012 at 03:15:26PM +0100, Lee Jones wrote:
From: Jonas Aaberg <redacted>
Disable hardware if active when suspending if the hw can not
wake the system from suspend.
Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: linux-input@vger.kernel.org
Acked-by: Lee Jones <redacted>
If you are sending the patch then it should be signed-off-by, not
acked-by, and it should be the very last entry.
@@ -674,6 +678,7 @@ static int __devinit gpio_keys_probe(struct platform_device *pdev)ddata->n_buttons=pdata->nbuttons;ddata->enable=pdata->enable;ddata->disable=pdata->disable;+ddata->enabled=false;mutex_init(&ddata->disable_lock);platform_set_drvdata(pdev,ddata);
@@ -789,6 +794,10 @@ static int gpio_keys_suspend(struct device *dev)if(bdata->button->wakeup)enable_irq_wake(bdata->irq);}+}else{+ddata->enable_after_suspend=ddata->enabled;+if(ddata->enabled)+gpio_keys_close(ddata->input);
I think it should take ddata->input->mutex to avoid races with
open/close and use ddata->input->users to figure out if device shoudl be
closed and re-opened later.
Thanks.
quoted hunk
}
return 0;
@@ -807,6 +816,10 @@ static int gpio_keys_resume(struct device *dev) if (gpio_is_valid(bdata->button->gpio)) gpio_keys_gpio_report_event(bdata); }++ if (!device_may_wakeup(dev) && ddata->enable_after_suspend)+ gpio_keys_open(ddata->input);+ input_sync(ddata->input); return 0;
I am not an expert of the runtime.
However would be grateful if you explain me what it actually do.
This increase the reference count of the runtime status container
for the device. _sync makes sure it happens now.
Consult:
Documentation/power/runtime_pm.txt
quoted
Also I did not see any runtime suspend/ resume handlers populated.
It is not necessary to handle the power state at the driver level,
it can just as well be handled by the voltage/power domain,
or at the class, type or bus level.
But the individual driver has to notify the system upward if it
needs to be powered on or when it may or must be relaxed.
Yours,
Linus Walleij
Friendly poke.
--
Lee Jones
Linaro ST-Ericsson Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
On Thu, Oct 25, 2012 at 9:57 AM, Lee Jones [off-list ref] wrote:
On Fri, 12 Oct 2012, Linus Walleij wrote:
quoted
Yours,
Linus Walleij
Friendly poke.
This makes it look like you're poking me as I'm in the To: field but I suspect
the intent must be to poke Dmitry ... I was just providing background
for Shubhrajyoti's question.
Maybe this helps:
Reviewed-by: Linus Walleij <redacted>
Yours,
Linus Walleij
From: Lee Jones <hidden> Date: 2012-10-25 08:21:58
On Thu, 25 Oct 2012, Linus Walleij wrote:
On Thu, Oct 25, 2012 at 9:57 AM, Lee Jones [off-list ref] wrote:
quoted
On Fri, 12 Oct 2012, Linus Walleij wrote:
quoted
quoted
Yours,
Linus Walleij
Friendly poke.
This makes it look like you're poking me as I'm in the To: field but I suspect
the intent must be to poke Dmitry ... I was just providing background
for Shubhrajyoti's question.
Maybe this helps:
Reviewed-by: Linus Walleij <redacted>
Yes, that was also the intention of the other poke. Sorry about
that, I should have moved you into Cc: instead.
Yes, the poke was for Dmitry.
--
Lee Jones
Linaro ST-Ericsson Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
On Thu, Oct 25, 2012 at 09:21:45AM +0100, Lee Jones wrote:
On Thu, 25 Oct 2012, Linus Walleij wrote:
quoted
On Thu, Oct 25, 2012 at 9:57 AM, Lee Jones [off-list ref] wrote:
quoted
On Fri, 12 Oct 2012, Linus Walleij wrote:
quoted
quoted
Yours,
Linus Walleij
Friendly poke.
This makes it look like you're poking me as I'm in the To: field but I suspect
the intent must be to poke Dmitry ... I was just providing background
for Shubhrajyoti's question.
Maybe this helps:
Reviewed-by: Linus Walleij <redacted>
Yes, that was also the intention of the other poke. Sorry about
that, I should have moved you into Cc: instead.
Yes, the poke was for Dmitry.
Still do not have the right signoffs: person who sends me the patch needs
to put signed-off-by, not acked-by.
Thanks.
--
Dmitry
From: Lee Jones <hidden> Date: 2012-10-25 09:47:49
On Thu, 25 Oct 2012, Dmitry Torokhov wrote:
On Thu, Oct 25, 2012 at 09:21:45AM +0100, Lee Jones wrote:
quoted
On Thu, 25 Oct 2012, Linus Walleij wrote:
quoted
On Thu, Oct 25, 2012 at 9:57 AM, Lee Jones [off-list ref] wrote:
quoted
On Fri, 12 Oct 2012, Linus Walleij wrote:
quoted
quoted
Yours,
Linus Walleij
Friendly poke.
This makes it look like you're poking me as I'm in the To: field but I suspect
the intent must be to poke Dmitry ... I was just providing background
for Shubhrajyoti's question.
Maybe this helps:
Reviewed-by: Linus Walleij <redacted>
Yes, that was also the intention of the other poke. Sorry about
that, I should have moved you into Cc: instead.
Yes, the poke was for Dmitry.
Still do not have the right signoffs: person who sends me the patch needs
to put signed-off-by, not acked-by.
My apologies.
Signed-off-by: Lee Jones <redacted>
--
Lee Jones
Linaro ST-Ericsson Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html