diff options
Diffstat (limited to 'drivers/input/mouse/psmouse-base.c')
-rw-r--r-- | drivers/input/mouse/psmouse-base.c | 50 |
1 files changed, 35 insertions, 15 deletions
diff --git a/drivers/input/mouse/psmouse-base.c b/drivers/input/mouse/psmouse-base.c index 0fe5869d7d4c..f15f695777f8 100644 --- a/drivers/input/mouse/psmouse-base.c +++ b/drivers/input/mouse/psmouse-base.c | |||
@@ -28,6 +28,7 @@ | |||
28 | #include "alps.h" | 28 | #include "alps.h" |
29 | #include "lifebook.h" | 29 | #include "lifebook.h" |
30 | #include "trackpoint.h" | 30 | #include "trackpoint.h" |
31 | #include "touchkit_ps2.h" | ||
31 | 32 | ||
32 | #define DRIVER_DESC "PS/2 mouse driver" | 33 | #define DRIVER_DESC "PS/2 mouse driver" |
33 | 34 | ||
@@ -569,7 +570,9 @@ static int psmouse_extensions(struct psmouse *psmouse, | |||
569 | return PSMOUSE_THINKPS; | 570 | return PSMOUSE_THINKPS; |
570 | 571 | ||
571 | /* | 572 | /* |
572 | * Try Synaptics TouchPad | 573 | * Try Synaptics TouchPad. Note that probing is done even if Synaptics protocol |
574 | * support is disabled in config - we need to know if it is synaptics so we | ||
575 | * can reset it properly after probing for intellimouse. | ||
573 | */ | 576 | */ |
574 | if (max_proto > PSMOUSE_PS2 && synaptics_detect(psmouse, set_properties) == 0) { | 577 | if (max_proto > PSMOUSE_PS2 && synaptics_detect(psmouse, set_properties) == 0) { |
575 | synaptics_hardware = 1; | 578 | synaptics_hardware = 1; |
@@ -605,14 +608,20 @@ static int psmouse_extensions(struct psmouse *psmouse, | |||
605 | } | 608 | } |
606 | } | 609 | } |
607 | 610 | ||
608 | if (max_proto > PSMOUSE_IMEX && genius_detect(psmouse, set_properties) == 0) | 611 | if (max_proto > PSMOUSE_IMEX) { |
609 | return PSMOUSE_GENPS; | 612 | |
613 | if (genius_detect(psmouse, set_properties) == 0) | ||
614 | return PSMOUSE_GENPS; | ||
610 | 615 | ||
611 | if (max_proto > PSMOUSE_IMEX && ps2pp_init(psmouse, set_properties) == 0) | 616 | if (ps2pp_init(psmouse, set_properties) == 0) |
612 | return PSMOUSE_PS2PP; | 617 | return PSMOUSE_PS2PP; |
613 | 618 | ||
614 | if (max_proto > PSMOUSE_IMEX && trackpoint_detect(psmouse, set_properties) == 0) | 619 | if (trackpoint_detect(psmouse, set_properties) == 0) |
615 | return PSMOUSE_TRACKPOINT; | 620 | return PSMOUSE_TRACKPOINT; |
621 | |||
622 | if (touchkit_ps2_detect(psmouse, set_properties) == 0) | ||
623 | return PSMOUSE_TOUCHKIT_PS2; | ||
624 | } | ||
616 | 625 | ||
617 | /* | 626 | /* |
618 | * Reset to defaults in case the device got confused by extended | 627 | * Reset to defaults in case the device got confused by extended |
@@ -654,12 +663,14 @@ static const struct psmouse_protocol psmouse_protocols[] = { | |||
654 | .maxproto = 1, | 663 | .maxproto = 1, |
655 | .detect = ps2bare_detect, | 664 | .detect = ps2bare_detect, |
656 | }, | 665 | }, |
666 | #ifdef CONFIG_MOUSE_PS2_LOGIPS2PP | ||
657 | { | 667 | { |
658 | .type = PSMOUSE_PS2PP, | 668 | .type = PSMOUSE_PS2PP, |
659 | .name = "PS2++", | 669 | .name = "PS2++", |
660 | .alias = "logitech", | 670 | .alias = "logitech", |
661 | .detect = ps2pp_init, | 671 | .detect = ps2pp_init, |
662 | }, | 672 | }, |
673 | #endif | ||
663 | { | 674 | { |
664 | .type = PSMOUSE_THINKPS, | 675 | .type = PSMOUSE_THINKPS, |
665 | .name = "ThinkPS/2", | 676 | .name = "ThinkPS/2", |
@@ -686,6 +697,7 @@ static const struct psmouse_protocol psmouse_protocols[] = { | |||
686 | .maxproto = 1, | 697 | .maxproto = 1, |
687 | .detect = im_explorer_detect, | 698 | .detect = im_explorer_detect, |
688 | }, | 699 | }, |
700 | #ifdef CONFIG_MOUSE_PS2_SYNAPTICS | ||
689 | { | 701 | { |
690 | .type = PSMOUSE_SYNAPTICS, | 702 | .type = PSMOUSE_SYNAPTICS, |
691 | .name = "SynPS/2", | 703 | .name = "SynPS/2", |
@@ -693,6 +705,8 @@ static const struct psmouse_protocol psmouse_protocols[] = { | |||
693 | .detect = synaptics_detect, | 705 | .detect = synaptics_detect, |
694 | .init = synaptics_init, | 706 | .init = synaptics_init, |
695 | }, | 707 | }, |
708 | #endif | ||
709 | #ifdef CONFIG_MOUSE_PS2_ALPS | ||
696 | { | 710 | { |
697 | .type = PSMOUSE_ALPS, | 711 | .type = PSMOUSE_ALPS, |
698 | .name = "AlpsPS/2", | 712 | .name = "AlpsPS/2", |
@@ -700,18 +714,31 @@ static const struct psmouse_protocol psmouse_protocols[] = { | |||
700 | .detect = alps_detect, | 714 | .detect = alps_detect, |
701 | .init = alps_init, | 715 | .init = alps_init, |
702 | }, | 716 | }, |
717 | #endif | ||
718 | #ifdef CONFIG_MOUSE_PS2_LIFEBOOK | ||
703 | { | 719 | { |
704 | .type = PSMOUSE_LIFEBOOK, | 720 | .type = PSMOUSE_LIFEBOOK, |
705 | .name = "LBPS/2", | 721 | .name = "LBPS/2", |
706 | .alias = "lifebook", | 722 | .alias = "lifebook", |
707 | .init = lifebook_init, | 723 | .init = lifebook_init, |
708 | }, | 724 | }, |
725 | #endif | ||
726 | #ifdef CONFIG_MOUSE_PS2_TRACKPOINT | ||
709 | { | 727 | { |
710 | .type = PSMOUSE_TRACKPOINT, | 728 | .type = PSMOUSE_TRACKPOINT, |
711 | .name = "TPPS/2", | 729 | .name = "TPPS/2", |
712 | .alias = "trackpoint", | 730 | .alias = "trackpoint", |
713 | .detect = trackpoint_detect, | 731 | .detect = trackpoint_detect, |
714 | }, | 732 | }, |
733 | #endif | ||
734 | #ifdef CONFIG_MOUSE_PS2_TOUCHKIT | ||
735 | { | ||
736 | .type = PSMOUSE_TOUCHKIT_PS2, | ||
737 | .name = "touchkitPS/2", | ||
738 | .alias = "touchkit", | ||
739 | .detect = touchkit_ps2_detect, | ||
740 | }, | ||
741 | #endif | ||
715 | { | 742 | { |
716 | .type = PSMOUSE_AUTO, | 743 | .type = PSMOUSE_AUTO, |
717 | .name = "auto", | 744 | .name = "auto", |
@@ -823,12 +850,6 @@ static void psmouse_set_rate(struct psmouse *psmouse, unsigned int rate) | |||
823 | static void psmouse_initialize(struct psmouse *psmouse) | 850 | static void psmouse_initialize(struct psmouse *psmouse) |
824 | { | 851 | { |
825 | /* | 852 | /* |
826 | * We set the mouse into streaming mode. | ||
827 | */ | ||
828 | |||
829 | ps2_command(&psmouse->ps2dev, NULL, PSMOUSE_CMD_SETSTREAM); | ||
830 | |||
831 | /* | ||
832 | * We set the mouse report rate, resolution and scaling. | 853 | * We set the mouse report rate, resolution and scaling. |
833 | */ | 854 | */ |
834 | 855 | ||
@@ -1062,8 +1083,7 @@ static int psmouse_switch_protocol(struct psmouse *psmouse, const struct psmouse | |||
1062 | { | 1083 | { |
1063 | struct input_dev *input_dev = psmouse->dev; | 1084 | struct input_dev *input_dev = psmouse->dev; |
1064 | 1085 | ||
1065 | input_dev->private = psmouse; | 1086 | input_dev->dev.parent = &psmouse->ps2dev.serio->dev; |
1066 | input_dev->cdev.dev = &psmouse->ps2dev.serio->dev; | ||
1067 | 1087 | ||
1068 | input_dev->evbit[0] = BIT(EV_KEY) | BIT(EV_REL); | 1088 | input_dev->evbit[0] = BIT(EV_KEY) | BIT(EV_REL); |
1069 | input_dev->keybit[LONG(BTN_MOUSE)] = BIT(BTN_LEFT) | BIT(BTN_MIDDLE) | BIT(BTN_RIGHT); | 1089 | input_dev->keybit[LONG(BTN_MOUSE)] = BIT(BTN_LEFT) | BIT(BTN_MIDDLE) | BIT(BTN_RIGHT); |