diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2008-07-21 13:27:31 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-07-21 13:27:31 -0400 |
commit | 519f0141f1c42e2b8b59c7dea005cbf6095358e8 (patch) | |
tree | 980e39f30a8b8677916a9bddee675ed0d0123d81 /drivers/input/touchscreen/usbtouchscreen.c | |
parent | f8b71a3a92d69cb1c9c2162f9235d3dd550e4aa0 (diff) | |
parent | 908cf4b925e419bc74f3297b2f0e51d6f8a81da2 (diff) |
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input: (48 commits)
Input: add switch for dock events
Input: add microphone insert switch definition
Input: i8042 - add Arima-Rioworks HDAMB board to noloop list
Input: sgi_btns - add support for SGI Indy volume buttons
Input: add option to disable HP SDC driver
Input: serio - trivial documentation fix
Input: add new serio driver for Xilinx XPS PS2 IP
Input: add driver for Tabletkiosk Sahara TouchIT-213 touchscreen
Input: new driver for SGI O2 volume buttons
Input: yealink - reliably kill urbs
Input: q40kbd - make q40kbd_lock static
Input: gtco - eliminate early return
Input: i8042 - add Dritek quirk for Acer Aspire 5720
Input: usbtouchscreen - ignore eGalax screens supporting HID protocol
Input: i8042 - add Medion NAM 2070 to noloop blacklist
Input: i8042 - add Gericom Bellagio to nomux blacklist
Input: i8042 - add Acer Aspire 1360 to nomux blacklist
Input: hp_sdc_mlc.c - make a struct static
Input: hil_mlc.c - make code static
Input: wistron - generate normal key event if bluetooth or wifi not present
...
Diffstat (limited to 'drivers/input/touchscreen/usbtouchscreen.c')
-rw-r--r-- | drivers/input/touchscreen/usbtouchscreen.c | 42 |
1 files changed, 30 insertions, 12 deletions
diff --git a/drivers/input/touchscreen/usbtouchscreen.c b/drivers/input/touchscreen/usbtouchscreen.c index 3a0a8ca57076..fdd645c214a2 100644 --- a/drivers/input/touchscreen/usbtouchscreen.c +++ b/drivers/input/touchscreen/usbtouchscreen.c | |||
@@ -49,6 +49,7 @@ | |||
49 | #include <linux/init.h> | 49 | #include <linux/init.h> |
50 | #include <linux/usb.h> | 50 | #include <linux/usb.h> |
51 | #include <linux/usb/input.h> | 51 | #include <linux/usb/input.h> |
52 | #include <linux/hid.h> | ||
52 | 53 | ||
53 | 54 | ||
54 | #define DRIVER_VERSION "v0.6" | 55 | #define DRIVER_VERSION "v0.6" |
@@ -101,7 +102,7 @@ struct usbtouch_usb { | |||
101 | 102 | ||
102 | /* device types */ | 103 | /* device types */ |
103 | enum { | 104 | enum { |
104 | DEVTPYE_DUMMY = -1, | 105 | DEVTYPE_IGNORE = -1, |
105 | DEVTYPE_EGALAX, | 106 | DEVTYPE_EGALAX, |
106 | DEVTYPE_PANJIT, | 107 | DEVTYPE_PANJIT, |
107 | DEVTYPE_3M, | 108 | DEVTYPE_3M, |
@@ -115,8 +116,21 @@ enum { | |||
115 | DEVTYPE_GOTOP, | 116 | DEVTYPE_GOTOP, |
116 | }; | 117 | }; |
117 | 118 | ||
119 | #define USB_DEVICE_HID_CLASS(vend, prod) \ | ||
120 | .match_flags = USB_DEVICE_ID_MATCH_INT_CLASS \ | ||
121 | | USB_DEVICE_ID_MATCH_DEVICE, \ | ||
122 | .idVendor = (vend), \ | ||
123 | .idProduct = (prod), \ | ||
124 | .bInterfaceClass = USB_INTERFACE_CLASS_HID, \ | ||
125 | .bInterfaceProtocol = USB_INTERFACE_PROTOCOL_MOUSE | ||
126 | |||
118 | static struct usb_device_id usbtouch_devices[] = { | 127 | static struct usb_device_id usbtouch_devices[] = { |
119 | #ifdef CONFIG_TOUCHSCREEN_USB_EGALAX | 128 | #ifdef CONFIG_TOUCHSCREEN_USB_EGALAX |
129 | /* ignore the HID capable devices, handled by usbhid */ | ||
130 | {USB_DEVICE_HID_CLASS(0x0eef, 0x0001), .driver_info = DEVTYPE_IGNORE}, | ||
131 | {USB_DEVICE_HID_CLASS(0x0eef, 0x0002), .driver_info = DEVTYPE_IGNORE}, | ||
132 | |||
133 | /* normal device IDs */ | ||
120 | {USB_DEVICE(0x3823, 0x0001), .driver_info = DEVTYPE_EGALAX}, | 134 | {USB_DEVICE(0x3823, 0x0001), .driver_info = DEVTYPE_EGALAX}, |
121 | {USB_DEVICE(0x3823, 0x0002), .driver_info = DEVTYPE_EGALAX}, | 135 | {USB_DEVICE(0x3823, 0x0002), .driver_info = DEVTYPE_EGALAX}, |
122 | {USB_DEVICE(0x0123, 0x0001), .driver_info = DEVTYPE_EGALAX}, | 136 | {USB_DEVICE(0x0123, 0x0001), .driver_info = DEVTYPE_EGALAX}, |
@@ -262,7 +276,7 @@ static int mtouch_init(struct usbtouch_usb *usbtouch) | |||
262 | USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE, | 276 | USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE, |
263 | 1, 0, NULL, 0, USB_CTRL_SET_TIMEOUT); | 277 | 1, 0, NULL, 0, USB_CTRL_SET_TIMEOUT); |
264 | dbg("%s - usb_control_msg - MTOUCHUSB_RESET - bytes|err: %d", | 278 | dbg("%s - usb_control_msg - MTOUCHUSB_RESET - bytes|err: %d", |
265 | __FUNCTION__, ret); | 279 | __func__, ret); |
266 | if (ret < 0) | 280 | if (ret < 0) |
267 | return ret; | 281 | return ret; |
268 | msleep(150); | 282 | msleep(150); |
@@ -273,7 +287,7 @@ static int mtouch_init(struct usbtouch_usb *usbtouch) | |||
273 | USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE, | 287 | USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE, |
274 | 1, 1, NULL, 0, USB_CTRL_SET_TIMEOUT); | 288 | 1, 1, NULL, 0, USB_CTRL_SET_TIMEOUT); |
275 | dbg("%s - usb_control_msg - MTOUCHUSB_ASYNC_REPORT - bytes|err: %d", | 289 | dbg("%s - usb_control_msg - MTOUCHUSB_ASYNC_REPORT - bytes|err: %d", |
276 | __FUNCTION__, ret); | 290 | __func__, ret); |
277 | if (ret >= 0) | 291 | if (ret >= 0) |
278 | break; | 292 | break; |
279 | if (ret != -EPIPE) | 293 | if (ret != -EPIPE) |
@@ -793,18 +807,18 @@ static void usbtouch_irq(struct urb *urb) | |||
793 | case -ETIME: | 807 | case -ETIME: |
794 | /* this urb is timing out */ | 808 | /* this urb is timing out */ |
795 | dbg("%s - urb timed out - was the device unplugged?", | 809 | dbg("%s - urb timed out - was the device unplugged?", |
796 | __FUNCTION__); | 810 | __func__); |
797 | return; | 811 | return; |
798 | case -ECONNRESET: | 812 | case -ECONNRESET: |
799 | case -ENOENT: | 813 | case -ENOENT: |
800 | case -ESHUTDOWN: | 814 | case -ESHUTDOWN: |
801 | /* this urb is terminated, clean up */ | 815 | /* this urb is terminated, clean up */ |
802 | dbg("%s - urb shutting down with status: %d", | 816 | dbg("%s - urb shutting down with status: %d", |
803 | __FUNCTION__, urb->status); | 817 | __func__, urb->status); |
804 | return; | 818 | return; |
805 | default: | 819 | default: |
806 | dbg("%s - nonzero urb status received: %d", | 820 | dbg("%s - nonzero urb status received: %d", |
807 | __FUNCTION__, urb->status); | 821 | __func__, urb->status); |
808 | goto exit; | 822 | goto exit; |
809 | } | 823 | } |
810 | 824 | ||
@@ -814,7 +828,7 @@ exit: | |||
814 | retval = usb_submit_urb(urb, GFP_ATOMIC); | 828 | retval = usb_submit_urb(urb, GFP_ATOMIC); |
815 | if (retval) | 829 | if (retval) |
816 | err("%s - usb_submit_urb failed with result: %d", | 830 | err("%s - usb_submit_urb failed with result: %d", |
817 | __FUNCTION__, retval); | 831 | __func__, retval); |
818 | } | 832 | } |
819 | 833 | ||
820 | static int usbtouch_open(struct input_dev *input) | 834 | static int usbtouch_open(struct input_dev *input) |
@@ -857,6 +871,10 @@ static int usbtouch_probe(struct usb_interface *intf, | |||
857 | struct usbtouch_device_info *type; | 871 | struct usbtouch_device_info *type; |
858 | int err = -ENOMEM; | 872 | int err = -ENOMEM; |
859 | 873 | ||
874 | /* some devices are ignored */ | ||
875 | if (id->driver_info == DEVTYPE_IGNORE) | ||
876 | return -ENODEV; | ||
877 | |||
860 | interface = intf->cur_altsetting; | 878 | interface = intf->cur_altsetting; |
861 | endpoint = &interface->endpoint[0].desc; | 879 | endpoint = &interface->endpoint[0].desc; |
862 | 880 | ||
@@ -883,7 +901,7 @@ static int usbtouch_probe(struct usb_interface *intf, | |||
883 | 901 | ||
884 | usbtouch->irq = usb_alloc_urb(0, GFP_KERNEL); | 902 | usbtouch->irq = usb_alloc_urb(0, GFP_KERNEL); |
885 | if (!usbtouch->irq) { | 903 | if (!usbtouch->irq) { |
886 | dbg("%s - usb_alloc_urb failed: usbtouch->irq", __FUNCTION__); | 904 | dbg("%s - usb_alloc_urb failed: usbtouch->irq", __func__); |
887 | goto out_free_buffers; | 905 | goto out_free_buffers; |
888 | } | 906 | } |
889 | 907 | ||
@@ -939,14 +957,14 @@ static int usbtouch_probe(struct usb_interface *intf, | |||
939 | if (type->init) { | 957 | if (type->init) { |
940 | err = type->init(usbtouch); | 958 | err = type->init(usbtouch); |
941 | if (err) { | 959 | if (err) { |
942 | dbg("%s - type->init() failed, err: %d", __FUNCTION__, err); | 960 | dbg("%s - type->init() failed, err: %d", __func__, err); |
943 | goto out_free_buffers; | 961 | goto out_free_buffers; |
944 | } | 962 | } |
945 | } | 963 | } |
946 | 964 | ||
947 | err = input_register_device(usbtouch->input); | 965 | err = input_register_device(usbtouch->input); |
948 | if (err) { | 966 | if (err) { |
949 | dbg("%s - input_register_device failed, err: %d", __FUNCTION__, err); | 967 | dbg("%s - input_register_device failed, err: %d", __func__, err); |
950 | goto out_free_buffers; | 968 | goto out_free_buffers; |
951 | } | 969 | } |
952 | 970 | ||
@@ -966,12 +984,12 @@ static void usbtouch_disconnect(struct usb_interface *intf) | |||
966 | { | 984 | { |
967 | struct usbtouch_usb *usbtouch = usb_get_intfdata(intf); | 985 | struct usbtouch_usb *usbtouch = usb_get_intfdata(intf); |
968 | 986 | ||
969 | dbg("%s - called", __FUNCTION__); | 987 | dbg("%s - called", __func__); |
970 | 988 | ||
971 | if (!usbtouch) | 989 | if (!usbtouch) |
972 | return; | 990 | return; |
973 | 991 | ||
974 | dbg("%s - usbtouch is initialized, cleaning up", __FUNCTION__); | 992 | dbg("%s - usbtouch is initialized, cleaning up", __func__); |
975 | usb_set_intfdata(intf, NULL); | 993 | usb_set_intfdata(intf, NULL); |
976 | usb_kill_urb(usbtouch->irq); | 994 | usb_kill_urb(usbtouch->irq); |
977 | input_unregister_device(usbtouch->input); | 995 | input_unregister_device(usbtouch->input); |