aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHans de Goede <hdegoede@redhat.com>2014-07-26 01:43:35 -0400
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2014-07-26 17:03:16 -0400
commit02d04254a5dfb8de1459805c3433cd0e9e4853d7 (patch)
tree5575d7d34621e31656db751589d0095b0084c878
parent28835f4540564e6319028c9c1aeadf16604bed9c (diff)
Input: alps - use struct input_mt_pos to track coordinates
This is a preparation patch for switching the DIY mt handling to using input_mt_assign_slots && input_mt_sync_frame. struct alps_fields is quite large, so while making changes to almost all uses of it lets put it in our priv data instead of on the stack. Having it in our priv data also allows using it directly for storing values which need to be cached, rather then having separate x, y, z, fingers, etc. copies in our priv data. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
-rw-r--r--drivers/input/mouse/alps.c199
-rw-r--r--drivers/input/mouse/alps.h27
2 files changed, 104 insertions, 122 deletions
diff --git a/drivers/input/mouse/alps.c b/drivers/input/mouse/alps.c
index 1c9917828956..8c3017a92788 100644
--- a/drivers/input/mouse/alps.c
+++ b/drivers/input/mouse/alps.c
@@ -282,11 +282,10 @@ static void alps_process_packet_v1_v2(struct psmouse *psmouse)
282 * 282 *
283 * The bitmaps don't have enough data to track fingers, so this function 283 * The bitmaps don't have enough data to track fingers, so this function
284 * only generates points representing a bounding box of at most two contacts. 284 * only generates points representing a bounding box of at most two contacts.
285 * These two points are returned in x1, y1, x2, and y2. 285 * These two points are returned in fields->mt.
286 */ 286 */
287static void alps_process_bitmap_dolphin(struct alps_data *priv, 287static void alps_process_bitmap_dolphin(struct alps_data *priv,
288 struct alps_fields *fields, 288 struct alps_fields *fields)
289 int *x1, int *y1, int *x2, int *y2)
290{ 289{
291 int box_middle_x, box_middle_y; 290 int box_middle_x, box_middle_y;
292 unsigned int x_map, y_map; 291 unsigned int x_map, y_map;
@@ -309,8 +308,6 @@ static void alps_process_bitmap_dolphin(struct alps_data *priv,
309 if (x_msb > priv->x_bits || y_msb > priv->y_bits) 308 if (x_msb > priv->x_bits || y_msb > priv->y_bits)
310 return; 309 return;
311 310
312 *x1 = *y1 = *x2 = *y2 = 0;
313
314 if (fields->fingers > 1) { 311 if (fields->fingers > 1) {
315 start_bit = priv->x_bits - x_msb; 312 start_bit = priv->x_bits - x_msb;
316 end_bit = priv->x_bits - x_lsb; 313 end_bit = priv->x_bits - x_lsb;
@@ -321,10 +318,9 @@ static void alps_process_bitmap_dolphin(struct alps_data *priv,
321 end_bit = y_msb - 1; 318 end_bit = y_msb - 1;
322 box_middle_y = (priv->y_max * (start_bit + end_bit)) / 319 box_middle_y = (priv->y_max * (start_bit + end_bit)) /
323 (2 * (priv->y_bits - 1)); 320 (2 * (priv->y_bits - 1));
324 *x1 = fields->x; 321 fields->mt[0] = fields->st;
325 *y1 = fields->y; 322 fields->mt[1].x = 2 * box_middle_x - fields->mt[0].x;
326 *x2 = 2 * box_middle_x - *x1; 323 fields->mt[1].y = 2 * box_middle_y - fields->mt[0].y;
327 *y2 = 2 * box_middle_y - *y1;
328 } 324 }
329} 325}
330 326
@@ -361,24 +357,21 @@ static void alps_get_bitmap_points(unsigned int map,
361 * 357 *
362 * The bitmaps don't have enough data to track fingers, so this function 358 * The bitmaps don't have enough data to track fingers, so this function
363 * only generates points representing a bounding box of all contacts. 359 * only generates points representing a bounding box of all contacts.
364 * These points are returned in x1, y1, x2, and y2 when the return value 360 * These points are returned in fields->mt when the return value
365 * is greater than 0. 361 * is greater than 0.
366 */ 362 */
367static int alps_process_bitmap(struct alps_data *priv, 363static int alps_process_bitmap(struct alps_data *priv,
368 unsigned int x_map, unsigned int y_map, 364 struct alps_fields *fields)
369 int *x1, int *y1, int *x2, int *y2)
370{ 365{
371 int i, fingers_x = 0, fingers_y = 0, fingers; 366 int i, fingers_x = 0, fingers_y = 0, fingers;
372 struct alps_bitmap_point x_low = {0,}, x_high = {0,}; 367 struct alps_bitmap_point x_low = {0,}, x_high = {0,};
373 struct alps_bitmap_point y_low = {0,}, y_high = {0,}; 368 struct alps_bitmap_point y_low = {0,}, y_high = {0,};
374 369
375 if (!x_map || !y_map) 370 if (!fields->x_map || !fields->y_map)
376 return 0; 371 return 0;
377 372
378 *x1 = *y1 = *x2 = *y2 = 0; 373 alps_get_bitmap_points(fields->x_map, &x_low, &x_high, &fingers_x);
379 374 alps_get_bitmap_points(fields->y_map, &y_low, &y_high, &fingers_y);
380 alps_get_bitmap_points(x_map, &x_low, &x_high, &fingers_x);
381 alps_get_bitmap_points(y_map, &y_low, &y_high, &fingers_y);
382 375
383 /* 376 /*
384 * Fingers can overlap, so we use the maximum count of fingers 377 * Fingers can overlap, so we use the maximum count of fingers
@@ -403,22 +396,24 @@ static int alps_process_bitmap(struct alps_data *priv,
403 y_high.num_bits = max(i, 1); 396 y_high.num_bits = max(i, 1);
404 } 397 }
405 398
406 *x1 = (priv->x_max * (2 * x_low.start_bit + x_low.num_bits - 1)) / 399 fields->mt[0].x =
407 (2 * (priv->x_bits - 1)); 400 (priv->x_max * (2 * x_low.start_bit + x_low.num_bits - 1)) /
408 *y1 = (priv->y_max * (2 * y_low.start_bit + y_low.num_bits - 1)) / 401 (2 * (priv->x_bits - 1));
409 (2 * (priv->y_bits - 1)); 402 fields->mt[0].y =
403 (priv->y_max * (2 * y_low.start_bit + y_low.num_bits - 1)) /
404 (2 * (priv->y_bits - 1));
410 405
411 *x2 = (priv->x_max * 406 fields->mt[1].x =
412 (2 * x_high.start_bit + x_high.num_bits - 1)) / 407 (priv->x_max * (2 * x_high.start_bit + x_high.num_bits - 1)) /
413 (2 * (priv->x_bits - 1)); 408 (2 * (priv->x_bits - 1));
414 *y2 = (priv->y_max * 409 fields->mt[1].y =
415 (2 * y_high.start_bit + y_high.num_bits - 1)) / 410 (priv->y_max * (2 * y_high.start_bit + y_high.num_bits - 1)) /
416 (2 * (priv->y_bits - 1)); 411 (2 * (priv->y_bits - 1));
417 412
418 /* y-bitmap order is reversed, except on rushmore */ 413 /* y-bitmap order is reversed, except on rushmore */
419 if (!(priv->flags & ALPS_IS_RUSHMORE)) { 414 if (!(priv->flags & ALPS_IS_RUSHMORE)) {
420 *y1 = priv->y_max - *y1; 415 fields->mt[0].y = priv->y_max - fields->mt[0].y;
421 *y2 = priv->y_max - *y2; 416 fields->mt[1].y = priv->y_max - fields->mt[1].y;
422 } 417 }
423 418
424 return fingers; 419 return fingers;
@@ -435,11 +430,14 @@ static void alps_set_slot(struct input_dev *dev, int slot, bool active,
435 } 430 }
436} 431}
437 432
438static void alps_report_semi_mt_data(struct input_dev *dev, int num_fingers, 433static void alps_report_semi_mt_data(struct psmouse *psmouse, int num_fingers)
439 int x1, int y1, int x2, int y2)
440{ 434{
441 alps_set_slot(dev, 0, num_fingers != 0, x1, y1); 435 struct alps_data *priv = psmouse->private;
442 alps_set_slot(dev, 1, num_fingers == 2, x2, y2); 436 struct input_dev *dev = psmouse->dev;
437 struct alps_fields *f = &priv->f;
438
439 alps_set_slot(dev, 0, num_fingers != 0, f->mt[0].x, f->mt[0].y);
440 alps_set_slot(dev, 1, num_fingers == 2, f->mt[1].x, f->mt[1].y);
443} 441}
444 442
445static void alps_process_trackstick_packet_v3(struct psmouse *psmouse) 443static void alps_process_trackstick_packet_v3(struct psmouse *psmouse)
@@ -527,10 +525,10 @@ static void alps_decode_pinnacle(struct alps_fields *f, unsigned char *p,
527 ((p[2] & 0x7f) << 1) | 525 ((p[2] & 0x7f) << 1) |
528 (p[4] & 0x01); 526 (p[4] & 0x01);
529 527
530 f->x = ((p[1] & 0x7f) << 4) | ((p[4] & 0x30) >> 2) | 528 f->st.x = ((p[1] & 0x7f) << 4) | ((p[4] & 0x30) >> 2) |
531 ((p[0] & 0x30) >> 4); 529 ((p[0] & 0x30) >> 4);
532 f->y = ((p[2] & 0x7f) << 4) | (p[4] & 0x0f); 530 f->st.y = ((p[2] & 0x7f) << 4) | (p[4] & 0x0f);
533 f->z = p[5] & 0x7f; 531 f->pressure = p[5] & 0x7f;
534 532
535 alps_decode_buttons_v3(f, p); 533 alps_decode_buttons_v3(f, p);
536} 534}
@@ -557,9 +555,9 @@ static void alps_decode_dolphin(struct alps_fields *f, unsigned char *p,
557 f->is_mp = !!(p[0] & 0x20); 555 f->is_mp = !!(p[0] & 0x20);
558 556
559 if (!f->is_mp) { 557 if (!f->is_mp) {
560 f->x = ((p[1] & 0x7f) | ((p[4] & 0x0f) << 7)); 558 f->st.x = ((p[1] & 0x7f) | ((p[4] & 0x0f) << 7));
561 f->y = ((p[2] & 0x7f) | ((p[4] & 0xf0) << 3)); 559 f->st.y = ((p[2] & 0x7f) | ((p[4] & 0xf0) << 3));
562 f->z = (p[0] & 4) ? 0 : p[5] & 0x7f; 560 f->pressure = (p[0] & 4) ? 0 : p[5] & 0x7f;
563 alps_decode_buttons_v3(f, p); 561 alps_decode_buttons_v3(f, p);
564 } else { 562 } else {
565 f->fingers = ((p[0] & 0x6) >> 1 | 563 f->fingers = ((p[0] & 0x6) >> 1 |
@@ -588,10 +586,12 @@ static void alps_process_touchpad_packet_v3_v5(struct psmouse *psmouse)
588 unsigned char *packet = psmouse->packet; 586 unsigned char *packet = psmouse->packet;
589 struct input_dev *dev = psmouse->dev; 587 struct input_dev *dev = psmouse->dev;
590 struct input_dev *dev2 = priv->dev2; 588 struct input_dev *dev2 = priv->dev2;
591 int x1 = 0, y1 = 0, x2 = 0, y2 = 0, fingers = 0; 589 struct alps_fields *f = &priv->f;
592 struct alps_fields f = {0}; 590 int fingers = 0;
591
592 memset(f, 0, sizeof(*f));
593 593
594 priv->decode_fields(&f, packet, psmouse); 594 priv->decode_fields(f, packet, psmouse);
595 595
596 /* 596 /*
597 * There's no single feature of touchpad position and bitmap packets 597 * There's no single feature of touchpad position and bitmap packets
@@ -606,16 +606,14 @@ static void alps_process_touchpad_packet_v3_v5(struct psmouse *psmouse)
606 * packet. Check for this, and when it happens process the 606 * packet. Check for this, and when it happens process the
607 * position packet as usual. 607 * position packet as usual.
608 */ 608 */
609 if (f.is_mp) { 609 if (f->is_mp) {
610 fingers = f.fingers; 610 fingers = f->fingers;
611 if (priv->proto_version == ALPS_PROTO_V3) { 611 if (priv->proto_version == ALPS_PROTO_V3) {
612 if (alps_process_bitmap(priv, f.x_map, 612 if (alps_process_bitmap(priv, f) == 0)
613 f.y_map, &x1, &y1,
614 &x2, &y2) == 0)
615 fingers = 0; /* Use st data */ 613 fingers = 0; /* Use st data */
616 614
617 /* Now process position packet */ 615 /* Now process position packet */
618 priv->decode_fields(&f, priv->multi_data, 616 priv->decode_fields(f, priv->multi_data,
619 psmouse); 617 psmouse);
620 } else { 618 } else {
621 /* 619 /*
@@ -624,15 +622,14 @@ static void alps_process_touchpad_packet_v3_v5(struct psmouse *psmouse)
624 * calculate Pt2, so we need to do position 622 * calculate Pt2, so we need to do position
625 * packet decode first. 623 * packet decode first.
626 */ 624 */
627 priv->decode_fields(&f, priv->multi_data, 625 priv->decode_fields(f, priv->multi_data,
628 psmouse); 626 psmouse);
629 627
630 /* 628 /*
631 * Since Dolphin's finger number is reliable, 629 * Since Dolphin's finger number is reliable,
632 * there is no need to compare with bmap_fn. 630 * there is no need to compare with bmap_fn.
633 */ 631 */
634 alps_process_bitmap_dolphin(priv, &f, &x1, &y1, 632 alps_process_bitmap_dolphin(priv, f);
635 &x2, &y2);
636 } 633 }
637 } else { 634 } else {
638 priv->multi_packet = 0; 635 priv->multi_packet = 0;
@@ -647,10 +644,10 @@ static void alps_process_touchpad_packet_v3_v5(struct psmouse *psmouse)
647 * out misidentified bitmap packets, we reject anything with this 644 * out misidentified bitmap packets, we reject anything with this
648 * bit set. 645 * bit set.
649 */ 646 */
650 if (f.is_mp) 647 if (f->is_mp)
651 return; 648 return;
652 649
653 if (!priv->multi_packet && f.first_mp) { 650 if (!priv->multi_packet && f->first_mp) {
654 priv->multi_packet = 1; 651 priv->multi_packet = 1;
655 memcpy(priv->multi_data, packet, sizeof(priv->multi_data)); 652 memcpy(priv->multi_data, packet, sizeof(priv->multi_data));
656 return; 653 return;
@@ -664,7 +661,7 @@ static void alps_process_touchpad_packet_v3_v5(struct psmouse *psmouse)
664 * with x, y, and z all zero, so these seem to be flukes. 661 * with x, y, and z all zero, so these seem to be flukes.
665 * Ignore them. 662 * Ignore them.
666 */ 663 */
667 if (f.x && f.y && !f.z) 664 if (f->st.x && f->st.y && !f->pressure)
668 return; 665 return;
669 666
670 /* 667 /*
@@ -672,36 +669,36 @@ static void alps_process_touchpad_packet_v3_v5(struct psmouse *psmouse)
672 * to rely on ST data. 669 * to rely on ST data.
673 */ 670 */
674 if (!fingers) { 671 if (!fingers) {
675 x1 = f.x; 672 f->mt[0].x = f->st.x;
676 y1 = f.y; 673 f->mt[0].y = f->st.y;
677 fingers = f.z > 0 ? 1 : 0; 674 fingers = f->pressure > 0 ? 1 : 0;
678 } 675 }
679 676
680 if (f.z >= 64) 677 if (f->pressure >= 64)
681 input_report_key(dev, BTN_TOUCH, 1); 678 input_report_key(dev, BTN_TOUCH, 1);
682 else 679 else
683 input_report_key(dev, BTN_TOUCH, 0); 680 input_report_key(dev, BTN_TOUCH, 0);
684 681
685 alps_report_semi_mt_data(dev, fingers, x1, y1, x2, y2); 682 alps_report_semi_mt_data(psmouse, fingers);
686 683
687 input_mt_report_finger_count(dev, fingers); 684 input_mt_report_finger_count(dev, fingers);
688 685
689 input_report_key(dev, BTN_LEFT, f.left); 686 input_report_key(dev, BTN_LEFT, f->left);
690 input_report_key(dev, BTN_RIGHT, f.right); 687 input_report_key(dev, BTN_RIGHT, f->right);
691 input_report_key(dev, BTN_MIDDLE, f.middle); 688 input_report_key(dev, BTN_MIDDLE, f->middle);
692 689
693 if (f.z > 0) { 690 if (f->pressure > 0) {
694 input_report_abs(dev, ABS_X, f.x); 691 input_report_abs(dev, ABS_X, f->st.x);
695 input_report_abs(dev, ABS_Y, f.y); 692 input_report_abs(dev, ABS_Y, f->st.y);
696 } 693 }
697 input_report_abs(dev, ABS_PRESSURE, f.z); 694 input_report_abs(dev, ABS_PRESSURE, f->pressure);
698 695
699 input_sync(dev); 696 input_sync(dev);
700 697
701 if (!(priv->quirks & ALPS_QUIRK_TRACKSTICK_BUTTONS)) { 698 if (!(priv->quirks & ALPS_QUIRK_TRACKSTICK_BUTTONS)) {
702 input_report_key(dev2, BTN_LEFT, f.ts_left); 699 input_report_key(dev2, BTN_LEFT, f->ts_left);
703 input_report_key(dev2, BTN_RIGHT, f.ts_right); 700 input_report_key(dev2, BTN_RIGHT, f->ts_right);
704 input_report_key(dev2, BTN_MIDDLE, f.ts_middle); 701 input_report_key(dev2, BTN_MIDDLE, f->ts_middle);
705 input_sync(dev2); 702 input_sync(dev2);
706 } 703 }
707} 704}
@@ -801,12 +798,8 @@ static void alps_process_packet_v4(struct psmouse *psmouse)
801 struct alps_data *priv = psmouse->private; 798 struct alps_data *priv = psmouse->private;
802 unsigned char *packet = psmouse->packet; 799 unsigned char *packet = psmouse->packet;
803 struct input_dev *dev = psmouse->dev; 800 struct input_dev *dev = psmouse->dev;
804 int offset; 801 struct alps_fields *f = &priv->f;
805 int x, y, z; 802 int offset, fingers = 0;
806 int left, right;
807 int x1, y1, x2, y2;
808 int fingers = 0;
809 unsigned int x_bitmap, y_bitmap;
810 803
811 /* 804 /*
812 * v4 has a 6-byte encoding for bitmap data, but this data is 805 * v4 has a 6-byte encoding for bitmap data, but this data is
@@ -828,67 +821,55 @@ static void alps_process_packet_v4(struct psmouse *psmouse)
828 if (++priv->multi_packet > 2) { 821 if (++priv->multi_packet > 2) {
829 priv->multi_packet = 0; 822 priv->multi_packet = 0;
830 823
831 x_bitmap = ((priv->multi_data[2] & 0x1f) << 10) | 824 f->x_map = ((priv->multi_data[2] & 0x1f) << 10) |
832 ((priv->multi_data[3] & 0x60) << 3) | 825 ((priv->multi_data[3] & 0x60) << 3) |
833 ((priv->multi_data[0] & 0x3f) << 2) | 826 ((priv->multi_data[0] & 0x3f) << 2) |
834 ((priv->multi_data[1] & 0x60) >> 5); 827 ((priv->multi_data[1] & 0x60) >> 5);
835 y_bitmap = ((priv->multi_data[5] & 0x01) << 10) | 828 f->y_map = ((priv->multi_data[5] & 0x01) << 10) |
836 ((priv->multi_data[3] & 0x1f) << 5) | 829 ((priv->multi_data[3] & 0x1f) << 5) |
837 (priv->multi_data[1] & 0x1f); 830 (priv->multi_data[1] & 0x1f);
838 831
839 fingers = alps_process_bitmap(priv, x_bitmap, y_bitmap, 832 f->fingers = alps_process_bitmap(priv, f);
840 &x1, &y1, &x2, &y2);
841
842 /* Store MT data.*/
843 priv->fingers = fingers;
844 priv->x1 = x1;
845 priv->x2 = x2;
846 priv->y1 = y1;
847 priv->y2 = y2;
848 } 833 }
849 834
850 left = packet[4] & 0x01; 835 f->left = packet[4] & 0x01;
851 right = packet[4] & 0x02; 836 f->right = packet[4] & 0x02;
852 837
853 x = ((packet[1] & 0x7f) << 4) | ((packet[3] & 0x30) >> 2) | 838 f->st.x = ((packet[1] & 0x7f) << 4) | ((packet[3] & 0x30) >> 2) |
854 ((packet[0] & 0x30) >> 4); 839 ((packet[0] & 0x30) >> 4);
855 y = ((packet[2] & 0x7f) << 4) | (packet[3] & 0x0f); 840 f->st.y = ((packet[2] & 0x7f) << 4) | (packet[3] & 0x0f);
856 z = packet[5] & 0x7f; 841 f->pressure = packet[5] & 0x7f;
857 842
858 /* 843 /*
859 * If there were no contacts in the bitmap, use ST 844 * If there were no contacts in the bitmap, use ST
860 * points in MT reports. 845 * points in MT reports.
861 * If there were two contacts or more, report MT data. 846 * If there were two contacts or more, report MT data.
862 */ 847 */
863 if (priv->fingers < 2) { 848 if (f->fingers < 2) {
864 x1 = x; 849 f->mt[0].x = f->st.x;
865 y1 = y; 850 f->mt[0].y = f->st.y;
866 fingers = z > 0 ? 1 : 0; 851 fingers = f->pressure > 0 ? 1 : 0;
867 } else { 852 } else {
868 fingers = priv->fingers; 853 fingers = f->fingers;
869 x1 = priv->x1;
870 x2 = priv->x2;
871 y1 = priv->y1;
872 y2 = priv->y2;
873 } 854 }
874 855
875 if (z >= 64) 856 if (f->pressure >= 64)
876 input_report_key(dev, BTN_TOUCH, 1); 857 input_report_key(dev, BTN_TOUCH, 1);
877 else 858 else
878 input_report_key(dev, BTN_TOUCH, 0); 859 input_report_key(dev, BTN_TOUCH, 0);
879 860
880 alps_report_semi_mt_data(dev, fingers, x1, y1, x2, y2); 861 alps_report_semi_mt_data(psmouse, fingers);
881 862
882 input_mt_report_finger_count(dev, fingers); 863 input_mt_report_finger_count(dev, fingers);
883 864
884 input_report_key(dev, BTN_LEFT, left); 865 input_report_key(dev, BTN_LEFT, f->left);
885 input_report_key(dev, BTN_RIGHT, right); 866 input_report_key(dev, BTN_RIGHT, f->right);
886 867
887 if (z > 0) { 868 if (f->pressure > 0) {
888 input_report_abs(dev, ABS_X, x); 869 input_report_abs(dev, ABS_X, f->st.x);
889 input_report_abs(dev, ABS_Y, y); 870 input_report_abs(dev, ABS_Y, f->st.y);
890 } 871 }
891 input_report_abs(dev, ABS_PRESSURE, z); 872 input_report_abs(dev, ABS_PRESSURE, f->pressure);
892 873
893 input_sync(dev); 874 input_sync(dev);
894} 875}
diff --git a/drivers/input/mouse/alps.h b/drivers/input/mouse/alps.h
index e900a08b42e5..ee841e53ef9c 100644
--- a/drivers/input/mouse/alps.h
+++ b/drivers/input/mouse/alps.h
@@ -12,6 +12,8 @@
12#ifndef _ALPS_H 12#ifndef _ALPS_H
13#define _ALPS_H 13#define _ALPS_H
14 14
15#include <linux/input/mt.h>
16
15#define ALPS_PROTO_V1 1 17#define ALPS_PROTO_V1 1
16#define ALPS_PROTO_V2 2 18#define ALPS_PROTO_V2 2
17#define ALPS_PROTO_V3 3 19#define ALPS_PROTO_V3 3
@@ -19,6 +21,8 @@
19#define ALPS_PROTO_V5 5 21#define ALPS_PROTO_V5 5
20#define ALPS_PROTO_V6 6 22#define ALPS_PROTO_V6 6
21 23
24#define MAX_TOUCHES 2
25
22#define DOLPHIN_COUNT_PER_ELECTRODE 64 26#define DOLPHIN_COUNT_PER_ELECTRODE 64
23#define DOLPHIN_PROFILE_XOFFSET 8 /* x-electrode offset */ 27#define DOLPHIN_PROFILE_XOFFSET 8 /* x-electrode offset */
24#define DOLPHIN_PROFILE_YOFFSET 1 /* y-electrode offset */ 28#define DOLPHIN_PROFILE_YOFFSET 1 /* y-electrode offset */
@@ -75,9 +79,9 @@ struct alps_bitmap_point {
75 * @x_map: Bitmap of active X positions for MT. 79 * @x_map: Bitmap of active X positions for MT.
76 * @y_map: Bitmap of active Y positions for MT. 80 * @y_map: Bitmap of active Y positions for MT.
77 * @fingers: Number of fingers for MT. 81 * @fingers: Number of fingers for MT.
78 * @x: X position for ST. 82 * @pressure: Pressure.
79 * @y: Y position for ST. 83 * @st: position for ST.
80 * @z: Z position for ST. 84 * @mt: position for MT.
81 * @first_mp: Packet is the first of a multi-packet report. 85 * @first_mp: Packet is the first of a multi-packet report.
82 * @is_mp: Packet is part of a multi-packet report. 86 * @is_mp: Packet is part of a multi-packet report.
83 * @left: Left touchpad button is active. 87 * @left: Left touchpad button is active.
@@ -91,9 +95,11 @@ struct alps_fields {
91 unsigned int x_map; 95 unsigned int x_map;
92 unsigned int y_map; 96 unsigned int y_map;
93 unsigned int fingers; 97 unsigned int fingers;
94 unsigned int x; 98
95 unsigned int y; 99 int pressure;
96 unsigned int z; 100 struct input_mt_pos st;
101 struct input_mt_pos mt[MAX_TOUCHES];
102
97 unsigned int first_mp:1; 103 unsigned int first_mp:1;
98 unsigned int is_mp:1; 104 unsigned int is_mp:1;
99 105
@@ -130,11 +136,7 @@ struct alps_fields {
130 * @prev_fin: Finger bit from previous packet. 136 * @prev_fin: Finger bit from previous packet.
131 * @multi_packet: Multi-packet data in progress. 137 * @multi_packet: Multi-packet data in progress.
132 * @multi_data: Saved multi-packet data. 138 * @multi_data: Saved multi-packet data.
133 * @x1: First X coordinate from last MT report. 139 * @f: Decoded packet data fields.
134 * @x2: Second X coordinate from last MT report.
135 * @y1: First Y coordinate from last MT report.
136 * @y2: Second Y coordinate from last MT report.
137 * @fingers: Number of fingers from last MT report.
138 * @quirks: Bitmap of ALPS_QUIRK_*. 140 * @quirks: Bitmap of ALPS_QUIRK_*.
139 * @timer: Timer for flushing out the final report packet in the stream. 141 * @timer: Timer for flushing out the final report packet in the stream.
140 */ 142 */
@@ -162,8 +164,7 @@ struct alps_data {
162 int prev_fin; 164 int prev_fin;
163 int multi_packet; 165 int multi_packet;
164 unsigned char multi_data[6]; 166 unsigned char multi_data[6];
165 int x1, x2, y1, y2; 167 struct alps_fields f;
166 int fingers;
167 u8 quirks; 168 u8 quirks;
168 struct timer_list timer; 169 struct timer_list timer;
169}; 170};