aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOndrej Zary <linux@rainbow-software.org>2010-02-04 02:46:48 -0500
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2010-02-04 03:21:45 -0500
commitfea4d14b69567e134e1838155a5dc857ebca70cb (patch)
tree3828fc303026590e9d057357147fb93af1e268dd
parent76cdc083f4d1a2a12a961634672fb9ca7adca29c (diff)
Input: usbtouchscreen - convert from usb_device to usb_interface
Convert usbtouchscreen from storing usb_device to usb_interface. This is needed for multi-interface touchscreen devices such as iNexio. Signed-off-by: Ondrej Zary <linux@rainbow-software.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
-rw-r--r--drivers/input/touchscreen/usbtouchscreen.c22
1 files changed, 12 insertions, 10 deletions
diff --git a/drivers/input/touchscreen/usbtouchscreen.c b/drivers/input/touchscreen/usbtouchscreen.c
index b1b99e931f80..69be77118884 100644
--- a/drivers/input/touchscreen/usbtouchscreen.c
+++ b/drivers/input/touchscreen/usbtouchscreen.c
@@ -104,7 +104,7 @@ struct usbtouch_usb {
104 unsigned char *buffer; 104 unsigned char *buffer;
105 int buf_len; 105 int buf_len;
106 struct urb *irq; 106 struct urb *irq;
107 struct usb_device *udev; 107 struct usb_interface *interface;
108 struct input_dev *input; 108 struct input_dev *input;
109 struct usbtouch_device_info *type; 109 struct usbtouch_device_info *type;
110 char name[128]; 110 char name[128];
@@ -234,8 +234,9 @@ static const struct usb_device_id usbtouch_devices[] = {
234static int e2i_init(struct usbtouch_usb *usbtouch) 234static int e2i_init(struct usbtouch_usb *usbtouch)
235{ 235{
236 int ret; 236 int ret;
237 struct usb_device *udev = interface_to_usbdev(usbtouch->interface);
237 238
238 ret = usb_control_msg(usbtouch->udev, usb_rcvctrlpipe(usbtouch->udev, 0), 239 ret = usb_control_msg(udev, usb_rcvctrlpipe(udev, 0),
239 0x01, 0x02, 0x0000, 0x0081, 240 0x01, 0x02, 0x0000, 0x0081,
240 NULL, 0, USB_CTRL_SET_TIMEOUT); 241 NULL, 0, USB_CTRL_SET_TIMEOUT);
241 242
@@ -344,8 +345,9 @@ static int mtouch_read_data(struct usbtouch_usb *dev, unsigned char *pkt)
344static int mtouch_init(struct usbtouch_usb *usbtouch) 345static int mtouch_init(struct usbtouch_usb *usbtouch)
345{ 346{
346 int ret, i; 347 int ret, i;
348 struct usb_device *udev = interface_to_usbdev(usbtouch->interface);
347 349
348 ret = usb_control_msg(usbtouch->udev, usb_rcvctrlpipe(usbtouch->udev, 0), 350 ret = usb_control_msg(udev, usb_rcvctrlpipe(udev, 0),
349 MTOUCHUSB_RESET, 351 MTOUCHUSB_RESET,
350 USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE, 352 USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
351 1, 0, NULL, 0, USB_CTRL_SET_TIMEOUT); 353 1, 0, NULL, 0, USB_CTRL_SET_TIMEOUT);
@@ -356,7 +358,7 @@ static int mtouch_init(struct usbtouch_usb *usbtouch)
356 msleep(150); 358 msleep(150);
357 359
358 for (i = 0; i < 3; i++) { 360 for (i = 0; i < 3; i++) {
359 ret = usb_control_msg(usbtouch->udev, usb_rcvctrlpipe(usbtouch->udev, 0), 361 ret = usb_control_msg(udev, usb_rcvctrlpipe(udev, 0),
360 MTOUCHUSB_ASYNC_REPORT, 362 MTOUCHUSB_ASYNC_REPORT,
361 USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE, 363 USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
362 1, 1, NULL, 0, USB_CTRL_SET_TIMEOUT); 364 1, 1, NULL, 0, USB_CTRL_SET_TIMEOUT);
@@ -489,7 +491,7 @@ static int gunze_read_data(struct usbtouch_usb *dev, unsigned char *pkt)
489 491
490static int dmc_tsc10_init(struct usbtouch_usb *usbtouch) 492static int dmc_tsc10_init(struct usbtouch_usb *usbtouch)
491{ 493{
492 struct usb_device *dev = usbtouch->udev; 494 struct usb_device *dev = interface_to_usbdev(usbtouch->interface);
493 int ret = -ENOMEM; 495 int ret = -ENOMEM;
494 unsigned char *buf; 496 unsigned char *buf;
495 497
@@ -1021,7 +1023,7 @@ static int usbtouch_open(struct input_dev *input)
1021{ 1023{
1022 struct usbtouch_usb *usbtouch = input_get_drvdata(input); 1024 struct usbtouch_usb *usbtouch = input_get_drvdata(input);
1023 1025
1024 usbtouch->irq->dev = usbtouch->udev; 1026 usbtouch->irq->dev = interface_to_usbdev(usbtouch->interface);
1025 1027
1026 if (!usbtouch->type->irq_always) { 1028 if (!usbtouch->type->irq_always) {
1027 if (usb_submit_urb(usbtouch->irq, GFP_KERNEL)) 1029 if (usb_submit_urb(usbtouch->irq, GFP_KERNEL))
@@ -1094,7 +1096,7 @@ static int usbtouch_probe(struct usb_interface *intf,
1094 goto out_free_buffers; 1096 goto out_free_buffers;
1095 } 1097 }
1096 1098
1097 usbtouch->udev = udev; 1099 usbtouch->interface = intf;
1098 usbtouch->input = input_dev; 1100 usbtouch->input = input_dev;
1099 1101
1100 if (udev->manufacturer) 1102 if (udev->manufacturer)
@@ -1133,12 +1135,12 @@ static int usbtouch_probe(struct usb_interface *intf,
1133 input_set_abs_params(input_dev, ABS_PRESSURE, type->min_press, 1135 input_set_abs_params(input_dev, ABS_PRESSURE, type->min_press,
1134 type->max_press, 0, 0); 1136 type->max_press, 0, 0);
1135 1137
1136 usb_fill_int_urb(usbtouch->irq, usbtouch->udev, 1138 usb_fill_int_urb(usbtouch->irq, udev,
1137 usb_rcvintpipe(usbtouch->udev, endpoint->bEndpointAddress), 1139 usb_rcvintpipe(udev, endpoint->bEndpointAddress),
1138 usbtouch->data, type->rept_size, 1140 usbtouch->data, type->rept_size,
1139 usbtouch_irq, usbtouch, endpoint->bInterval); 1141 usbtouch_irq, usbtouch, endpoint->bInterval);
1140 1142
1141 usbtouch->irq->dev = usbtouch->udev; 1143 usbtouch->irq->dev = udev;
1142 usbtouch->irq->transfer_dma = usbtouch->data_dma; 1144 usbtouch->irq->transfer_dma = usbtouch->data_dma;
1143 usbtouch->irq->transfer_flags |= URB_NO_TRANSFER_DMA_MAP; 1145 usbtouch->irq->transfer_flags |= URB_NO_TRANSFER_DMA_MAP;
1144 1146