linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: Jeffy Chen <jeffy.chen@rock-chips.com>
Cc: linux-kernel@vger.kernel.org, briannorris@chromium.org,
	dbasehore@google.com, dianders@chromium.org,
	Gwendal Grignou <gwendal@chromium.org>,
	Vic Yang <victoryang@google.com>,
	linux-input@vger.kernel.org,
	Enric Balletbo Serra <enric.balletbo@collabora.com>,
	Lee Jones <lee.jones@linaro.org>
Subject: Re: [PATCH 1/2] input: cros_ec_keyb: Report wakeup events
Date: Sat, 1 Apr 2017 10:12:37 -0700	[thread overview]
Message-ID: <20170401171237.GH17130@dtor-ws> (raw)
In-Reply-To: <1490867450-31765-2-git-send-email-jeffy.chen@rock-chips.com>

Hi Jeffy,

On Thu, Mar 30, 2017 at 05:50:49PM +0800, Jeffy Chen wrote:
> Report wakeup events when process events.
> 
> Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>
> ---
> 
>  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);

In the other patch you are adding "wakeup-source" to the DT binding, but
here you mark all EC deices as wakeup sources. You need to use
device_property_read_bool(dev, "wakeup-source") and use the result in
call to device_init_wakeup().

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

Thanks.

-- 
Dmitry

  reply	other threads:[~2017-04-01 17:12 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-30  9:50 [PATCH 0/2] This patches set cros_ec_keyb as a wakeup source, so the chromeos's powerd Jeffy Chen
2017-03-30  9:50 ` [PATCH 1/2] input: cros_ec_keyb: Report wakeup events Jeffy Chen
2017-04-01 17:12   ` Dmitry Torokhov [this message]
2017-04-01 17:14     ` Dmitry Torokhov
2017-04-02  0:10       ` jeffy

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=20170401171237.GH17130@dtor-ws \
    --to=dmitry.torokhov@gmail.com \
    --cc=briannorris@chromium.org \
    --cc=dbasehore@google.com \
    --cc=dianders@chromium.org \
    --cc=enric.balletbo@collabora.com \
    --cc=gwendal@chromium.org \
    --cc=jeffy.chen@rock-chips.com \
    --cc=lee.jones@linaro.org \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=victoryang@google.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 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).