/[linux-patches]/genpatches-2.6/tags/3.0-14/2620_Input-ALPS-Add-support-for-protocol-versions-3-and-4.patch
Gentoo

Diff of /genpatches-2.6/tags/3.0-14/2620_Input-ALPS-Add-support-for-protocol-versions-3-and-4.patch

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1982 Revision 1984
1From baf5955491da6d651054b32b7e43850a49c9c116 Mon Sep 17 00:00:00 2001 1From eb431563c721ef18736a36462e669062821702c5 Mon Sep 17 00:00:00 2001
2From: Seth Forshee <seth.forshee@canonical.com> 2From: Seth Forshee <seth.forshee@canonical.com>
3Date: Wed, 14 Sep 2011 11:40:39 -0500 3Date: Wed, 14 Sep 2011 11:40:39 -0500
4Subject: [PATCH 5/8] Input: ALPS - Add support for protocol versions 3 and 4 4Subject: [PATCH 5/8] Input: ALPS - Add support for protocol versions 3 and 4
5 5
6Currently only single-touch, multi-touch to be added in the future. 6Currently only single-touch, multi-touch to be added in the future.
7--- 7---
8 drivers/input/mouse/alps.c | 761 +++++++++++++++++++++++++++++++++++++++++--- 8 drivers/input/mouse/alps.c | 792 +++++++++++++++++++++++++++++++++++++++++---
9 drivers/input/mouse/alps.h | 11 + 9 drivers/input/mouse/alps.h | 14 +
10 2 files changed, 734 insertions(+), 38 deletions(-) 10 2 files changed, 768 insertions(+), 38 deletions(-)
11 11
12diff --git a/drivers/input/mouse/alps.c b/drivers/input/mouse/alps.c 12diff --git a/drivers/input/mouse/alps.c b/drivers/input/mouse/alps.c
13index 14d1f64..2615b92 100644 13index 14d1f64..43949d4 100644
14--- a/drivers/input/mouse/alps.c 14--- a/drivers/input/mouse/alps.c
15+++ b/drivers/input/mouse/alps.c 15+++ b/drivers/input/mouse/alps.c
16@@ -30,6 +30,50 @@ 16@@ -30,6 +30,50 @@
17 #define dbg(format, arg...) do {} while (0) 17 #define dbg(format, arg...) do {} while (0)
18 #endif 18 #endif
112- { { 0x52, 0x01, 0x14 }, ALPS_PROTO_V2, 0xff, 0xff, 112- { { 0x52, 0x01, 0x14 }, ALPS_PROTO_V2, 0xff, 0xff,
113- ALPS_PASS | ALPS_DUALPOINT | ALPS_PS2_INTERLEAVED }, /* Toshiba Tecra A11-11L */ 113- ALPS_PASS | ALPS_DUALPOINT | ALPS_PS2_INTERLEAVED }, /* Toshiba Tecra A11-11L */
114+ { { 0x73, 0x02, 0x50 }, 0x00, ALPS_PROTO_V2, 0xcf, 0xcf, ALPS_FOUR_BUTTONS }, /* Dell Vostro 1400 */ 114+ { { 0x73, 0x02, 0x50 }, 0x00, ALPS_PROTO_V2, 0xcf, 0xcf, ALPS_FOUR_BUTTONS }, /* Dell Vostro 1400 */
115+ { { 0x52, 0x01, 0x14 }, 0x00, ALPS_PROTO_V2, 0xff, 0xff, 115+ { { 0x52, 0x01, 0x14 }, 0x00, ALPS_PROTO_V2, 0xff, 0xff,
116+ ALPS_PASS | ALPS_DUALPOINT | ALPS_PS2_INTERLEAVED }, /* Toshiba Tecra A11-11L */ 116+ ALPS_PASS | ALPS_DUALPOINT | ALPS_PS2_INTERLEAVED }, /* Toshiba Tecra A11-11L */
117+ { { 0x73, 0x02, 0x64 }, 0x9b, ALPS_PROTO_V3, 0x8f, 0x8f, ALPS_DUALPOINT }, /* Ahtec Laptop */ 117+ { { 0x73, 0x02, 0x64 }, 0x9b, ALPS_PROTO_V3, 0x8f, 0x8f, ALPS_DUALPOINT },
118+ { { 0x73, 0x02, 0x64 }, 0x9d, ALPS_PROTO_V3, 0x8f, 0x8f, ALPS_DUALPOINT }, /* Ahtec Laptop */ 118+ { { 0x73, 0x02, 0x64 }, 0x9d, ALPS_PROTO_V3, 0x8f, 0x8f, ALPS_DUALPOINT },
119+ { { 0x73, 0x02, 0x64 }, 0x8a, ALPS_PROTO_V4, 0x8f, 0x8f, 0 }, /* Ahtec Laptop */ 119+ { { 0x73, 0x02, 0x64 }, 0x8a, ALPS_PROTO_V4, 0x8f, 0x8f, 0 },
120 }; 120 };
121 121
122 /* 122 /*
123@@ -108,7 +155,7 @@ static void alps_report_buttons(struct psmouse *psmouse, 123@@ -108,7 +155,7 @@ static void alps_report_buttons(struct psmouse *psmouse,
124 input_sync(dev2); 124 input_sync(dev2);
127-static void alps_process_packet(struct psmouse *psmouse) 127-static void alps_process_packet(struct psmouse *psmouse)
128+static void alps_process_packet_v1_v2(struct psmouse *psmouse) 128+static void alps_process_packet_v1_v2(struct psmouse *psmouse)
129 { 129 {
130 struct alps_data *priv = psmouse->private; 130 struct alps_data *priv = psmouse->private;
131 const struct alps_model_info *model = priv->i; 131 const struct alps_model_info *model = priv->i;
132@@ -210,6 +257,200 @@ static void alps_process_packet(struct psmouse *psmouse) 132@@ -210,6 +257,206 @@ static void alps_process_packet(struct psmouse *psmouse)
133 input_sync(dev); 133 input_sync(dev);
134 } 134 }
135 135
136+static void alps_process_trackstick_packet_v3(struct psmouse *psmouse) 136+static void alps_process_trackstick_packet_v3(struct psmouse *psmouse)
137+{ 137+{
154+ return; 154+ return;
155+ 155+
156+ x = (s8)(((packet[0] & 0x20) << 2) | (packet[1] & 0x7f)); 156+ x = (s8)(((packet[0] & 0x20) << 2) | (packet[1] & 0x7f));
157+ y = (s8)(((packet[0] & 0x10) << 3) | (packet[2] & 0x7f)); 157+ y = (s8)(((packet[0] & 0x10) << 3) | (packet[2] & 0x7f));
158+ z = (packet[4] & 0x7c) >> 2; 158+ z = (packet[4] & 0x7c) >> 2;
159+
160+ left = packet[3] & 0x01;
161+ right = packet[3] & 0x02;
162+ middle = packet[3] & 0x04;
163+ 159+
164+ /* 160+ /*
165+ * The x and y values tend to be quite large, and when used 161+ * The x and y values tend to be quite large, and when used
166+ * alone the trackstick is difficult to use. Scale them down 162+ * alone the trackstick is difficult to use. Scale them down
167+ * to compensate. 163+ * to compensate.
170+ y /= 8; 166+ y /= 8;
171+ 167+
172+ input_report_rel(dev, REL_X, x); 168+ input_report_rel(dev, REL_X, x);
173+ input_report_rel(dev, REL_Y, -y); 169+ input_report_rel(dev, REL_Y, -y);
174+ 170+
171+ if (priv->quirks & ALPS_QUIRK_TRACKSTICK_BUTTONS) {
172+ left = packet[3] & 0x01;
173+ right = packet[3] & 0x02;
174+ middle = packet[3] & 0x04;
175+
175+ input_report_key(dev, BTN_LEFT, left); 176+ input_report_key(dev, BTN_LEFT, left);
176+ input_report_key(dev, BTN_RIGHT, right); 177+ input_report_key(dev, BTN_RIGHT, right);
177+ input_report_key(dev, BTN_MIDDLE, middle); 178+ input_report_key(dev, BTN_MIDDLE, middle);
179+ }
178+ 180+
179+ input_sync(dev); 181+ input_sync(dev);
180+ return; 182+ return;
181+} 183+}
182+ 184+
183+static void alps_process_touchpad_packet_v3(struct psmouse *psmouse) 185+static void alps_process_touchpad_packet_v3(struct psmouse *psmouse)
184+{ 186+{
185+ struct alps_data *priv = psmouse->private; 187+ struct alps_data *priv = psmouse->private;
186+ unsigned char *packet = psmouse->packet; 188+ unsigned char *packet = psmouse->packet;
187+ struct input_dev *dev = psmouse->dev; 189+ struct input_dev *dev = psmouse->dev;
190+ struct input_dev *dev2 = priv->dev2;
188+ int x, y, z; 191+ int x, y, z;
189+ int left, right, middle; 192+ int left, right, middle;
190+ 193+
191+ /* 194+ /*
192+ * There's no single feature of touchpad position and bitmap 195+ * There's no single feature of touchpad position and bitmap
215+ if (!priv->multi_packet && (packet[4] & 0x40)) 218+ if (!priv->multi_packet && (packet[4] & 0x40))
216+ priv->multi_packet = 1; 219+ priv->multi_packet = 1;
217+ else 220+ else
218+ priv->multi_packet = 0; 221+ priv->multi_packet = 0;
219+ 222+
220+ /*
221+ * Bits in the upper nibble of byte 3 represent the trackstick
222+ * buttons on some models, but on other models the trackstick
223+ * buttons are reported in the trackstic packets. If we try to
224+ * report the buttons on the trackstick device from here it can
225+ * lead to conflicts, so we treat any buttons reported in the
226+ * touchpad packets as belonging to the touchpad.
227+ */
228+ left = packet[3] & 0x11; 223+ left = packet[3] & 0x01;
229+ right = packet[3] & 0x22; 224+ right = packet[3] & 0x02;
230+ middle = packet[3] & 0x44; 225+ middle = packet[3] & 0x04;
231+ 226+
232+ x = ((packet[1] & 0x7f) << 4) | ((packet[4] & 0x30) >> 2) | 227+ x = ((packet[1] & 0x7f) << 4) | ((packet[4] & 0x30) >> 2) |
233+ ((packet[0] & 0x30) >> 4); 228+ ((packet[0] & 0x30) >> 4);
234+ y = ((packet[2] & 0x7f) << 4) | (packet[4] & 0x0f); 229+ y = ((packet[2] & 0x7f) << 4) | (packet[4] & 0x0f);
235+ z = packet[5] & 0x7f; 230+ z = packet[5] & 0x7f;
250+ input_report_key(dev, BTN_LEFT, left); 245+ input_report_key(dev, BTN_LEFT, left);
251+ input_report_key(dev, BTN_RIGHT, right); 246+ input_report_key(dev, BTN_RIGHT, right);
252+ input_report_key(dev, BTN_MIDDLE, middle); 247+ input_report_key(dev, BTN_MIDDLE, middle);
253+ 248+
254+ input_sync(dev); 249+ input_sync(dev);
250+
251+ if (!(priv->quirks & ALPS_QUIRK_TRACKSTICK_BUTTONS)) {
252+ left = packet[3] & 0x10;
253+ right = packet[3] & 0x20;
254+ middle = packet[3] & 0x40;
255+
256+ input_report_key(dev2, BTN_LEFT, left);
257+ input_report_key(dev2, BTN_RIGHT, right);
258+ input_report_key(dev2, BTN_MIDDLE, middle);
259+ input_sync(dev2);
260+ }
255+} 261+}
256+ 262+
257+static void alps_process_packet_v3(struct psmouse *psmouse) 263+static void alps_process_packet_v3(struct psmouse *psmouse)
258+{ 264+{
259+ unsigned char *packet = psmouse->packet; 265+ unsigned char *packet = psmouse->packet;
328+} 334+}
329+ 335+
330 static void alps_report_bare_ps2_packet(struct psmouse *psmouse, 336 static void alps_report_bare_ps2_packet(struct psmouse *psmouse,
331 unsigned char packet[], 337 unsigned char packet[],
332 bool report_buttons) 338 bool report_buttons)
333@@ -381,11 +622,126 @@ static psmouse_ret_t alps_process_byte(struct psmouse *psmouse) 339@@ -381,11 +628,126 @@ static psmouse_ret_t alps_process_byte(struct psmouse *psmouse)
334 return PSMOUSE_GOOD_DATA; 340 return PSMOUSE_GOOD_DATA;
335 } 341 }
336 342
337+static int alps_command_mode_send_nibble(struct psmouse *psmouse, int nibble) 343+static int alps_command_mode_send_nibble(struct psmouse *psmouse, int nibble)
338+{ 344+{
455 unsigned char param[4]; 461 unsigned char param[4];
456+ const struct alps_model_info *model = NULL; 462+ const struct alps_model_info *model = NULL;
457 int i; 463 int i;
458 464
459 /* 465 /*
460@@ -431,12 +787,38 @@ static const struct alps_model_info *alps_get_model(struct psmouse *psmouse, int 466@@ -431,12 +793,38 @@ static const struct alps_model_info *alps_get_model(struct psmouse *psmouse, int
461 *version = (param[0] << 8) | (param[1] << 4) | i; 467 *version = (param[0] << 8) | (param[1] << 4) | i;
462 } 468 }
463 469
464- for (i = 0; i < ARRAY_SIZE(alps_model_data); i++) 470- for (i = 0; i < ARRAY_SIZE(alps_model_data); i++)
465+ for (i = 0; i < ARRAY_SIZE(alps_model_data); i++) { 471+ for (i = 0; i < ARRAY_SIZE(alps_model_data); i++) {
469+ sizeof(alps_model_data[i].signature))) { 475+ sizeof(alps_model_data[i].signature))) {
470+ model = alps_model_data + i; 476+ model = alps_model_data + i;
471+ break; 477+ break;
472+ } 478+ }
473+ } 479+ }
474+ 480
481- return NULL;
475+ if (model && model->proto_version > ALPS_PROTO_V2) { 482+ if (model && model->proto_version > ALPS_PROTO_V2) {
476+ /* 483+ /*
477+ * Need to check command mode response to identify 484+ * Need to check command mode response to identify
478+ * model 485+ * model
479+ */ 486+ */
492+ 499+
493+ if (!model) 500+ if (!model)
494+ pr_debug("alps.c: Unknown command mode response %2.2x\n", param[0]); 501+ pr_debug("alps.c: Unknown command mode response %2.2x\n", param[0]);
495+ } 502+ }
496+ } 503+ }
497 504+
498- return NULL;
499+ return model; 505+ return model;
500 } 506 }
501 507
502 /* 508 /*
503@@ -444,7 +826,7 @@ static const struct alps_model_info *alps_get_model(struct psmouse *psmouse, int 509@@ -444,7 +832,7 @@ static const struct alps_model_info *alps_get_model(struct psmouse *psmouse, int
504 * subsequent commands. It looks like glidepad is behind stickpointer, 510 * subsequent commands. It looks like glidepad is behind stickpointer,
505 * I'd thought it would be other way around... 511 * I'd thought it would be other way around...
506 */ 512 */
507-static int alps_passthrough_mode(struct psmouse *psmouse, bool enable) 513-static int alps_passthrough_mode(struct psmouse *psmouse, bool enable)
508+static int alps_passthrough_mode_v2(struct psmouse *psmouse, bool enable) 514+static int alps_passthrough_mode_v2(struct psmouse *psmouse, bool enable)
509 { 515 {
510 struct ps2dev *ps2dev = &psmouse->ps2dev; 516 struct ps2dev *ps2dev = &psmouse->ps2dev;
511 int cmd = enable ? PSMOUSE_CMD_SETSCALE21 : PSMOUSE_CMD_SETSCALE11; 517 int cmd = enable ? PSMOUSE_CMD_SETSCALE21 : PSMOUSE_CMD_SETSCALE11;
512@@ -461,7 +843,7 @@ static int alps_passthrough_mode(struct psmouse *psmouse, bool enable) 518@@ -461,7 +849,7 @@ static int alps_passthrough_mode(struct psmouse *psmouse, bool enable)
513 return 0; 519 return 0;
514 } 520 }
515 521
516-static int alps_absolute_mode(struct psmouse *psmouse) 522-static int alps_absolute_mode(struct psmouse *psmouse)
517+static int alps_absolute_mode_v1_v2(struct psmouse *psmouse) 523+static int alps_absolute_mode_v1_v2(struct psmouse *psmouse)
518 { 524 {
519 struct ps2dev *ps2dev = &psmouse->ps2dev; 525 struct ps2dev *ps2dev = &psmouse->ps2dev;
520 526
521@@ -540,13 +922,13 @@ static int alps_poll(struct psmouse *psmouse) 527@@ -540,13 +928,13 @@ static int alps_poll(struct psmouse *psmouse)
522 return -1; 528 return -1;
523 529
524 if (priv->i->flags & ALPS_PASS) 530 if (priv->i->flags & ALPS_PASS)
525- alps_passthrough_mode(psmouse, true); 531- alps_passthrough_mode(psmouse, true);
526+ alps_passthrough_mode_v2(psmouse, true); 532+ alps_passthrough_mode_v2(psmouse, true);
532- alps_passthrough_mode(psmouse, false); 538- alps_passthrough_mode(psmouse, false);
533+ alps_passthrough_mode_v2(psmouse, false); 539+ alps_passthrough_mode_v2(psmouse, false);
534 540
535 if (poll_failed || (buf[0] & priv->i->mask0) != priv->i->byte0) 541 if (poll_failed || (buf[0] & priv->i->mask0) != priv->i->byte0)
536 goto out; 542 goto out;
537@@ -567,13 +949,13 @@ out: 543@@ -567,13 +955,13 @@ out:
538 return ret; 544 return ret;
539 } 545 }
540 546
541-static int alps_hw_init(struct psmouse *psmouse) 547-static int alps_hw_init(struct psmouse *psmouse)
542+static int alps_hw_init_v1_v2(struct psmouse *psmouse) 548+static int alps_hw_init_v1_v2(struct psmouse *psmouse)
548- alps_passthrough_mode(psmouse, true)) { 554- alps_passthrough_mode(psmouse, true)) {
549+ alps_passthrough_mode_v2(psmouse, true)) { 555+ alps_passthrough_mode_v2(psmouse, true)) {
550 return -1; 556 return -1;
551 } 557 }
552 558
553@@ -582,13 +964,13 @@ static int alps_hw_init(struct psmouse *psmouse) 559@@ -582,13 +970,13 @@ static int alps_hw_init(struct psmouse *psmouse)
554 return -1; 560 return -1;
555 } 561 }
556 562
557- if (alps_absolute_mode(psmouse)) { 563- if (alps_absolute_mode(psmouse)) {
558+ if (alps_absolute_mode_v1_v2(psmouse)) { 564+ if (alps_absolute_mode_v1_v2(psmouse)) {
564- alps_passthrough_mode(psmouse, false)) { 570- alps_passthrough_mode(psmouse, false)) {
565+ alps_passthrough_mode_v2(psmouse, false)) { 571+ alps_passthrough_mode_v2(psmouse, false)) {
566 return -1; 572 return -1;
567 } 573 }
568 574
569@@ -601,6 +983,295 @@ static int alps_hw_init(struct psmouse *psmouse) 575@@ -601,6 +989,320 @@ static int alps_hw_init(struct psmouse *psmouse)
570 return 0; 576 return 0;
571 } 577 }
572 578
573+/* 579+/*
574+ * Enable or disable passthrough mode to the trackstick. Must be in 580+ * Enable or disable passthrough mode to the trackstick. Must be in
607+ return -1; 613+ return -1;
608+ 614+
609+ return 0; 615+ return 0;
610+} 616+}
611+ 617+
618+/*
619+ * Trackstick E7 reports for models affected by trackstick button
620+ * reporting quirk
621+ */
622+static const unsigned char trackstick_quirk_sigs[][3] = {
623+ { 0x42, 0x02, 0x14 },
624+ { 0x32, 0x01, 0x28 },
625+};
626+
612+static int alps_hw_init_v3(struct psmouse *psmouse) 627+static int alps_hw_init_v3(struct psmouse *psmouse)
613+{ 628+{
614+ struct alps_data *priv = psmouse->private; 629+ struct alps_data *priv = psmouse->private;
615+ struct ps2dev *ps2dev = &psmouse->ps2dev; 630+ struct ps2dev *ps2dev = &psmouse->ps2dev;
616+ int reg_val; 631+ int reg_val;
617+ unsigned char param[4]; 632+ unsigned char param[4];
633+ int i;
618+ 634+
619+ priv->nibble_commands = alps_v3_nibble_commands; 635+ priv->nibble_commands = alps_v3_nibble_commands;
620+ priv->addr_command = PSMOUSE_CMD_RESET_WRAP; 636+ priv->addr_command = PSMOUSE_CMD_RESET_WRAP;
621+ 637+
622+ if (alps_enter_command_mode(psmouse, NULL)) 638+ if (alps_enter_command_mode(psmouse, NULL))
648+ ps2_command(ps2dev, param, PSMOUSE_CMD_GETINFO)) { 664+ ps2_command(ps2dev, param, PSMOUSE_CMD_GETINFO)) {
649+ pr_warn("alps.c: trackstick E7 report failed\n"); 665+ pr_warn("alps.c: trackstick E7 report failed\n");
650+ } else { 666+ } else {
651+ pr_debug("alps.c: trackstick E7 report: %2.2x %2.2x %2.2x\n", 667+ pr_debug("alps.c: trackstick E7 report: %2.2x %2.2x %2.2x\n",
652+ param[0], param[1], param[2]); 668+ param[0], param[1], param[2]);
669+
670+ /*
671+ * Most models report trackstick buttons in the
672+ * touchpad packets, but some report them in the
673+ * trackstick packets instead. It appears we can
674+ * detect these using the trackstick E7 report.
675+ */
676+ for (i = 0; i < ARRAY_SIZE(trackstick_quirk_sigs); i++) {
677+ if (!memcmp(param, trackstick_quirk_sigs[i],
678+ sizeof(trackstick_quirk_sigs[i]))) {
679+ pr_debug("alps.c: enabling trackstick button quirk\n");
680+ priv->quirks |= ALPS_QUIRK_TRACKSTICK_BUTTONS;
681+ break;
682+ }
683+ }
653+ 684+
654+ /* 685+ /*
655+ * Not sure what this does, but it is absolutely 686+ * Not sure what this does, but it is absolutely
656+ * essential. Without it, the touchpad does not 687+ * essential. Without it, the touchpad does not
657+ * work at all and the trackstick just emits normal 688+ * work at all and the trackstick just emits normal
860+} 891+}
861+ 892+
862 static int alps_reconnect(struct psmouse *psmouse) 893 static int alps_reconnect(struct psmouse *psmouse)
863 { 894 {
864 const struct alps_model_info *model; 895 const struct alps_model_info *model;
865@@ -641,6 +1312,8 @@ int alps_init(struct psmouse *psmouse) 896@@ -641,6 +1343,8 @@ int alps_init(struct psmouse *psmouse)
866 897
867 psmouse->private = priv; 898 psmouse->private = priv;
868 899
869+ psmouse_reset(psmouse); 900+ psmouse_reset(psmouse);
870+ 901+
871 model = alps_get_model(psmouse, &version); 902 model = alps_get_model(psmouse, &version);
872 if (!model) 903 if (!model)
873 goto init_fail; 904 goto init_fail;
874@@ -668,8 +1341,20 @@ int alps_init(struct psmouse *psmouse) 905@@ -668,8 +1372,20 @@ int alps_init(struct psmouse *psmouse)
875 BIT_MASK(BTN_LEFT) | BIT_MASK(BTN_RIGHT); 906 BIT_MASK(BTN_LEFT) | BIT_MASK(BTN_RIGHT);
876 907
877 dev1->evbit[BIT_WORD(EV_ABS)] |= BIT_MASK(EV_ABS); 908 dev1->evbit[BIT_WORD(EV_ABS)] |= BIT_MASK(EV_ABS);
878- input_set_abs_params(dev1, ABS_X, 0, 1023, 0, 0); 909- input_set_abs_params(dev1, ABS_X, 0, 1023, 0, 0);
879- input_set_abs_params(dev1, ABS_Y, 0, 767, 0, 0); 910- input_set_abs_params(dev1, ABS_Y, 0, 767, 0, 0);
892+ } 923+ }
893+ 924+
894 input_set_abs_params(dev1, ABS_PRESSURE, 0, 127, 0, 0); 925 input_set_abs_params(dev1, ABS_PRESSURE, 0, 127, 0, 0);
895 926
896 if (model->flags & ALPS_WHEEL) { 927 if (model->flags & ALPS_WHEEL) {
897@@ -712,7 +1397,7 @@ int alps_init(struct psmouse *psmouse) 928@@ -712,7 +1428,7 @@ int alps_init(struct psmouse *psmouse)
898 psmouse->poll = alps_poll; 929 psmouse->poll = alps_poll;
899 psmouse->disconnect = alps_disconnect; 930 psmouse->disconnect = alps_disconnect;
900 psmouse->reconnect = alps_reconnect; 931 psmouse->reconnect = alps_reconnect;
901- psmouse->pktsize = 6; 932- psmouse->pktsize = 6;
902+ psmouse->pktsize = model->proto_version == ALPS_PROTO_V4 ? 8 : 6; 933+ psmouse->pktsize = model->proto_version == ALPS_PROTO_V4 ? 8 : 6;
903 934
904 /* We are having trouble resyncing ALPS touchpads so disable it for now */ 935 /* We are having trouble resyncing ALPS touchpads so disable it for now */
905 psmouse->resync_time = 0; 936 psmouse->resync_time = 0;
906diff --git a/drivers/input/mouse/alps.h b/drivers/input/mouse/alps.h 937diff --git a/drivers/input/mouse/alps.h b/drivers/input/mouse/alps.h
907index 4ce9bba..0d911cf 100644 938index 4ce9bba..62db7f4 100644
908--- a/drivers/input/mouse/alps.h 939--- a/drivers/input/mouse/alps.h
909+++ b/drivers/input/mouse/alps.h 940+++ b/drivers/input/mouse/alps.h
910@@ -14,19 +14,30 @@ 941@@ -14,22 +14,36 @@
911 942
912 #define ALPS_PROTO_V1 0 943 #define ALPS_PROTO_V1 0
913 #define ALPS_PROTO_V2 1 944 #define ALPS_PROTO_V2 1
914+#define ALPS_PROTO_V3 2 945+#define ALPS_PROTO_V3 2
915+#define ALPS_PROTO_V4 3 946+#define ALPS_PROTO_V4 3
933 const struct alps_model_info *i;/* Info */ 964 const struct alps_model_info *i;/* Info */
934+ const struct alps_nibble_commands *nibble_commands; 965+ const struct alps_nibble_commands *nibble_commands;
935+ int addr_command; /* Command to set register address */ 966+ int addr_command; /* Command to set register address */
936 int prev_fin; /* Finger bit from previous packet */ 967 int prev_fin; /* Finger bit from previous packet */
937+ int multi_packet; /* Multi-packet data in progress */ 968+ int multi_packet; /* Multi-packet data in progress */
969+ u8 quirks;
938 struct timer_list timer; 970 struct timer_list timer;
939 }; 971 };
940 972
973+#define ALPS_QUIRK_TRACKSTICK_BUTTONS 1 /* trakcstick buttons in trackstick packet */
974+
975 #ifdef CONFIG_MOUSE_PS2_ALPS
976 int alps_detect(struct psmouse *psmouse, bool set_properties);
977 int alps_init(struct psmouse *psmouse);
941-- 978--
9421.7.4.1 9791.7.4.1
943 980

Legend:
Removed from v.1982  
changed lines
  Added in v.1984

  ViewVC Help
Powered by ViewVC 1.1.20