aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-rw-r--r--drivers/input/mouse/alps.c13
-rw-r--r--drivers/input/mouse/elantech.c22
-rw-r--r--drivers/input/mouse/elantech.h1
3 files changed, 34 insertions, 2 deletions
diff --git a/drivers/input/mouse/alps.c b/drivers/input/mouse/alps.c
index 15d6bffdea77..e6708f6efb4d 100644
--- a/drivers/input/mouse/alps.c
+++ b/drivers/input/mouse/alps.c
@@ -251,6 +251,14 @@ static void alps_process_packet_v1_v2(struct psmouse *psmouse)
251 return; 251 return;
252 } 252 }
253 253
254 /* Non interleaved V2 dualpoint has separate stick button bits */
255 if (priv->proto_version == ALPS_PROTO_V2 &&
256 priv->flags == (ALPS_PASS | ALPS_DUALPOINT)) {
257 left |= packet[0] & 1;
258 right |= packet[0] & 2;
259 middle |= packet[0] & 4;
260 }
261
254 alps_report_buttons(dev, dev2, left, right, middle); 262 alps_report_buttons(dev, dev2, left, right, middle);
255 263
256 /* Convert hardware tap to a reasonable Z value */ 264 /* Convert hardware tap to a reasonable Z value */
@@ -1337,13 +1345,14 @@ static void alps_report_bare_ps2_packet(struct psmouse *psmouse,
1337 bool report_buttons) 1345 bool report_buttons)
1338{ 1346{
1339 struct alps_data *priv = psmouse->private; 1347 struct alps_data *priv = psmouse->private;
1340 struct input_dev *dev; 1348 struct input_dev *dev, *dev2 = NULL;
1341 1349
1342 /* Figure out which device to use to report the bare packet */ 1350 /* Figure out which device to use to report the bare packet */
1343 if (priv->proto_version == ALPS_PROTO_V2 && 1351 if (priv->proto_version == ALPS_PROTO_V2 &&
1344 (priv->flags & ALPS_DUALPOINT)) { 1352 (priv->flags & ALPS_DUALPOINT)) {
1345 /* On V2 devices the DualPoint Stick reports bare packets */ 1353 /* On V2 devices the DualPoint Stick reports bare packets */
1346 dev = priv->dev2; 1354 dev = priv->dev2;
1355 dev2 = psmouse->dev;
1347 } else if (unlikely(IS_ERR_OR_NULL(priv->dev3))) { 1356 } else if (unlikely(IS_ERR_OR_NULL(priv->dev3))) {
1348 /* Register dev3 mouse if we received PS/2 packet first time */ 1357 /* Register dev3 mouse if we received PS/2 packet first time */
1349 if (!IS_ERR(priv->dev3)) 1358 if (!IS_ERR(priv->dev3))
@@ -1355,7 +1364,7 @@ static void alps_report_bare_ps2_packet(struct psmouse *psmouse,
1355 } 1364 }
1356 1365
1357 if (report_buttons) 1366 if (report_buttons)
1358 alps_report_buttons(dev, NULL, 1367 alps_report_buttons(dev, dev2,
1359 packet[0] & 1, packet[0] & 2, packet[0] & 4); 1368 packet[0] & 1, packet[0] & 2, packet[0] & 4);
1360 1369
1361 input_report_rel(dev, REL_X, 1370 input_report_rel(dev, REL_X,
diff --git a/drivers/input/mouse/elantech.c b/drivers/input/mouse/elantech.c
index 6e22682c8255..991dc6b20a58 100644
--- a/drivers/input/mouse/elantech.c
+++ b/drivers/input/mouse/elantech.c
@@ -893,6 +893,21 @@ static psmouse_ret_t elantech_process_byte(struct psmouse *psmouse)
893} 893}
894 894
895/* 895/*
896 * This writes the reg_07 value again to the hardware at the end of every
897 * set_rate call because the register loses its value. reg_07 allows setting
898 * absolute mode on v4 hardware
899 */
900static void elantech_set_rate_restore_reg_07(struct psmouse *psmouse,
901 unsigned int rate)
902{
903 struct elantech_data *etd = psmouse->private;
904
905 etd->original_set_rate(psmouse, rate);
906 if (elantech_write_reg(psmouse, 0x07, etd->reg_07))
907 psmouse_err(psmouse, "restoring reg_07 failed\n");
908}
909
910/*
896 * Put the touchpad into absolute mode 911 * Put the touchpad into absolute mode
897 */ 912 */
898static int elantech_set_absolute_mode(struct psmouse *psmouse) 913static int elantech_set_absolute_mode(struct psmouse *psmouse)
@@ -1094,6 +1109,8 @@ static int elantech_get_resolution_v4(struct psmouse *psmouse,
1094 * Asus K53SV 0x450f01 78, 15, 0c 2 hw buttons 1109 * Asus K53SV 0x450f01 78, 15, 0c 2 hw buttons
1095 * Asus G46VW 0x460f02 00, 18, 0c 2 hw buttons 1110 * Asus G46VW 0x460f02 00, 18, 0c 2 hw buttons
1096 * Asus G750JX 0x360f00 00, 16, 0c 2 hw buttons 1111 * Asus G750JX 0x360f00 00, 16, 0c 2 hw buttons
1112 * Asus TP500LN 0x381f17 10, 14, 0e clickpad
1113 * Asus X750JN 0x381f17 10, 14, 0e clickpad
1097 * Asus UX31 0x361f00 20, 15, 0e clickpad 1114 * Asus UX31 0x361f00 20, 15, 0e clickpad
1098 * Asus UX32VD 0x361f02 00, 15, 0e clickpad 1115 * Asus UX32VD 0x361f02 00, 15, 0e clickpad
1099 * Avatar AVIU-145A2 0x361f00 ? clickpad 1116 * Avatar AVIU-145A2 0x361f00 ? clickpad
@@ -1635,6 +1652,11 @@ int elantech_init(struct psmouse *psmouse)
1635 goto init_fail; 1652 goto init_fail;
1636 } 1653 }
1637 1654
1655 if (etd->fw_version == 0x381f17) {
1656 etd->original_set_rate = psmouse->set_rate;
1657 psmouse->set_rate = elantech_set_rate_restore_reg_07;
1658 }
1659
1638 if (elantech_set_input_params(psmouse)) { 1660 if (elantech_set_input_params(psmouse)) {
1639 psmouse_err(psmouse, "failed to query touchpad range.\n"); 1661 psmouse_err(psmouse, "failed to query touchpad range.\n");
1640 goto init_fail; 1662 goto init_fail;
diff --git a/drivers/input/mouse/elantech.h b/drivers/input/mouse/elantech.h
index 6f3afec02f03..f965d1569cc3 100644
--- a/drivers/input/mouse/elantech.h
+++ b/drivers/input/mouse/elantech.h
@@ -142,6 +142,7 @@ struct elantech_data {
142 struct finger_pos mt[ETP_MAX_FINGERS]; 142 struct finger_pos mt[ETP_MAX_FINGERS];
143 unsigned char parity[256]; 143 unsigned char parity[256];
144 int (*send_cmd)(struct psmouse *psmouse, unsigned char c, unsigned char *param); 144 int (*send_cmd)(struct psmouse *psmouse, unsigned char c, unsigned char *param);
145 void (*original_set_rate)(struct psmouse *psmouse, unsigned int rate);
145}; 146};
146 147
147#ifdef CONFIG_MOUSE_PS2_ELANTECH 148#ifdef CONFIG_MOUSE_PS2_ELANTECH