aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input/mouse/synaptics.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2013-02-20 11:00:43 -0800
committerLinus Torvalds <torvalds@linux-foundation.org>2013-02-20 11:00:43 -0800
commitc6699b58f4fe2f968f036a862c09ce44b6968376 (patch)
treed26743fa88966c2bdfd35ba723e3631f08a1f5fc /drivers/input/mouse/synaptics.c
parentMerge tag 'for-v3.9' of git://git.infradead.org/battery-2.6 (diff)
parentMerge branch 'next' into for-linus (diff)
downloadlinux-dev-c6699b58f4fe2f968f036a862c09ce44b6968376.tar.xz
linux-dev-c6699b58f4fe2f968f036a862c09ce44b6968376.zip
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input
Pull input updates from Dmitry Torokhov: "Two new touchpad drivers - Cypress APA I2C Trackpad and Cypress PS/2 touchpad and a big update to ALPS driver from Kevin Cernekee that adds support for "Rushmore" touchpads and paves way for adding support for "Dolphin" touchpads. There is also a new input driver for Goldfish emulator and also Android keyreset driver was folded into SysRq code. A few more drivers were updated with device tree bindings and others got some small cleanups and fixes." * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input: (55 commits) Input: cyttsp-spi - remove duplicate MODULE_ALIAS() Input: tsc2005 - add MODULE_ALIAS Input: tegra-kbc - require CONFIG_OF, remove platform data Input: synaptics - initialize pointer emulation usage Input: MT - do not apply filtering on emulated events Input: bma150 - make some defines public and fix some comments Input: bma150 - fix checking pm_runtime_get_sync() return value Input: ALPS - enable trackstick on Rushmore touchpads Input: ALPS - add support for "Rushmore" touchpads Input: ALPS - make the V3 packet field decoder "pluggable" Input: ALPS - move pixel and bitmap info into alps_data struct Input: ALPS - fix command mode check Input: ALPS - rework detection of Pinnacle AGx touchpads Input: ALPS - move {addr,nibble}_command settings into alps_set_defaults() Input: ALPS - use function pointers for different protocol handlers Input: ALPS - rework detection sequence Input: ALPS - introduce helper function for repeated commands Input: ALPS - move alps_get_model() down below hw_init code Input: ALPS - copy "model" info into alps_data struct Input: ALPS - document the alps.h data structures ...
Diffstat (limited to 'drivers/input/mouse/synaptics.c')
-rw-r--r--drivers/input/mouse/synaptics.c32
1 files changed, 28 insertions, 4 deletions
diff --git a/drivers/input/mouse/synaptics.c b/drivers/input/mouse/synaptics.c
index 12d12ca3fee0..2f78538e09d0 100644
--- a/drivers/input/mouse/synaptics.c
+++ b/drivers/input/mouse/synaptics.c
@@ -722,11 +722,13 @@ static void synaptics_report_mt_data(struct psmouse *psmouse,
default:
/*
* If the finger slot contained in SGM is valid, and either
- * hasn't changed, or is new, then report SGM in MTB slot 0.
+ * hasn't changed, or is new, or the old SGM has now moved to
+ * AGM, then report SGM in MTB slot 0.
* Otherwise, empty MTB slot 0.
*/
if (mt_state->sgm != -1 &&
- (mt_state->sgm == old->sgm || old->sgm == -1))
+ (mt_state->sgm == old->sgm ||
+ old->sgm == -1 || mt_state->agm == old->sgm))
synaptics_report_slot(dev, 0, sgm);
else
synaptics_report_slot(dev, 0, NULL);
@@ -735,9 +737,31 @@ static void synaptics_report_mt_data(struct psmouse *psmouse,
* If the finger slot contained in AGM is valid, and either
* hasn't changed, or is new, then report AGM in MTB slot 1.
* Otherwise, empty MTB slot 1.
+ *
+ * However, in the case where the AGM is new, make sure that
+ * that it is either the same as the old SGM, or there was no
+ * SGM.
+ *
+ * Otherwise, if the SGM was just 1, and the new AGM is 2, then
+ * the new AGM will keep the old SGM's tracking ID, which can
+ * cause apparent drumroll. This happens if in the following
+ * valid finger sequence:
+ *
+ * Action SGM AGM (MTB slot:Contact)
+ * 1. Touch contact 0 (0:0)
+ * 2. Touch contact 1 (0:0, 1:1)
+ * 3. Lift contact 0 (1:1)
+ * 4. Touch contacts 2,3 (0:2, 1:3)
+ *
+ * In step 4, contact 3, in AGM must not be given the same
+ * tracking ID as contact 1 had in step 3. To avoid this,
+ * the first agm with contact 3 is dropped and slot 1 is
+ * invalidated (tracking ID = -1).
*/
if (mt_state->agm != -1 &&
- (mt_state->agm == old->agm || old->agm == -1))
+ (mt_state->agm == old->agm ||
+ (old->agm == -1 &&
+ (old->sgm == -1 || mt_state->agm == old->sgm))))
synaptics_report_slot(dev, 1, agm);
else
synaptics_report_slot(dev, 1, NULL);
@@ -1247,11 +1271,11 @@ static void set_input_params(struct input_dev *dev, struct synaptics_data *priv)
input_set_abs_params(dev, ABS_PRESSURE, 0, 255, 0, 0);
if (SYN_CAP_IMAGE_SENSOR(priv->ext_cap_0c)) {
- input_mt_init_slots(dev, 2, 0);
set_abs_position_params(dev, priv, ABS_MT_POSITION_X,
ABS_MT_POSITION_Y);
/* Image sensors can report per-contact pressure */
input_set_abs_params(dev, ABS_MT_PRESSURE, 0, 255, 0, 0);
+ input_mt_init_slots(dev, 2, INPUT_MT_POINTER);
/* Image sensors can signal 4 and 5 finger clicks */
__set_bit(BTN_TOOL_QUADTAP, dev->keybit);