All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] Input: cros_ec_keyb - Clear keyboard state only when it hasn't been a wake source
@ 2015-03-25 16:08 Tomeu Vizoso
  2015-03-25 18:45 ` Javier Martinez Canillas
  0 siblings, 1 reply; 3+ messages in thread
From: Tomeu Vizoso @ 2015-03-25 16:08 UTC (permalink / raw)
  To: linux-kernel
  Cc: Tomeu Vizoso, Dmitry Torokhov, Lee Jones,
	Javier Martinez Canillas, Doug Anderson, Andrew Bresticker,
	Sjoerd Simons, Bill Richardson, Todd Broch, linux-input

As the comment right before explains, the keyboard state is to be
cleared only if the EC wasn't a wakeup source in the last suspend.

Without this commit, there's an unneeded delay when resuming from
suspend and we also lose the key that was pressed while suspended.

Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
---

Sorry, v1 included an unintended change.

Thanks,

Tomeu

---
 drivers/input/keyboard/cros_ec_keyb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/input/keyboard/cros_ec_keyb.c b/drivers/input/keyboard/cros_ec_keyb.c
index 769f8f7..b50c5b8 100644
--- a/drivers/input/keyboard/cros_ec_keyb.c
+++ b/drivers/input/keyboard/cros_ec_keyb.c
@@ -341,7 +341,7 @@ static int cros_ec_keyb_resume(struct device *dev)
 	 * wake source (e.g. the lid is open and the user might press a key to
 	 * wake) then the key scan buffer should be preserved.
 	 */
-	if (ckdev->ec->was_wake_device)
+	if (!ckdev->ec->was_wake_device)
 		cros_ec_keyb_clear_keyboard(ckdev);
 
 	return 0;
-- 
2.1.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH v2] Input: cros_ec_keyb - Clear keyboard state only when it hasn't been a wake source
  2015-03-25 16:08 [PATCH v2] Input: cros_ec_keyb - Clear keyboard state only when it hasn't been a wake source Tomeu Vizoso
@ 2015-03-25 18:45 ` Javier Martinez Canillas
  2015-04-06 16:47   ` Dmitry Torokhov
  0 siblings, 1 reply; 3+ messages in thread
From: Javier Martinez Canillas @ 2015-03-25 18:45 UTC (permalink / raw)
  To: Tomeu Vizoso, linux-kernel
  Cc: Dmitry Torokhov, Lee Jones, Doug Anderson, Andrew Bresticker,
	Sjoerd Simons, Bill Richardson, Todd Broch, linux-input

Hello Tomeu,

On 03/25/2015 05:08 PM, Tomeu Vizoso wrote:
> As the comment right before explains, the keyboard state is to be
> cleared only if the EC wasn't a wakeup source in the last suspend.
> 
> Without this commit, there's an unneeded delay when resuming from
> suspend and we also lose the key that was pressed while suspended.
> 
> Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
> ---
> 
> Sorry, v1 included an unintended change.
> 
> Thanks,
> 
> Tomeu
> 
> ---
>  drivers/input/keyboard/cros_ec_keyb.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/input/keyboard/cros_ec_keyb.c b/drivers/input/keyboard/cros_ec_keyb.c
> index 769f8f7..b50c5b8 100644
> --- a/drivers/input/keyboard/cros_ec_keyb.c
> +++ b/drivers/input/keyboard/cros_ec_keyb.c
> @@ -341,7 +341,7 @@ static int cros_ec_keyb_resume(struct device *dev)
>  	 * wake source (e.g. the lid is open and the user might press a key to
>  	 * wake) then the key scan buffer should be preserved.
>  	 */
> -	if (ckdev->ec->was_wake_device)
> +	if (!ckdev->ec->was_wake_device)
>  		cros_ec_keyb_clear_keyboard(ckdev);
>  

Your change matches the comment indeed and makes more sense.

Reviewed-by: Javier Martinez Canillas <javier.martinez@collabora.co.uk>

Best regards,
Javier

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH v2] Input: cros_ec_keyb - Clear keyboard state only when it hasn't been a wake source
  2015-03-25 18:45 ` Javier Martinez Canillas
@ 2015-04-06 16:47   ` Dmitry Torokhov
  0 siblings, 0 replies; 3+ messages in thread
From: Dmitry Torokhov @ 2015-04-06 16:47 UTC (permalink / raw)
  To: Javier Martinez Canillas
  Cc: Tomeu Vizoso, linux-kernel, Lee Jones, Doug Anderson,
	Andrew Bresticker, Sjoerd Simons, Bill Richardson, Todd Broch,
	linux-input

On Wed, Mar 25, 2015 at 07:45:23PM +0100, Javier Martinez Canillas wrote:
> Hello Tomeu,
> 
> On 03/25/2015 05:08 PM, Tomeu Vizoso wrote:
> > As the comment right before explains, the keyboard state is to be
> > cleared only if the EC wasn't a wakeup source in the last suspend.
> > 
> > Without this commit, there's an unneeded delay when resuming from
> > suspend and we also lose the key that was pressed while suspended.
> > 
> > Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
> > ---
> > 
> > Sorry, v1 included an unintended change.
> > 
> > Thanks,
> > 
> > Tomeu
> > 
> > ---
> >  drivers/input/keyboard/cros_ec_keyb.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/drivers/input/keyboard/cros_ec_keyb.c b/drivers/input/keyboard/cros_ec_keyb.c
> > index 769f8f7..b50c5b8 100644
> > --- a/drivers/input/keyboard/cros_ec_keyb.c
> > +++ b/drivers/input/keyboard/cros_ec_keyb.c
> > @@ -341,7 +341,7 @@ static int cros_ec_keyb_resume(struct device *dev)
> >  	 * wake source (e.g. the lid is open and the user might press a key to
> >  	 * wake) then the key scan buffer should be preserved.
> >  	 */
> > -	if (ckdev->ec->was_wake_device)
> > +	if (!ckdev->ec->was_wake_device)
> >  		cros_ec_keyb_clear_keyboard(ckdev);
> >  
> 
> Your change matches the comment indeed and makes more sense.
> 
> Reviewed-by: Javier Martinez Canillas <javier.martinez@collabora.co.uk>

Applied, thank you.

-- 
Dmitry

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-04-06 16:47 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-03-25 16:08 [PATCH v2] Input: cros_ec_keyb - Clear keyboard state only when it hasn't been a wake source Tomeu Vizoso
2015-03-25 18:45 ` Javier Martinez Canillas
2015-04-06 16:47   ` 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.