* [PATCH] Input: gpio-keys - Add shutdown callback
@ 2019-02-01 19:24 ` Florian Fainelli
0 siblings, 0 replies; 6+ messages in thread
From: Florian Fainelli @ 2019-02-01 19:24 UTC (permalink / raw)
To: linux-kernel
Cc: Florian Fainelli, Dmitry Torokhov, Jeffy Chen, Rob Herring,
Andy Shevchenko, open list:INPUT (KEYBOARD, MOUSE, JOYSTICK ,
TOUCHSCREEN)...
On some platforms (e.g.: ARCH_BRCMSTB) it is possible to enter
"poweroff" while leaving some wake-up sources enabled such as key
presses in order to allow for the system to wake-up.
Wire up a .shutdown() callback which calls into the existing
gpio_keys_suspend() since the logic is essentially the same.
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
---
drivers/input/keyboard/gpio_keys.c | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/drivers/input/keyboard/gpio_keys.c b/drivers/input/keyboard/gpio_keys.c
index 492a971b95b5..6cd199e8a370 100644
--- a/drivers/input/keyboard/gpio_keys.c
+++ b/drivers/input/keyboard/gpio_keys.c
@@ -1015,8 +1015,18 @@ static int __maybe_unused gpio_keys_resume(struct device *dev)
static SIMPLE_DEV_PM_OPS(gpio_keys_pm_ops, gpio_keys_suspend, gpio_keys_resume);
+static void gpio_keys_shutdown(struct platform_device *pdev)
+{
+ int ret;
+
+ ret = gpio_keys_suspend(&pdev->dev);
+ if (ret)
+ dev_err(&pdev->dev, "failed to shutdown\n");
+}
+
static struct platform_driver gpio_keys_device_driver = {
.probe = gpio_keys_probe,
+ .shutdown = gpio_keys_shutdown,
.driver = {
.name = "gpio-keys",
.pm = &gpio_keys_pm_ops,
--
2.17.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH] Input: gpio-keys - Add shutdown callback
@ 2019-02-01 19:24 ` Florian Fainelli
0 siblings, 0 replies; 6+ messages in thread
From: Florian Fainelli @ 2019-02-01 19:24 UTC (permalink / raw)
To: linux-kernel
Cc: Florian Fainelli, Dmitry Torokhov, Jeffy Chen, Rob Herring,
Andy Shevchenko, open list:INPUT KEYBOARD, MOUSE, JOYSTICK ,
TOUCHSCREEN...
On some platforms (e.g.: ARCH_BRCMSTB) it is possible to enter
"poweroff" while leaving some wake-up sources enabled such as key
presses in order to allow for the system to wake-up.
Wire up a .shutdown() callback which calls into the existing
gpio_keys_suspend() since the logic is essentially the same.
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
---
drivers/input/keyboard/gpio_keys.c | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/drivers/input/keyboard/gpio_keys.c b/drivers/input/keyboard/gpio_keys.c
index 492a971b95b5..6cd199e8a370 100644
--- a/drivers/input/keyboard/gpio_keys.c
+++ b/drivers/input/keyboard/gpio_keys.c
@@ -1015,8 +1015,18 @@ static int __maybe_unused gpio_keys_resume(struct device *dev)
static SIMPLE_DEV_PM_OPS(gpio_keys_pm_ops, gpio_keys_suspend, gpio_keys_resume);
+static void gpio_keys_shutdown(struct platform_device *pdev)
+{
+ int ret;
+
+ ret = gpio_keys_suspend(&pdev->dev);
+ if (ret)
+ dev_err(&pdev->dev, "failed to shutdown\n");
+}
+
static struct platform_driver gpio_keys_device_driver = {
.probe = gpio_keys_probe,
+ .shutdown = gpio_keys_shutdown,
.driver = {
.name = "gpio-keys",
.pm = &gpio_keys_pm_ops,
--
2.17.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH] Input: gpio-keys - Add shutdown callback
2019-02-01 19:24 ` Florian Fainelli
@ 2019-02-05 22:02 ` Florian Fainelli
-1 siblings, 0 replies; 6+ messages in thread
From: Florian Fainelli @ 2019-02-05 22:02 UTC (permalink / raw)
To: linux-kernel
Cc: Dmitry Torokhov, Jeffy Chen, Rob Herring, Andy Shevchenko,
open list:INPUT (KEYBOARD, MOUSE, JOYSTICK, TOUCHSCREEN)...
On 2/1/19 11:24 AM, Florian Fainelli wrote:
> On some platforms (e.g.: ARCH_BRCMSTB) it is possible to enter
> "poweroff" while leaving some wake-up sources enabled such as key
> presses in order to allow for the system to wake-up.
>
> Wire up a .shutdown() callback which calls into the existing
> gpio_keys_suspend() since the logic is essentially the same.
>
> Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
> ---
> drivers/input/keyboard/gpio_keys.c | 10 ++++++++++
> 1 file changed, 10 insertions(+)
Any feedback on this?
>
> diff --git a/drivers/input/keyboard/gpio_keys.c b/drivers/input/keyboard/gpio_keys.c
> index 492a971b95b5..6cd199e8a370 100644
> --- a/drivers/input/keyboard/gpio_keys.c
> +++ b/drivers/input/keyboard/gpio_keys.c
> @@ -1015,8 +1015,18 @@ static int __maybe_unused gpio_keys_resume(struct device *dev)
>
> static SIMPLE_DEV_PM_OPS(gpio_keys_pm_ops, gpio_keys_suspend, gpio_keys_resume);
>
> +static void gpio_keys_shutdown(struct platform_device *pdev)
> +{
> + int ret;
> +
> + ret = gpio_keys_suspend(&pdev->dev);
> + if (ret)
> + dev_err(&pdev->dev, "failed to shutdown\n");
> +}
> +
> static struct platform_driver gpio_keys_device_driver = {
> .probe = gpio_keys_probe,
> + .shutdown = gpio_keys_shutdown,
> .driver = {
> .name = "gpio-keys",
> .pm = &gpio_keys_pm_ops,
>
--
Florian
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] Input: gpio-keys - Add shutdown callback
@ 2019-02-05 22:02 ` Florian Fainelli
0 siblings, 0 replies; 6+ messages in thread
From: Florian Fainelli @ 2019-02-05 22:02 UTC (permalink / raw)
To: linux-kernel
Cc: Dmitry Torokhov, Jeffy Chen, Rob Herring, Andy Shevchenko,
open list:INPUT (KEYBOARD, MOUSE, JOYSTICK, TOUCHSCREEN)...
On 2/1/19 11:24 AM, Florian Fainelli wrote:
> On some platforms (e.g.: ARCH_BRCMSTB) it is possible to enter
> "poweroff" while leaving some wake-up sources enabled such as key
> presses in order to allow for the system to wake-up.
>
> Wire up a .shutdown() callback which calls into the existing
> gpio_keys_suspend() since the logic is essentially the same.
>
> Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
> ---
> drivers/input/keyboard/gpio_keys.c | 10 ++++++++++
> 1 file changed, 10 insertions(+)
Any feedback on this?
>
> diff --git a/drivers/input/keyboard/gpio_keys.c b/drivers/input/keyboard/gpio_keys.c
> index 492a971b95b5..6cd199e8a370 100644
> --- a/drivers/input/keyboard/gpio_keys.c
> +++ b/drivers/input/keyboard/gpio_keys.c
> @@ -1015,8 +1015,18 @@ static int __maybe_unused gpio_keys_resume(struct device *dev)
>
> static SIMPLE_DEV_PM_OPS(gpio_keys_pm_ops, gpio_keys_suspend, gpio_keys_resume);
>
> +static void gpio_keys_shutdown(struct platform_device *pdev)
> +{
> + int ret;
> +
> + ret = gpio_keys_suspend(&pdev->dev);
> + if (ret)
> + dev_err(&pdev->dev, "failed to shutdown\n");
> +}
> +
> static struct platform_driver gpio_keys_device_driver = {
> .probe = gpio_keys_probe,
> + .shutdown = gpio_keys_shutdown,
> .driver = {
> .name = "gpio-keys",
> .pm = &gpio_keys_pm_ops,
>
--
Florian
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] Input: gpio-keys - Add shutdown callback
2019-02-05 22:02 ` Florian Fainelli
@ 2019-02-06 0:45 ` Dmitry Torokhov
-1 siblings, 0 replies; 6+ messages in thread
From: Dmitry Torokhov @ 2019-02-06 0:45 UTC (permalink / raw)
To: Florian Fainelli
Cc: linux-kernel, Jeffy Chen, Rob Herring, Andy Shevchenko,
open list:INPUT (KEYBOARD, MOUSE, JOYSTICK, TOUCHSCREEN)...
On Tue, Feb 05, 2019 at 02:02:49PM -0800, Florian Fainelli wrote:
> On 2/1/19 11:24 AM, Florian Fainelli wrote:
> > On some platforms (e.g.: ARCH_BRCMSTB) it is possible to enter
> > "poweroff" while leaving some wake-up sources enabled such as key
> > presses in order to allow for the system to wake-up.
> >
> > Wire up a .shutdown() callback which calls into the existing
> > gpio_keys_suspend() since the logic is essentially the same.
> >
> > Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
> > ---
> > drivers/input/keyboard/gpio_keys.c | 10 ++++++++++
> > 1 file changed, 10 insertions(+)
>
> Any feedback on this?
OK, I'll take it. Hopefully it won't affect existing systems as the
change is unconditional.
Thanks.
--
Dmitry
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] Input: gpio-keys - Add shutdown callback
@ 2019-02-06 0:45 ` Dmitry Torokhov
0 siblings, 0 replies; 6+ messages in thread
From: Dmitry Torokhov @ 2019-02-06 0:45 UTC (permalink / raw)
To: Florian Fainelli
Cc: linux-kernel, Jeffy Chen, Rob Herring, Andy Shevchenko,
open list:INPUT (KEYBOARD, MOUSE, JOYSTICK, TOUCHSCREEN)...
On Tue, Feb 05, 2019 at 02:02:49PM -0800, Florian Fainelli wrote:
> On 2/1/19 11:24 AM, Florian Fainelli wrote:
> > On some platforms (e.g.: ARCH_BRCMSTB) it is possible to enter
> > "poweroff" while leaving some wake-up sources enabled such as key
> > presses in order to allow for the system to wake-up.
> >
> > Wire up a .shutdown() callback which calls into the existing
> > gpio_keys_suspend() since the logic is essentially the same.
> >
> > Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
> > ---
> > drivers/input/keyboard/gpio_keys.c | 10 ++++++++++
> > 1 file changed, 10 insertions(+)
>
> Any feedback on this?
OK, I'll take it. Hopefully it won't affect existing systems as the
change is unconditional.
Thanks.
--
Dmitry
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2019-02-06 0:45 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-02-01 19:24 [PATCH] Input: gpio-keys - Add shutdown callback Florian Fainelli
2019-02-01 19:24 ` Florian Fainelli
2019-02-05 22:02 ` Florian Fainelli
2019-02-05 22:02 ` Florian Fainelli
2019-02-06 0:45 ` Dmitry Torokhov
2019-02-06 0:45 ` Dmitry Torokhov
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.