Skip to content

Commit

Permalink
Input: xpad - use proper endpoint type
Browse files Browse the repository at this point in the history
The xpad wireless endpoint is not a bulk endpoint on my devices, but
rather an interrupt one, so the USB core complains when it is submitted.
I'm guessing that the author really did mean that this should be an
interrupt urb, but as there are a zillion different xpad devices out
there, let's cover out bases and handle both bulk and interrupt
endpoints just as easily.

Signed-off-by: "Pierre-Loup A. Griffais" <pgriffais@valvesoftware.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
  • Loading branch information
Greg Kroah-Hartman authored and Dmitry Torokhov committed Nov 25, 2014
1 parent d0ab547 commit a1f9a40
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions drivers/input/joystick/xpad.c
Original file line number Diff line number Diff line change
Expand Up @@ -1179,9 +1179,19 @@ static int xpad_probe(struct usb_interface *intf, const struct usb_device_id *id
}

ep_irq_in = &intf->cur_altsetting->endpoint[1].desc;
usb_fill_bulk_urb(xpad->bulk_out, udev,
usb_sndbulkpipe(udev, ep_irq_in->bEndpointAddress),
xpad->bdata, XPAD_PKT_LEN, xpad_bulk_out, xpad);
if (usb_endpoint_is_bulk_out(ep_irq_in)) {
usb_fill_bulk_urb(xpad->bulk_out, udev,
usb_sndbulkpipe(udev,
ep_irq_in->bEndpointAddress),
xpad->bdata, XPAD_PKT_LEN,
xpad_bulk_out, xpad);
} else {
usb_fill_int_urb(xpad->bulk_out, udev,
usb_sndintpipe(udev,
ep_irq_in->bEndpointAddress),
xpad->bdata, XPAD_PKT_LEN,
xpad_bulk_out, xpad, 0);
}

/*
* Submit the int URB immediately rather than waiting for open
Expand Down

0 comments on commit a1f9a40

Please sign in to comment.