diff options
author | Jiri Kosina <jkosina@suse.cz> | 2012-10-01 08:38:54 -0400 |
---|---|---|
committer | Jiri Kosina <jkosina@suse.cz> | 2012-10-01 08:38:54 -0400 |
commit | cdcd3ac4e945d1fcaef9907839569c2d70b2f3fa (patch) | |
tree | 46673a3c432958a4f712b064ddb9b645771cc0c3 /drivers/hid | |
parent | a3cbe10e474ac8c2c30a151a7812e15e4cfa2775 (diff) | |
parent | f5ff4e1e62408327d27fb1e1ab00e96a52b7cd46 (diff) |
Merge branch 'multitouch' into for-linus
Conflicts:
drivers/hid/hid-multitouch.c
Diffstat (limited to 'drivers/hid')
-rw-r--r-- | drivers/hid/hid-ids.h | 5 | ||||
-rw-r--r-- | drivers/hid/hid-multitouch.c | 67 |
2 files changed, 65 insertions, 7 deletions
diff --git a/drivers/hid/hid-ids.h b/drivers/hid/hid-ids.h index c1da94a81a0d..ca4d83e6e387 100644 --- a/drivers/hid/hid-ids.h +++ b/drivers/hid/hid-ids.h | |||
@@ -268,7 +268,11 @@ | |||
268 | #define USB_DEVICE_ID_DWAV_EGALAX_MULTITOUCH_72FA 0x72fa | 268 | #define USB_DEVICE_ID_DWAV_EGALAX_MULTITOUCH_72FA 0x72fa |
269 | #define USB_DEVICE_ID_DWAV_EGALAX_MULTITOUCH_7302 0x7302 | 269 | #define USB_DEVICE_ID_DWAV_EGALAX_MULTITOUCH_7302 0x7302 |
270 | #define USB_DEVICE_ID_DWAV_EGALAX_MULTITOUCH_7349 0x7349 | 270 | #define USB_DEVICE_ID_DWAV_EGALAX_MULTITOUCH_7349 0x7349 |
271 | #define USB_DEVICE_ID_DWAV_EGALAX_MULTITOUCH_73F7 0x73f7 | ||
271 | #define USB_DEVICE_ID_DWAV_EGALAX_MULTITOUCH_A001 0xa001 | 272 | #define USB_DEVICE_ID_DWAV_EGALAX_MULTITOUCH_A001 0xa001 |
273 | #define USB_DEVICE_ID_DWAV_EGALAX_MULTITOUCH_7224 0x7224 | ||
274 | #define USB_DEVICE_ID_DWAV_EGALAX_MULTITOUCH_72D0 0x72d0 | ||
275 | #define USB_DEVICE_ID_DWAV_EGALAX_MULTITOUCH_72C4 0x72c4 | ||
272 | 276 | ||
273 | #define USB_VENDOR_ID_ELECOM 0x056e | 277 | #define USB_VENDOR_ID_ELECOM 0x056e |
274 | #define USB_DEVICE_ID_ELECOM_BM084 0x0061 | 278 | #define USB_DEVICE_ID_ELECOM_BM084 0x0061 |
@@ -310,6 +314,7 @@ | |||
310 | 314 | ||
311 | #define USB_VENDOR_ID_GENERAL_TOUCH 0x0dfc | 315 | #define USB_VENDOR_ID_GENERAL_TOUCH 0x0dfc |
312 | #define USB_DEVICE_ID_GENERAL_TOUCH_WIN7_TWOFINGERS 0x0003 | 316 | #define USB_DEVICE_ID_GENERAL_TOUCH_WIN7_TWOFINGERS 0x0003 |
317 | #define USB_DEVICE_ID_GENERAL_TOUCH_WIN8_PWT_TENFINGERS 0x0100 | ||
313 | 318 | ||
314 | #define USB_VENDOR_ID_GLAB 0x06c2 | 319 | #define USB_VENDOR_ID_GLAB 0x06c2 |
315 | #define USB_DEVICE_ID_4_PHIDGETSERVO_30 0x0038 | 320 | #define USB_DEVICE_ID_4_PHIDGETSERVO_30 0x0038 |
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 | |||
762 | static 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 | ||
752 | static void mt_remove(struct hid_device *hdev) | 789 | static 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 | ||