lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1309324042-22943-13-git-send-email-djkurtz@chromium.org>
Date:	Wed, 29 Jun 2011 13:07:22 +0800
From:	djkurtz@...omium.org
To:	dmitry.torokhov@...il.com, rydberg@...omail.se,
	chase.douglas@...onical.com, rubini@...l.unipv.it
Cc:	linux-input@...r.kernel.org, linux-kernel@...r.kernel.org,
	derek.foreman@...labora.co.uk, daniel.stone@...labora.co.uk,
	olofj@...omium.org, Daniel Kurtz <djkurtz@...omium.org>
Subject: [PATCH 12/12] Input: synaptics - process finger (<=5) transitions

From: Daniel Kurtz <djkurtz@...omium.org>

T5R2 touchpads track up to 5 fingers, but only report 2.
They introduce a special "TYPE=2" (AGM-CONTACT) packet type that reports
the number of tracked fingers and which finger is reported in the SGM
and AGM packets.

With this new packet type, it is possible to send up to 5 MTB slots to
userspace.

Signed-off-by: Daniel Kurtz <djkurtz@...omium.org>
---
 drivers/input/mouse/synaptics.c |   33 +++++++++++++++++++++++++++++++--
 1 files changed, 31 insertions(+), 2 deletions(-)

diff --git a/drivers/input/mouse/synaptics.c b/drivers/input/mouse/synaptics.c
index 8b38e08..5f227be 100644
--- a/drivers/input/mouse/synaptics.c
+++ b/drivers/input/mouse/synaptics.c
@@ -647,11 +647,16 @@ static void synaptics_process_hw_state(struct synaptics_data *priv,
 		new_num_fingers = 1;
 	else if (sgm->w == 0)
 		new_num_fingers = 2;
-	else if (sgm->w == 1)
-		new_num_fingers = 3;
+	else if (sgm->w == 1) {
+		if (agm->finger_count > 3)
+			new_num_fingers = agm->finger_count;
+		else
+			new_num_fingers = 3;
+	}
 
 	if (new_num_fingers == 0) {
 		synaptics_update_slots(priv, 0, 0, 0);
+		synaptics_agm_finger_update(priv, 0, 0, 0);
 		goto process_mt_data_done;
 	}
 
@@ -661,6 +666,7 @@ static void synaptics_process_hw_state(struct synaptics_data *priv,
 	 */
 	if (priv->agm_pending && agm->z == 0) {
 		synaptics_update_slots(priv, 1, 0, 0);
+		synaptics_agm_finger_update(priv, 0, 0, 0);
 		goto process_mt_data_done;
 	}
 
@@ -720,6 +726,11 @@ static void synaptics_process_hw_state(struct synaptics_data *priv,
 			 */
 			synaptics_update_slots(priv, 0, 0, 0);
 			break;
+
+		case 4:
+		case 5:
+			synaptics_update_slots(priv, 1, agm->finger_sgm, 0);
+			break;
 		}
 		break;
 
@@ -761,6 +772,12 @@ static void synaptics_process_hw_state(struct synaptics_data *priv,
 			 */
 			synaptics_update_slots(priv, 0, 0, 0);
 			break;
+
+		case 4:
+		case 5:
+			synaptics_update_slots(priv, 2, agm->finger_sgm,
+					       agm->finger_agm);
+			break;
 		}
 		break;
 
@@ -800,8 +817,20 @@ static void synaptics_process_hw_state(struct synaptics_data *priv,
 				slot_agm = slot_sgm + 2;
 			synaptics_update_slots(priv, 3, slot_sgm, slot_agm);
 			break;
+
+		case 4:
+		case 5:
+			synaptics_update_slots(priv, 3, agm->finger_sgm,
+					       agm->finger_agm);
+			break;
 		}
 		break;
+
+	case 4:
+	case 5:
+		synaptics_update_slots(priv, agm->finger_count, agm->finger_sgm,
+				       agm->finger_agm);
+		break;
 	}
 
 process_mt_data_done:
-- 
1.7.3.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ