diff mbox

[01/01] Input multitouch: fix horizontal two-finger-scrolling on Sentelic touchpads

Message ID 20121219230945.GA25106@sherka.no-ip.biz
State New, archived
Headers show

Commit Message

Christophe TORDEUX Dec. 19, 2012, 11:09 p.m. UTC
From: Christophe TORDEUX <christophe@tordeux.net>

Apply the following change to the Sentelic touchpad driver:
report only the position of the first finger as absolute non-MT 
coordinates, instead of reporting both fingers alternatively. Actual MT 
events are unaffected.

Signed-off-by: Christophe TORDEUX <christophe@tordeux.net>
----

This is a much simpler version of my patch. Basically, it makes little 
sense to report both fingers alternatively, as long as it's non-MT 
events. With this approach, storing coordinates of the previously 
reported touch is not necessary. This patch is against kernel version 
3.7. Works with a touchpad version STL3888_C0, very probably works on 
all later version, and very probably does not impact any earlier 
version. This patch has two effects:
1) fix horizontal and improve vertical scrolling, though maybe in a
coincidental way and 2) work towards making the non-MT absolute events
a purely legacy single finger fallback mode, without breaking anything.

Comments

Dmitry Torokhov Dec. 20, 2012, 12:37 a.m. UTC | #1
On Thu, Dec 20, 2012 at 12:09:45AM +0100, Christophe TORDEUX wrote:
> From: Christophe TORDEUX <christophe@tordeux.net>
> 
> Apply the following change to the Sentelic touchpad driver:
> report only the position of the first finger as absolute non-MT 
> coordinates, instead of reporting both fingers alternatively. Actual MT 
> events are unaffected.
> 
> Signed-off-by: Christophe TORDEUX <christophe@tordeux.net>
> ----
> 
> This is a much simpler version of my patch. Basically, it makes little 
> sense to report both fingers alternatively, as long as it's non-MT 
> events. With this approach, storing coordinates of the previously 
> reported touch is not necessary. This patch is against kernel version 
> 3.7. Works with a touchpad version STL3888_C0, very probably works on 
> all later version, and very probably does not impact any earlier 
> version. This patch has two effects:
> 1) fix horizontal and improve vertical scrolling, though maybe in a
> coincidental way and 2) work towards making the non-MT absolute events
> a purely legacy single finger fallback mode, without breaking anything.

OK, this makes a lot of sense and I will be applying this; thanks!

> 
> diff -uprN -X vanilla/linux-3.7-rc8/Documentation/dontdiff vanilla/linux-3.7/drivers/input/mouse/sentelic.c linux-3.7/drivers/input/mouse/sentelic.c
> --- vanilla/linux-3.7/drivers/input/mouse/sentelic.c	2012-12-15 13:51:58.768136524 +0100
> +++ linux-3.7/drivers/input/mouse/sentelic.c	2012-12-19 23:26:49.289517251 +0100
> @@ -791,7 +791,7 @@ static psmouse_ret_t fsp_process_byte(st
>  			fsp_set_slot(dev, 0, fgrs > 0, abs_x, abs_y);
>  			fsp_set_slot(dev, 1, false, 0, 0);
>  		}
> -		if (fgrs > 0) {
> +		if (fgrs ==1 || (fgrs == 2 && !(packet[0] & FSP_PB0_MFMC_FGR2))) {
>  			input_report_abs(dev, ABS_X, abs_x);
>  			input_report_abs(dev, ABS_Y, abs_y);
>  		}
diff mbox

Patch

diff -uprN -X vanilla/linux-3.7-rc8/Documentation/dontdiff vanilla/linux-3.7/drivers/input/mouse/sentelic.c linux-3.7/drivers/input/mouse/sentelic.c
--- vanilla/linux-3.7/drivers/input/mouse/sentelic.c	2012-12-15 13:51:58.768136524 +0100
+++ linux-3.7/drivers/input/mouse/sentelic.c	2012-12-19 23:26:49.289517251 +0100
@@ -791,7 +791,7 @@  static psmouse_ret_t fsp_process_byte(st
 			fsp_set_slot(dev, 0, fgrs > 0, abs_x, abs_y);
 			fsp_set_slot(dev, 1, false, 0, 0);
 		}
-		if (fgrs > 0) {
+		if (fgrs ==1 || (fgrs == 2 && !(packet[0] & FSP_PB0_MFMC_FGR2))) {
 			input_report_abs(dev, ABS_X, abs_x);
 			input_report_abs(dev, ABS_Y, abs_y);
 		}