All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Cc: Hans de Goede <hdegoede@redhat.com>,
	Peter Hutterer <peter.hutterer@who-t.net>,
	linux-input@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/4] Input - synaptics: do not release extra buttons once they are pressed
Date: Mon, 2 Feb 2015 13:46:40 -0800	[thread overview]
Message-ID: <20150202214640.GC23909@dtor-ws> (raw)
In-Reply-To: <1422475807-15033-3-git-send-email-benjamin.tissoires@redhat.com>

On Wed, Jan 28, 2015 at 03:10:05PM -0500, Benjamin Tissoires wrote:
> The current code releases the extra buttons right after they are pressed.
> As soon as a new serio report comes in, the hw state is reset to 0
> and so the buttons are released.
> 
> Check for the report type before acting on the current extra buttons
> state.

No:

"If Ext is 0 (if bit 1 of bytes 1 and 4 are the same) then there are no
external buttons being pressed (or all external buttons have been
released)." - Synaptics PS/2 TouchPad Interfacing Guide PN:
511-000275-01 Rev. B

Thanks.

> 
> Cc: stable@vger.kernel.org
> Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
> ---
>  drivers/input/mouse/synaptics.c | 10 +++++++---
>  drivers/input/mouse/synaptics.h |  3 +++
>  2 files changed, 10 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/input/mouse/synaptics.c b/drivers/input/mouse/synaptics.c
> index 0d12664..d58863b 100644
> --- a/drivers/input/mouse/synaptics.c
> +++ b/drivers/input/mouse/synaptics.c
> @@ -688,7 +688,7 @@ static int synaptics_parse_hw_state(const unsigned char buf[],
>  		}
>  
>  		if (SYN_CAP_MULTI_BUTTON_NO(priv->ext_cap) &&
> -		    ((buf[0] ^ buf[3]) & 0x02)) {
> +		    SYN_REPORT_EXT_BUTTONS(buf)) {
>  			switch (SYN_CAP_MULTI_BUTTON_NO(priv->ext_cap)) {
>  			default:
>  				/*
> @@ -792,8 +792,12 @@ static void synaptics_report_buttons(struct psmouse *psmouse,
>  		input_report_key(dev, BTN_BACK, hw->down);
>  	}
>  
> -	for (i = 0; i < SYN_CAP_MULTI_BUTTON_NO(priv->ext_cap); i++)
> -		input_report_key(dev, BTN_0 + i, hw->ext_buttons & (1 << i));
> +	if (SYN_CAP_MULTI_BUTTON_NO(priv->ext_cap) &&
> +	    SYN_REPORT_EXT_BUTTONS(psmouse->packet)) {
> +		for (i = 0; i < SYN_CAP_MULTI_BUTTON_NO(priv->ext_cap); i++)
> +			input_report_key(dev, BTN_0 + i,
> +					 hw->ext_buttons & (1 << i));
> +	}
>  }
>  
>  static void synaptics_report_mt_data(struct psmouse *psmouse,
> diff --git a/drivers/input/mouse/synaptics.h b/drivers/input/mouse/synaptics.h
> index 6faf9bb..0b2b711 100644
> --- a/drivers/input/mouse/synaptics.h
> +++ b/drivers/input/mouse/synaptics.h
> @@ -115,6 +115,9 @@
>  #define SYN_NEWABS_RELAXED		2
>  #define SYN_OLDABS			3
>  
> +/* synaptics extended button packet */
> +#define SYN_REPORT_EXT_BUTTONS(buf)	(((buf)[0] ^ (buf)[3]) & 0x02)
> +
>  /* amount to fuzz position data when touchpad reports reduced filtering */
>  #define SYN_REDUCED_FILTER_FUZZ		8
>  
> -- 
> 2.1.0
> 

-- 
Dmitry

  reply	other threads:[~2015-02-02 21:46 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-28 20:10 [PATCH 0/4] New Lenovos 2015 touchpads: party time! Benjamin Tissoires
2015-01-28 20:10 ` [PATCH 1/4] Input - synaptics: fix middle button on Lenovo 2015 products Benjamin Tissoires
2015-02-02 22:54   ` Dmitry Torokhov
2015-02-04 19:43     ` Benjamin Tissoires
2015-02-04 19:53       ` Dmitry Torokhov
2015-01-28 20:10 ` [PATCH 2/4] Input - synaptics: do not release extra buttons once they are pressed Benjamin Tissoires
2015-02-02 21:46   ` Dmitry Torokhov [this message]
2015-02-02 22:14     ` Benjamin Tissoires
2015-02-04 21:29       ` Benjamin Tissoires
2015-02-05  1:53         ` Andrew Duggan
2015-02-06  1:54         ` Andrew Duggan
2015-01-28 20:10 ` [PATCH 3/4] Input - synaptics: remove TOPBUTTONPAD property for Lenovos 2015 Benjamin Tissoires
2015-02-02 21:59   ` Dmitry Torokhov
2015-01-28 20:10 ` [PATCH 4/4] Input - synaptics: Remove X1 Carbon 3rd gen from the topbuttonpad list Benjamin Tissoires
2015-01-29  7:52 ` [PATCH 0/4] New Lenovos 2015 touchpads: party time! Hans de Goede

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=20150202214640.GC23909@dtor-ws \
    --to=dmitry.torokhov@gmail.com \
    --cc=benjamin.tissoires@redhat.com \
    --cc=hdegoede@redhat.com \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=peter.hutterer@who-t.net \
    /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 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.