aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input/mouse/synaptics.h
diff options
context:
space:
mode:
authorDaniel Kurtz <djkurtz@chromium.org>2011-08-24 02:02:31 -0400
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2011-08-24 02:08:16 -0400
commita6ca40c11eb5d98e53176adf527e430f7037a8c9 (patch)
tree74d08548873d3b6a9d58c8f0728025881d818b58 /drivers/input/mouse/synaptics.h
parent3cdfee9ea7e98eb6e8c3d4d66f2dfcfffe6afc4d (diff)
Input: synaptics - decode AGM packet types
A Synaptics image sensor tracks 5 fingers, but can only report 2. The algorithm for choosing which 2 fingers to report and in which packet: Touchpad maintains 5 slots, numbered 0 to 4 Initially all slots are empty As new fingers are detected, assign them to the lowest available slots The touchpad always reports: SGM: lowest numbered non-empty slot AGM: highest numbered non-empty slot, if there is one In addition, these touchpads have a special AGM packet type which reports the number of fingers currently being tracked, and which finger is in each of the two slots. Unfortunately, these "TYPE=2" packets are only used when more than 3 fingers are being tracked. When less than 4 fingers are present, the 'w' value must be used to track how many fingers are present, and knowing which fingers are being reported is much more difficult, if not impossible. Signed-off-by: Daniel Kurtz <djkurtz@chromium.org> Acked-by: Chase Douglas <chase.douglas@canonical.com> Acked-by: Henrik Rydberg <rydberg@euromail.se> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Diffstat (limited to 'drivers/input/mouse/synaptics.h')
-rw-r--r--drivers/input/mouse/synaptics.h14
1 files changed, 13 insertions, 1 deletions
diff --git a/drivers/input/mouse/synaptics.h b/drivers/input/mouse/synaptics.h
index 0ea7616e8fe1..20f57dfebed1 100644
--- a/drivers/input/mouse/synaptics.h
+++ b/drivers/input/mouse/synaptics.h
@@ -115,9 +115,18 @@
115#define SYN_REDUCED_FILTER_FUZZ 8 115#define SYN_REDUCED_FILTER_FUZZ 8
116 116
117/* 117/*
118 * A structure to describe the state of the touchpad hardware (buttons and pad) 118 * A structure to describe which internal touchpad finger slots are being
119 * reported in raw packets.
119 */ 120 */
121struct synaptics_mt_state {
122 int count; /* num fingers being tracked */
123 int sgm; /* which slot is reported by sgm pkt */
124 int agm; /* which slot is reported by agm pkt*/
125};
120 126
127/*
128 * A structure to describe the state of the touchpad hardware (buttons and pad)
129 */
121struct synaptics_hw_state { 130struct synaptics_hw_state {
122 int x; 131 int x;
123 int y; 132 int y;
@@ -130,6 +139,9 @@ struct synaptics_hw_state {
130 unsigned int down:1; 139 unsigned int down:1;
131 unsigned char ext_buttons; 140 unsigned char ext_buttons;
132 signed char scroll; 141 signed char scroll;
142
143 /* As reported in last AGM-CONTACT packets */
144 struct synaptics_mt_state mt_state;
133}; 145};
134 146
135struct synaptics_data { 147struct synaptics_data {