aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input/mouse/elantech.c
diff options
context:
space:
mode:
authorJames Morris <james.l.morris@oracle.com>2012-05-03 22:46:40 -0400
committerJames Morris <james.l.morris@oracle.com>2012-05-03 22:46:40 -0400
commit898bfc1d46bd76f8ea2a0fbd239dd2073efe2aa3 (patch)
treee6e666085abe674dbf6292555961fe0a0f2e2d2f /drivers/input/mouse/elantech.c
parent08162e6a23d476544adfe1164afe9ea8b34ab859 (diff)
parent69964ea4c7b68c9399f7977aa5b9aa6539a6a98a (diff)
Merge tag 'v3.4-rc5' into next
Linux 3.4-rc5 Merge to pull in prerequisite change for Smack: 86812bb0de1a3758dc6c7aa01a763158a7c0638a Requested by Casey.
Diffstat (limited to 'drivers/input/mouse/elantech.c')
-rw-r--r--drivers/input/mouse/elantech.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/drivers/input/mouse/elantech.c b/drivers/input/mouse/elantech.c
index d2c0db159b1..479011004a1 100644
--- a/drivers/input/mouse/elantech.c
+++ b/drivers/input/mouse/elantech.c
@@ -486,7 +486,6 @@ static void elantech_input_sync_v4(struct psmouse *psmouse)
486 unsigned char *packet = psmouse->packet; 486 unsigned char *packet = psmouse->packet;
487 487
488 input_report_key(dev, BTN_LEFT, packet[0] & 0x01); 488 input_report_key(dev, BTN_LEFT, packet[0] & 0x01);
489 input_report_key(dev, BTN_RIGHT, packet[0] & 0x02);
490 input_mt_report_pointer_emulation(dev, true); 489 input_mt_report_pointer_emulation(dev, true);
491 input_sync(dev); 490 input_sync(dev);
492} 491}
@@ -967,6 +966,7 @@ static int elantech_set_input_params(struct psmouse *psmouse)
967 if (elantech_set_range(psmouse, &x_min, &y_min, &x_max, &y_max, &width)) 966 if (elantech_set_range(psmouse, &x_min, &y_min, &x_max, &y_max, &width))
968 return -1; 967 return -1;
969 968
969 __set_bit(INPUT_PROP_POINTER, dev->propbit);
970 __set_bit(EV_KEY, dev->evbit); 970 __set_bit(EV_KEY, dev->evbit);
971 __set_bit(EV_ABS, dev->evbit); 971 __set_bit(EV_ABS, dev->evbit);
972 __clear_bit(EV_REL, dev->evbit); 972 __clear_bit(EV_REL, dev->evbit);
@@ -1017,7 +1017,9 @@ static int elantech_set_input_params(struct psmouse *psmouse)
1017 */ 1017 */
1018 psmouse_warn(psmouse, "couldn't query resolution data.\n"); 1018 psmouse_warn(psmouse, "couldn't query resolution data.\n");
1019 } 1019 }
1020 1020 /* v4 is clickpad, with only one button. */
1021 __set_bit(INPUT_PROP_BUTTONPAD, dev->propbit);
1022 __clear_bit(BTN_RIGHT, dev->keybit);
1021 __set_bit(BTN_TOOL_QUADTAP, dev->keybit); 1023 __set_bit(BTN_TOOL_QUADTAP, dev->keybit);
1022 /* For X to recognize me as touchpad. */ 1024 /* For X to recognize me as touchpad. */
1023 input_set_abs_params(dev, ABS_X, x_min, x_max, 0, 0); 1025 input_set_abs_params(dev, ABS_X, x_min, x_max, 0, 0);
@@ -1245,6 +1247,8 @@ static void elantech_disconnect(struct psmouse *psmouse)
1245 */ 1247 */
1246static int elantech_reconnect(struct psmouse *psmouse) 1248static int elantech_reconnect(struct psmouse *psmouse)
1247{ 1249{
1250 psmouse_reset(psmouse);
1251
1248 if (elantech_detect(psmouse, 0)) 1252 if (elantech_detect(psmouse, 0))
1249 return -1; 1253 return -1;
1250 1254
@@ -1324,6 +1328,8 @@ int elantech_init(struct psmouse *psmouse)
1324 if (!etd) 1328 if (!etd)
1325 return -ENOMEM; 1329 return -ENOMEM;
1326 1330
1331 psmouse_reset(psmouse);
1332
1327 etd->parity[0] = 1; 1333 etd->parity[0] = 1;
1328 for (i = 1; i < 256; i++) 1334 for (i = 1; i < 256; i++)
1329 etd->parity[i] = etd->parity[i & (i - 1)] ^ 1; 1335 etd->parity[i] = etd->parity[i & (i - 1)] ^ 1;