lkml.org 
[lkml]   [2017]   [Apr]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2] input: cros_ec_keyb: Report wakeup events
On Sun, Apr 02, 2017 at 08:07:39AM +0800, Jeffy Chen wrote:
> Report wakeup events when process events.
>
> Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>
> ---
>
> Changes in v2:
> Remove unneeded dts changes.
>
> drivers/input/keyboard/cros_ec_keyb.c | 9 +++++++++
> 1 file changed, 9 insertions(+)
>
> diff --git a/drivers/input/keyboard/cros_ec_keyb.c b/drivers/input/keyboard/cros_ec_keyb.c
> index 6a250d6..a93d55f 100644
> --- a/drivers/input/keyboard/cros_ec_keyb.c
> +++ b/drivers/input/keyboard/cros_ec_keyb.c
> @@ -286,6 +286,9 @@ static int cros_ec_keyb_work(struct notifier_block *nb,
> return NOTIFY_DONE;
> }
>
> + if (device_may_wakeup(ckdev->dev))
> + pm_wakeup_event(ckdev->dev, 0);
> +
> return NOTIFY_OK;
> }
>
> @@ -632,6 +635,12 @@ static int cros_ec_keyb_probe(struct platform_device *pdev)
> return err;
> }
>
> + err = device_init_wakeup(dev, 1);

I would prefer if we did not mark cros_ec devices as wakeup sources
unconditionally. Your original patch series was better (except it failed
to parse the "wakeup-source" property that you introduced.

> + if (err) {
> + dev_err(dev, "cannot init wakeup: %d\n", err);
> + return err;
> + }
> +
> return 0;
> }
>
> --
> 2.1.4
>
>

Thanks.

--
Dmitry

\
 
 \ /
  Last update: 2017-04-03 20:44    [W:1.146 / U:0.268 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site