linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Input: elantech - mark protocols v2 and v3 as semi-mt
@ 2016-01-11 10:09 Benjamin Tissoires
  2016-01-12  1:44 ` Dmitry Torokhov
  0 siblings, 1 reply; 2+ messages in thread
From: Benjamin Tissoires @ 2016-01-11 10:09 UTC (permalink / raw)
  To: Dmitry Torokhov, linux-input; +Cc: linux-kernel

When using a protocol v2 or v3 hardware, elantech uses the function
elantech_report_semi_mt_data() to report data. This devices are rather
creepy because if num_finger is 3, (x2,y2) is (0,0). Yes, only one valid
touch is reported.

Anyway, userspace (libinput) is now confused by these (0,0) touches,
and detect them as palm, and rejects them.

Commit 3c0213d17a09 ("Input: elantech - fix semi-mt protocol for v3 HW")
was sufficient enough for xf86-input-synaptics and libinput before it has
palm rejection. Now we need to actually tell libinput that this device is
a semi-mt one and it should not rely on the actual values of the 2 touches.

Cc: stable@vger.kernel.org
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
---
 drivers/input/mouse/elantech.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/input/mouse/elantech.c b/drivers/input/mouse/elantech.c
index 537ebb0..78f93cf 100644
--- a/drivers/input/mouse/elantech.c
+++ b/drivers/input/mouse/elantech.c
@@ -1222,7 +1222,7 @@ static int elantech_set_input_params(struct psmouse *psmouse)
 			input_set_abs_params(dev, ABS_TOOL_WIDTH, ETP_WMIN_V2,
 					     ETP_WMAX_V2, 0, 0);
 		}
-		input_mt_init_slots(dev, 2, 0);
+		input_mt_init_slots(dev, 2, INPUT_MT_SEMI_MT);
 		input_set_abs_params(dev, ABS_MT_POSITION_X, x_min, x_max, 0, 0);
 		input_set_abs_params(dev, ABS_MT_POSITION_Y, y_min, y_max, 0, 0);
 		break;
-- 
2.5.0

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

* Re: [PATCH] Input: elantech - mark protocols v2 and v3 as semi-mt
  2016-01-11 10:09 [PATCH] Input: elantech - mark protocols v2 and v3 as semi-mt Benjamin Tissoires
@ 2016-01-12  1:44 ` Dmitry Torokhov
  0 siblings, 0 replies; 2+ messages in thread
From: Dmitry Torokhov @ 2016-01-12  1:44 UTC (permalink / raw)
  To: Benjamin Tissoires; +Cc: linux-input, linux-kernel

On Mon, Jan 11, 2016 at 11:09:00AM +0100, Benjamin Tissoires wrote:
> When using a protocol v2 or v3 hardware, elantech uses the function
> elantech_report_semi_mt_data() to report data. This devices are rather
> creepy because if num_finger is 3, (x2,y2) is (0,0). Yes, only one valid
> touch is reported.
> 
> Anyway, userspace (libinput) is now confused by these (0,0) touches,
> and detect them as palm, and rejects them.
> 
> Commit 3c0213d17a09 ("Input: elantech - fix semi-mt protocol for v3 HW")
> was sufficient enough for xf86-input-synaptics and libinput before it has
> palm rejection. Now we need to actually tell libinput that this device is
> a semi-mt one and it should not rely on the actual values of the 2 touches.
> 
> Cc: stable@vger.kernel.org
> Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>

Applied, thank you.

> ---
>  drivers/input/mouse/elantech.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/input/mouse/elantech.c b/drivers/input/mouse/elantech.c
> index 537ebb0..78f93cf 100644
> --- a/drivers/input/mouse/elantech.c
> +++ b/drivers/input/mouse/elantech.c
> @@ -1222,7 +1222,7 @@ static int elantech_set_input_params(struct psmouse *psmouse)
>  			input_set_abs_params(dev, ABS_TOOL_WIDTH, ETP_WMIN_V2,
>  					     ETP_WMAX_V2, 0, 0);
>  		}
> -		input_mt_init_slots(dev, 2, 0);
> +		input_mt_init_slots(dev, 2, INPUT_MT_SEMI_MT);
>  		input_set_abs_params(dev, ABS_MT_POSITION_X, x_min, x_max, 0, 0);
>  		input_set_abs_params(dev, ABS_MT_POSITION_Y, y_min, y_max, 0, 0);
>  		break;
> -- 
> 2.5.0
> 

-- 
Dmitry

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

end of thread, other threads:[~2016-01-12  1:44 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-01-11 10:09 [PATCH] Input: elantech - mark protocols v2 and v3 as semi-mt Benjamin Tissoires
2016-01-12  1:44 ` Dmitry Torokhov

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).