All of lore.kernel.org
 help / color / mirror / Atom feed
From: djkurtz@chromium.org
To: dmitry.torokhov@gmail.com, rydberg@euromail.se,
	chase.douglas@canonical.com, rubini@cvml.unipv.it
Cc: linux-input@vger.kernel.org, linux-kernel@vger.kernel.org,
	derek.foreman@collabora.co.uk, daniel.stone@collabora.co.uk,
	olofj@chromium.org, Daniel Kurtz <djkurtz@chromium.org>
Subject: [PATCH 12/12] Input: synaptics - process finger (<=5) transitions
Date: Wed, 29 Jun 2011 13:07:22 +0800	[thread overview]
Message-ID: <1309324042-22943-13-git-send-email-djkurtz@chromium.org> (raw)
In-Reply-To: <1309324042-22943-1-git-send-email-djkurtz@chromium.org>

From: Daniel Kurtz <djkurtz@chromium.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@chromium.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


      parent reply	other threads:[~2011-06-29  5:09 UTC|newest]

Thread overview: 89+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-29  5:07 [PATCH 00/12] Synaptics image sensor support djkurtz
2011-06-29  5:07 ` [PATCH 01/12] Input: synaptics - cleanup 0x0c query documentation djkurtz
2011-07-05 17:33   ` Chase Douglas
2011-07-06 13:50     ` Daniel Kurtz
2011-07-06 13:50       ` Daniel Kurtz
2011-07-07  6:30   ` Dmitry Torokhov
2011-06-29  5:07 ` [PATCH 02/12] Input: synaptics - do not invert y if 0 djkurtz
2011-07-04 21:08   ` Henrik Rydberg
2011-07-05  4:29     ` Daniel Kurtz
2011-07-05 18:07       ` Henrik Rydberg
2011-07-05 18:39         ` Chris Bagwell
2011-07-05 23:02         ` Daniel Kurtz
2011-07-05 17:42   ` Chase Douglas
2011-07-05 22:50     ` Daniel Kurtz
2011-07-05 22:50       ` Daniel Kurtz
2011-07-05 23:06       ` Chase Douglas
2011-07-05 23:15         ` Daniel Kurtz
2011-07-05 23:15           ` Daniel Kurtz
2011-07-05 23:25           ` Dmitry Torokhov
2011-07-05 23:25             ` Dmitry Torokhov
2011-06-29  5:07 ` [PATCH 03/12] Input: synaptics - fix minimum reported ABS_TOOL_WIDTH djkurtz
2011-06-29 13:28   ` Chris Bagwell
2011-06-29 13:28     ` Chris Bagwell
2011-06-29 16:48     ` Daniel Kurtz
2011-06-29 16:48       ` Daniel Kurtz
2011-06-29 19:46       ` Chris Bagwell
2011-06-29 19:46         ` Chris Bagwell
2011-07-04 21:14         ` Henrik Rydberg
2011-07-04 21:14           ` Henrik Rydberg
2011-07-09  6:24   ` Jeffrey Brown
2011-07-09  6:24     ` Jeffrey Brown
2011-06-29  5:07 ` [PATCH 04/12] Input: synaptics - set resolution for MT_POSITION_X/Y axes djkurtz
2011-07-05 17:44   ` Chase Douglas
2011-07-07  6:23     ` Dmitry Torokhov
2011-06-29  5:07 ` [PATCH 05/12] Input: synaptics - process button bits in AGM packets djkurtz
2011-07-04 21:24   ` Henrik Rydberg
2011-07-05  4:38     ` Daniel Kurtz
2011-07-05  4:38       ` Daniel Kurtz
2011-07-05 18:18       ` Henrik Rydberg
2011-07-05 18:19         ` Chase Douglas
2011-07-05 17:47   ` Chase Douglas
2011-07-07  6:24     ` Dmitry Torokhov
2011-06-29  5:07 ` [PATCH 06/12] Input: synaptics - fuzz position if touchpad reports reduced filtering djkurtz
2011-07-05 17:49   ` Chase Douglas
2011-07-07  6:25     ` Dmitry Torokhov
2011-06-29  5:07 ` [PATCH 07/12] Input: synaptics - rename synaptics_data.mt to agm djkurtz
2011-07-04 21:26   ` Henrik Rydberg
2011-07-05  4:39     ` Daniel Kurtz
2011-07-05  4:39       ` Daniel Kurtz
2011-07-05 18:20       ` Henrik Rydberg
2011-07-05 17:53   ` Chase Douglas
2011-06-29  5:07 ` [PATCH 08/12] Input: synaptics - rename set_slot to be more descriptive djkurtz
2011-07-05 17:54   ` Chase Douglas
2011-07-07  6:27     ` Dmitry Torokhov
2011-06-29  5:07 ` [PATCH 09/12] Input: synaptics - add image sensor support djkurtz
2011-07-04 21:42   ` Henrik Rydberg
2011-07-05  5:08     ` Daniel Kurtz
2011-07-05  5:08       ` Daniel Kurtz
2011-07-05 19:27       ` Henrik Rydberg
2011-07-05 19:27         ` Henrik Rydberg
2011-07-06 16:41         ` Daniel Kurtz
2011-07-06 16:41           ` Daniel Kurtz
2011-07-06 17:08           ` Chase Douglas
2011-07-06 17:45           ` Dmitry Torokhov
2011-07-06 17:45             ` Dmitry Torokhov
2011-07-06 18:47             ` Henrik Rydberg
2011-07-06 18:58               ` Dmitry Torokhov
2011-07-06 19:31                 ` Henrik Rydberg
2011-07-06 20:00                   ` Dmitry Torokhov
2011-07-06 20:20                     ` Henrik Rydberg
2011-07-06 21:22                       ` Chase Douglas
2011-07-06 21:36                         ` Dmitry Torokhov
2011-07-06 22:16                           ` Chase Douglas
2011-07-06 22:35                             ` Henrik Rydberg
2011-07-06 23:30                               ` Chase Douglas
2011-06-29  5:07 ` [PATCH 10/12] Input: synaptics - decode AGM packet types djkurtz
2011-06-29 10:02   ` Chase Douglas
2011-06-29 10:07     ` Daniel Stone
2011-06-29 10:32       ` Chase Douglas
2011-06-29 11:26         ` Daniel Kurtz
2011-06-29 11:26           ` Daniel Kurtz
2011-06-29 11:04     ` Daniel Kurtz
2011-07-05 18:17   ` Chase Douglas
2011-07-05 18:55     ` Chris Bagwell
2011-07-05 18:55       ` Chris Bagwell
2011-07-06 16:53       ` Daniel Kurtz
2011-07-06 16:53         ` Daniel Kurtz
2011-06-29  5:07 ` [PATCH 11/12] Input: synaptics - process finger (<=3) transitions djkurtz
2011-06-29  5:07 ` djkurtz [this message]

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=1309324042-22943-13-git-send-email-djkurtz@chromium.org \
    --to=djkurtz@chromium.org \
    --cc=chase.douglas@canonical.com \
    --cc=daniel.stone@collabora.co.uk \
    --cc=derek.foreman@collabora.co.uk \
    --cc=dmitry.torokhov@gmail.com \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=olofj@chromium.org \
    --cc=rubini@cvml.unipv.it \
    --cc=rydberg@euromail.se \
    /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.