aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input/mouse
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2010-08-10 18:08:02 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2010-08-10 18:08:02 -0400
commit04f2b9765f1e80337314e03c4adde695fe2f0403 (patch)
treebde948d37c22eaf5e200dd9675543ea2b2e059c2 /drivers/input/mouse
parent9895850b23886e030cd1e7241d5529a57e969c3d (diff)
parent5fc0d36c00e6a2d0a9f2a0a815cff5b9a13b080d (diff)
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input: Input: xpad - add USB-ID for PL-3601 Xbox 360 pad Input: cy8ctmg100_ts - signedness bug Input: elantech - report position also with 3 fingers Input: elantech - discard the first 2 positions on some firmwares Input: adxl34x - do not mark device as disabled on startup Input: gpio_keys - add hooks to enable/disable device Input: evdev - rearrange ioctl handling Input: dynamically allocate ABS information Input: switch to input_abs_*() access functions Input: add static inline accessors for ABS properties
Diffstat (limited to 'drivers/input/mouse')
-rw-r--r--drivers/input/mouse/elantech.c31
-rw-r--r--drivers/input/mouse/elantech.h7
-rw-r--r--drivers/input/mouse/pc110pad.c4
-rw-r--r--drivers/input/mouse/synaptics.c4
4 files changed, 28 insertions, 18 deletions
diff --git a/drivers/input/mouse/elantech.c b/drivers/input/mouse/elantech.c
index b18862b2a70e..48311204ba51 100644
--- a/drivers/input/mouse/elantech.c
+++ b/drivers/input/mouse/elantech.c
@@ -185,7 +185,6 @@ static void elantech_report_absolute_v1(struct psmouse *psmouse)
185 struct elantech_data *etd = psmouse->private; 185 struct elantech_data *etd = psmouse->private;
186 unsigned char *packet = psmouse->packet; 186 unsigned char *packet = psmouse->packet;
187 int fingers; 187 int fingers;
188 static int old_fingers;
189 188
190 if (etd->fw_version < 0x020000) { 189 if (etd->fw_version < 0x020000) {
191 /* 190 /*
@@ -203,10 +202,13 @@ static void elantech_report_absolute_v1(struct psmouse *psmouse)
203 } 202 }
204 203
205 if (etd->jumpy_cursor) { 204 if (etd->jumpy_cursor) {
206 /* Discard packets that are likely to have bogus coordinates */ 205 if (fingers != 1) {
207 if (fingers > old_fingers) { 206 etd->single_finger_reports = 0;
207 } else if (etd->single_finger_reports < 2) {
208 /* Discard first 2 reports of one finger, bogus */
209 etd->single_finger_reports++;
208 elantech_debug("discarding packet\n"); 210 elantech_debug("discarding packet\n");
209 goto discard_packet_v1; 211 return;
210 } 212 }
211 } 213 }
212 214
@@ -238,9 +240,6 @@ static void elantech_report_absolute_v1(struct psmouse *psmouse)
238 } 240 }
239 241
240 input_sync(dev); 242 input_sync(dev);
241
242 discard_packet_v1:
243 old_fingers = fingers;
244} 243}
245 244
246/* 245/*
@@ -258,6 +257,14 @@ static void elantech_report_absolute_v2(struct psmouse *psmouse)
258 input_report_key(dev, BTN_TOUCH, fingers != 0); 257 input_report_key(dev, BTN_TOUCH, fingers != 0);
259 258
260 switch (fingers) { 259 switch (fingers) {
260 case 3:
261 /*
262 * Same as one finger, except report of more than 3 fingers:
263 * byte 3: n4 . w1 w0 . . . .
264 */
265 if (packet[3] & 0x80)
266 fingers = 4;
267 /* pass through... */
261 case 1: 268 case 1:
262 /* 269 /*
263 * byte 1: . . . . . x10 x9 x8 270 * byte 1: . . . . . x10 x9 x8
@@ -310,6 +317,7 @@ static void elantech_report_absolute_v2(struct psmouse *psmouse)
310 input_report_key(dev, BTN_TOOL_FINGER, fingers == 1); 317 input_report_key(dev, BTN_TOOL_FINGER, fingers == 1);
311 input_report_key(dev, BTN_TOOL_DOUBLETAP, fingers == 2); 318 input_report_key(dev, BTN_TOOL_DOUBLETAP, fingers == 2);
312 input_report_key(dev, BTN_TOOL_TRIPLETAP, fingers == 3); 319 input_report_key(dev, BTN_TOOL_TRIPLETAP, fingers == 3);
320 input_report_key(dev, BTN_TOOL_QUADTAP, fingers == 4);
313 input_report_key(dev, BTN_LEFT, packet[0] & 0x01); 321 input_report_key(dev, BTN_LEFT, packet[0] & 0x01);
314 input_report_key(dev, BTN_RIGHT, packet[0] & 0x02); 322 input_report_key(dev, BTN_RIGHT, packet[0] & 0x02);
315 323
@@ -467,6 +475,7 @@ static void elantech_set_input_params(struct psmouse *psmouse)
467 break; 475 break;
468 476
469 case 2: 477 case 2:
478 __set_bit(BTN_TOOL_QUADTAP, dev->keybit);
470 input_set_abs_params(dev, ABS_X, ETP_XMIN_V2, ETP_XMAX_V2, 0, 0); 479 input_set_abs_params(dev, ABS_X, ETP_XMIN_V2, ETP_XMAX_V2, 0, 0);
471 input_set_abs_params(dev, ABS_Y, ETP_YMIN_V2, ETP_YMAX_V2, 0, 0); 480 input_set_abs_params(dev, ABS_Y, ETP_YMIN_V2, ETP_YMAX_V2, 0, 0);
472 input_set_abs_params(dev, ABS_HAT0X, ETP_2FT_XMIN, ETP_2FT_XMAX, 0, 0); 481 input_set_abs_params(dev, ABS_HAT0X, ETP_2FT_XMIN, ETP_2FT_XMAX, 0, 0);
@@ -733,13 +742,13 @@ int elantech_init(struct psmouse *psmouse)
733 etd->capabilities = param[0]; 742 etd->capabilities = param[0];
734 743
735 /* 744 /*
736 * This firmware seems to suffer from misreporting coordinates when 745 * This firmware suffers from misreporting coordinates when
737 * a touch action starts causing the mouse cursor or scrolled page 746 * a touch action starts causing the mouse cursor or scrolled page
738 * to jump. Enable a workaround. 747 * to jump. Enable a workaround.
739 */ 748 */
740 if (etd->fw_version == 0x020022) { 749 if (etd->fw_version == 0x020022 || etd->fw_version == 0x020600) {
741 pr_info("firmware version 2.0.34 detected, enabling jumpy cursor workaround\n"); 750 pr_info("firmware version 2.0.34/2.6.0 detected, enabling jumpy cursor workaround\n");
742 etd->jumpy_cursor = 1; 751 etd->jumpy_cursor = true;
743 } 752 }
744 753
745 if (elantech_set_absolute_mode(psmouse)) { 754 if (elantech_set_absolute_mode(psmouse)) {
diff --git a/drivers/input/mouse/elantech.h b/drivers/input/mouse/elantech.h
index ac57bde1bb9f..aa4aac5d2198 100644
--- a/drivers/input/mouse/elantech.h
+++ b/drivers/input/mouse/elantech.h
@@ -100,10 +100,11 @@ struct elantech_data {
100 unsigned char reg_26; 100 unsigned char reg_26;
101 unsigned char debug; 101 unsigned char debug;
102 unsigned char capabilities; 102 unsigned char capabilities;
103 unsigned char paritycheck; 103 bool paritycheck;
104 unsigned char jumpy_cursor; 104 bool jumpy_cursor;
105 unsigned char hw_version; 105 unsigned char hw_version;
106 unsigned int fw_version; 106 unsigned int fw_version;
107 unsigned int single_finger_reports;
107 unsigned char parity[256]; 108 unsigned char parity[256];
108}; 109};
109 110
diff --git a/drivers/input/mouse/pc110pad.c b/drivers/input/mouse/pc110pad.c
index 3941f97cfa60..7b02b652e267 100644
--- a/drivers/input/mouse/pc110pad.c
+++ b/drivers/input/mouse/pc110pad.c
@@ -145,8 +145,8 @@ static int __init pc110pad_init(void)
145 pc110pad_dev->absbit[0] = BIT_MASK(ABS_X) | BIT_MASK(ABS_Y); 145 pc110pad_dev->absbit[0] = BIT_MASK(ABS_X) | BIT_MASK(ABS_Y);
146 pc110pad_dev->keybit[BIT_WORD(BTN_TOUCH)] = BIT_MASK(BTN_TOUCH); 146 pc110pad_dev->keybit[BIT_WORD(BTN_TOUCH)] = BIT_MASK(BTN_TOUCH);
147 147
148 pc110pad_dev->absmax[ABS_X] = 0x1ff; 148 input_abs_set_max(pc110pad_dev, ABS_X, 0x1ff);
149 pc110pad_dev->absmax[ABS_Y] = 0x0ff; 149 input_abs_set_max(pc110pad_dev, ABS_Y, 0x0ff);
150 150
151 pc110pad_dev->open = pc110pad_open; 151 pc110pad_dev->open = pc110pad_open;
152 pc110pad_dev->close = pc110pad_close; 152 pc110pad_dev->close = pc110pad_close;
diff --git a/drivers/input/mouse/synaptics.c b/drivers/input/mouse/synaptics.c
index 8c324403b9f2..96b70a43515f 100644
--- a/drivers/input/mouse/synaptics.c
+++ b/drivers/input/mouse/synaptics.c
@@ -635,8 +635,8 @@ static void set_input_params(struct input_dev *dev, struct synaptics_data *priv)
635 __clear_bit(REL_X, dev->relbit); 635 __clear_bit(REL_X, dev->relbit);
636 __clear_bit(REL_Y, dev->relbit); 636 __clear_bit(REL_Y, dev->relbit);
637 637
638 dev->absres[ABS_X] = priv->x_res; 638 input_abs_set_res(dev, ABS_X, priv->x_res);
639 dev->absres[ABS_Y] = priv->y_res; 639 input_abs_set_res(dev, ABS_Y, priv->y_res);
640 640
641 if (SYN_CAP_CLICKPAD(priv->ext_cap_0c)) { 641 if (SYN_CAP_CLICKPAD(priv->ext_cap_0c)) {
642 /* Clickpads report only left button */ 642 /* Clickpads report only left button */