Skip to content

Commit 41e8102

Browse files
jhovolddtor
authored andcommitted
Input: usbtouchscreen - fix control-request directions
The direction of the pipe argument must match the request-type direction bit or control requests may fail depending on the host-controller-driver implementation. Fix the four control requests which erroneously used usb_rcvctrlpipe(). Fixes: 1d3e202 ("[PATCH] USB: usbtouchscreen: unified USB touchscreen driver") Fixes: 24ced06 ("usbtouchscreen: add support for DMC TSC-10/25 devices") Fixes: 9e3b258 ("Input: usbtouchscreen - add support for e2i touchscreen controller") Signed-off-by: Johan Hovold <[email protected]> Cc: [email protected] # 2.6.17 Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Dmitry Torokhov <[email protected]>
1 parent 05665ce commit 41e8102

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

drivers/input/touchscreen/usbtouchscreen.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ static int e2i_init(struct usbtouch_usb *usbtouch)
251251
int ret;
252252
struct usb_device *udev = interface_to_usbdev(usbtouch->interface);
253253

254-
ret = usb_control_msg(udev, usb_rcvctrlpipe(udev, 0),
254+
ret = usb_control_msg(udev, usb_sndctrlpipe(udev, 0),
255255
0x01, 0x02, 0x0000, 0x0081,
256256
NULL, 0, USB_CTRL_SET_TIMEOUT);
257257

@@ -531,7 +531,7 @@ static int mtouch_init(struct usbtouch_usb *usbtouch)
531531
if (ret)
532532
return ret;
533533

534-
ret = usb_control_msg(udev, usb_rcvctrlpipe(udev, 0),
534+
ret = usb_control_msg(udev, usb_sndctrlpipe(udev, 0),
535535
MTOUCHUSB_RESET,
536536
USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
537537
1, 0, NULL, 0, USB_CTRL_SET_TIMEOUT);
@@ -543,7 +543,7 @@ static int mtouch_init(struct usbtouch_usb *usbtouch)
543543
msleep(150);
544544

545545
for (i = 0; i < 3; i++) {
546-
ret = usb_control_msg(udev, usb_rcvctrlpipe(udev, 0),
546+
ret = usb_control_msg(udev, usb_sndctrlpipe(udev, 0),
547547
MTOUCHUSB_ASYNC_REPORT,
548548
USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
549549
1, 1, NULL, 0, USB_CTRL_SET_TIMEOUT);
@@ -722,7 +722,7 @@ static int dmc_tsc10_init(struct usbtouch_usb *usbtouch)
722722
}
723723

724724
/* start sending data */
725-
ret = usb_control_msg(dev, usb_rcvctrlpipe (dev, 0),
725+
ret = usb_control_msg(dev, usb_sndctrlpipe(dev, 0),
726726
TSC10_CMD_DATA1,
727727
USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
728728
0, 0, NULL, 0, USB_CTRL_SET_TIMEOUT);

0 commit comments

Comments
 (0)