aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hid/hid-multitouch.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/hid/hid-multitouch.c')
-rw-r--r--drivers/hid/hid-multitouch.c67
1 files changed, 60 insertions, 7 deletions
diff --git a/drivers/hid/hid-multitouch.c b/drivers/hid/hid-multitouch.c
index ee0b76b398cb..3eb02b94fc87 100644
--- a/drivers/hid/hid-multitouch.c
+++ b/drivers/hid/hid-multitouch.c
@@ -117,6 +117,8 @@ struct mt_device {
117#define MT_CLS_TOPSEED 0x0105 117#define MT_CLS_TOPSEED 0x0105
118#define MT_CLS_PANASONIC 0x0106 118#define MT_CLS_PANASONIC 0x0106
119#define MT_CLS_FLATFROG 0x0107 119#define MT_CLS_FLATFROG 0x0107
120#define MT_CLS_GENERALTOUCH_TWOFINGERS 0x0108
121#define MT_CLS_GENERALTOUCH_PWT_TENFINGERS 0x0109
120 122
121#define MT_DEFAULT_MAXCONTACT 10 123#define MT_DEFAULT_MAXCONTACT 10
122 124
@@ -200,6 +202,17 @@ static struct mt_class mt_classes[] = {
200 { .name = MT_CLS_PANASONIC, 202 { .name = MT_CLS_PANASONIC,
201 .quirks = MT_QUIRK_NOT_SEEN_MEANS_UP, 203 .quirks = MT_QUIRK_NOT_SEEN_MEANS_UP,
202 .maxcontacts = 4 }, 204 .maxcontacts = 4 },
205 { .name = MT_CLS_GENERALTOUCH_TWOFINGERS,
206 .quirks = MT_QUIRK_NOT_SEEN_MEANS_UP |
207 MT_QUIRK_VALID_IS_INRANGE |
208 MT_QUIRK_SLOT_IS_CONTACTNUMBER,
209 .maxcontacts = 2
210 },
211 { .name = MT_CLS_GENERALTOUCH_PWT_TENFINGERS,
212 .quirks = MT_QUIRK_NOT_SEEN_MEANS_UP |
213 MT_QUIRK_SLOT_IS_CONTACTNUMBER,
214 .maxcontacts = 10
215 },
203 216
204 { .name = MT_CLS_FLATFROG, 217 { .name = MT_CLS_FLATFROG,
205 .quirks = MT_QUIRK_NOT_SEEN_MEANS_UP | 218 .quirks = MT_QUIRK_NOT_SEEN_MEANS_UP |
@@ -682,12 +695,10 @@ static int mt_probe(struct hid_device *hdev, const struct hid_device_id *id)
682 struct mt_device *td; 695 struct mt_device *td;
683 struct mt_class *mtclass = mt_classes; /* MT_CLS_DEFAULT */ 696 struct mt_class *mtclass = mt_classes; /* MT_CLS_DEFAULT */
684 697
685 if (id) { 698 for (i = 0; mt_classes[i].name ; i++) {
686 for (i = 0; mt_classes[i].name ; i++) { 699 if (id->driver_data == mt_classes[i].name) {
687 if (id->driver_data == mt_classes[i].name) { 700 mtclass = &(mt_classes[i]);
688 mtclass = &(mt_classes[i]); 701 break;
689 break;
690 }
691 } 702 }
692 } 703 }
693 704
@@ -747,6 +758,32 @@ static int mt_reset_resume(struct hid_device *hdev)
747 mt_set_input_mode(hdev); 758 mt_set_input_mode(hdev);
748 return 0; 759 return 0;
749} 760}
761
762static int mt_resume(struct hid_device *hdev)
763{
764 struct usb_interface *intf;
765 struct usb_host_interface *interface;
766 struct usb_device *dev;
767
768 if (hdev->bus != BUS_USB)
769 return 0;
770
771 intf = to_usb_interface(hdev->dev.parent);
772 interface = intf->cur_altsetting;
773 dev = hid_to_usb_dev(hdev);
774
775 /* Some Elan legacy devices require SET_IDLE to be set on resume.
776 * It should be safe to send it to other devices too.
777 * Tested on 3M, Stantum, Cypress, Zytronic, eGalax, and Elan panels. */
778
779 usb_control_msg(dev, usb_sndctrlpipe(dev, 0),
780 HID_REQ_SET_IDLE,
781 USB_TYPE_CLASS | USB_RECIP_INTERFACE,
782 0, interface->desc.bInterfaceNumber,
783 NULL, 0, USB_CTRL_SET_TIMEOUT);
784
785 return 0;
786}
750#endif 787#endif
751 788
752static void mt_remove(struct hid_device *hdev) 789static void mt_remove(struct hid_device *hdev)
@@ -864,7 +901,19 @@ static const struct hid_device_id mt_devices[] = {
864 USB_DEVICE_ID_DWAV_EGALAX_MULTITOUCH_7349) }, 901 USB_DEVICE_ID_DWAV_EGALAX_MULTITOUCH_7349) },
865 { .driver_data = MT_CLS_EGALAX_SERIAL, 902 { .driver_data = MT_CLS_EGALAX_SERIAL,
866 MT_USB_DEVICE(USB_VENDOR_ID_DWAV, 903 MT_USB_DEVICE(USB_VENDOR_ID_DWAV,
904 USB_DEVICE_ID_DWAV_EGALAX_MULTITOUCH_73F7) },
905 { .driver_data = MT_CLS_EGALAX_SERIAL,
906 MT_USB_DEVICE(USB_VENDOR_ID_DWAV,
867 USB_DEVICE_ID_DWAV_EGALAX_MULTITOUCH_A001) }, 907 USB_DEVICE_ID_DWAV_EGALAX_MULTITOUCH_A001) },
908 { .driver_data = MT_CLS_EGALAX,
909 HID_USB_DEVICE(USB_VENDOR_ID_DWAV,
910 USB_DEVICE_ID_DWAV_EGALAX_MULTITOUCH_7224) },
911 { .driver_data = MT_CLS_EGALAX,
912 HID_USB_DEVICE(USB_VENDOR_ID_DWAV,
913 USB_DEVICE_ID_DWAV_EGALAX_MULTITOUCH_72D0) },
914 { .driver_data = MT_CLS_EGALAX,
915 HID_USB_DEVICE(USB_VENDOR_ID_DWAV,
916 USB_DEVICE_ID_DWAV_EGALAX_MULTITOUCH_72C4) },
868 917
869 /* Elo TouchSystems IntelliTouch Plus panel */ 918 /* Elo TouchSystems IntelliTouch Plus panel */
870 { .driver_data = MT_CLS_DUAL_NSMU_CONTACTID, 919 { .driver_data = MT_CLS_DUAL_NSMU_CONTACTID,
@@ -877,9 +926,12 @@ static const struct hid_device_id mt_devices[] = {
877 USB_DEVICE_ID_MULTITOUCH_3200) }, 926 USB_DEVICE_ID_MULTITOUCH_3200) },
878 927
879 /* GeneralTouch panel */ 928 /* GeneralTouch panel */
880 { .driver_data = MT_CLS_DUAL_INRANGE_CONTACTNUMBER, 929 { .driver_data = MT_CLS_GENERALTOUCH_TWOFINGERS,
881 MT_USB_DEVICE(USB_VENDOR_ID_GENERAL_TOUCH, 930 MT_USB_DEVICE(USB_VENDOR_ID_GENERAL_TOUCH,
882 USB_DEVICE_ID_GENERAL_TOUCH_WIN7_TWOFINGERS) }, 931 USB_DEVICE_ID_GENERAL_TOUCH_WIN7_TWOFINGERS) },
932 { .driver_data = MT_CLS_GENERALTOUCH_PWT_TENFINGERS,
933 MT_USB_DEVICE(USB_VENDOR_ID_GENERAL_TOUCH,
934 USB_DEVICE_ID_GENERAL_TOUCH_WIN8_PWT_TENFINGERS) },
883 935
884 /* Gametel game controller */ 936 /* Gametel game controller */
885 { .driver_data = MT_CLS_DEFAULT, 937 { .driver_data = MT_CLS_DEFAULT,
@@ -1077,6 +1129,7 @@ static struct hid_driver mt_driver = {
1077 .event = mt_event, 1129 .event = mt_event,
1078#ifdef CONFIG_PM 1130#ifdef CONFIG_PM
1079 .reset_resume = mt_reset_resume, 1131 .reset_resume = mt_reset_resume,
1132 .resume = mt_resume,
1080#endif 1133#endif
1081}; 1134};
1082 1135