diff options
| author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-01-29 10:30:34 -0800 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-01-29 10:30:34 -0800 |
| commit | 10b1ffdf895c57ca46e2a667f5351451a92a6151 (patch) | |
| tree | 48b1d17120c23c7c5085d58eb3f3ef4d69cafbb8 | |
| parent | 60f4a5eb555cae492b96dfdaa17cbc7f6da1148c (diff) | |
| download | patches-10b1ffdf895c57ca46e2a667f5351451a92a6151.tar.gz | |
updates to xpad patches
| -rw-r--r-- | defer-input-nodes-and-led-support | 30 | ||||
| -rw-r--r-- | input-xpad-disconnect-all-wireless-controllers-at-init.patch | 2 | ||||
| -rw-r--r-- | input-xpad-handle-present-and-gone-correctly.patch | 20 | ||||
| -rw-r--r-- | input-xpad-move-the-input-device-creation-to-a-new-function.patch | 12 | ||||
| -rw-r--r-- | input-xpad-set-the-correct-led-number.patch | 8 | ||||
| -rw-r--r-- | input-xpad-set-the-leds-properly-on-xbox-wireless-controllers.patch | 4 | ||||
| -rw-r--r-- | input-xpad-use-proper-endpoint-type.patch | 43 | ||||
| -rw-r--r-- | series | 3 |
8 files changed, 86 insertions, 36 deletions
diff --git a/defer-input-nodes-and-led-support b/defer-input-nodes-and-led-support index f17bbfc6eab65f..96b8acc24aaa43 100644 --- a/defer-input-nodes-and-led-support +++ b/defer-input-nodes-and-led-support @@ -6,7 +6,7 @@ --- a/drivers/input/joystick/xpad.c +++ b/drivers/input/joystick/xpad.c -@@ -281,17 +281,21 @@ struct usb_xpad { +@@ -282,17 +282,21 @@ struct usb_xpad { struct urb *irq_out; /* urb for interrupt out report */ unsigned char *odata; /* output data */ dma_addr_t odata_dma; @@ -29,7 +29,7 @@ }; /* -@@ -435,6 +439,109 @@ static void xpad360_process_packet(struc +@@ -436,6 +440,109 @@ static void xpad360_process_packet(struc input_sync(dev); } @@ -139,7 +139,7 @@ /* * xpad360w_process_packet -@@ -456,12 +563,32 @@ static void xpad360w_process_packet(stru +@@ -457,12 +564,32 @@ static void xpad360w_process_packet(stru /* Presence change */ if (data[0] & 0x08) { if (data[1] & 0x80) { @@ -176,7 +176,7 @@ /* Valid pad data */ if (!(data[1] & 0x1)) return; -@@ -584,8 +711,6 @@ static int xpad_init_output(struct usb_i +@@ -585,8 +712,6 @@ static int xpad_init_output(struct usb_i goto fail1; } @@ -185,7 +185,7 @@ xpad->irq_out = usb_alloc_urb(0, GFP_KERNEL); if (!xpad->irq_out) { error = -ENOMEM; -@@ -717,7 +842,7 @@ static void xpad_send_led_command(struct +@@ -718,7 +843,7 @@ static void xpad_send_led_command(struct if (command > 15) return; @@ -194,7 +194,7 @@ switch (xpad->xtype) { case XTYPE_XBOX360: -@@ -744,7 +869,7 @@ static void xpad_send_led_command(struct +@@ -745,7 +870,7 @@ static void xpad_send_led_command(struct } usb_submit_urb(xpad->irq_out, GFP_KERNEL); @@ -203,7 +203,7 @@ } static void xpad_led_set(struct led_classdev *led_cdev, -@@ -787,11 +912,6 @@ static int xpad_led_probe(struct usb_xpa +@@ -788,11 +913,6 @@ static int xpad_led_probe(struct usb_xpa return error; } @@ -215,7 +215,7 @@ return 0; } -@@ -813,6 +933,7 @@ static void xpad_led_disconnect(struct u +@@ -814,6 +934,7 @@ static void xpad_led_disconnect(struct u static int xpad_open(struct input_dev *dev) { struct usb_xpad *xpad = input_get_drvdata(dev); @@ -223,7 +223,7 @@ /* URB was submitted in probe */ if (xpad->xtype == XTYPE_XBOX360W) -@@ -861,9 +982,13 @@ static int xpad_probe(struct usb_interfa +@@ -862,9 +983,13 @@ static int xpad_probe(struct usb_interfa { struct usb_device *udev = interface_to_usbdev(intf); struct usb_xpad *xpad; @@ -238,7 +238,7 @@ for (i = 0; xpad_device[i].idVendor; i++) { if ((le16_to_cpu(udev->descriptor.idVendor) == xpad_device[i].idVendor) && -@@ -872,11 +997,8 @@ static int xpad_probe(struct usb_interfa +@@ -873,11 +998,8 @@ static int xpad_probe(struct usb_interfa } xpad = kzalloc(sizeof(struct usb_xpad), GFP_KERNEL); @@ -252,7 +252,7 @@ xpad->idata = usb_alloc_coherent(udev, XPAD_PKT_LEN, GFP_KERNEL, &xpad->idata_dma); -@@ -913,65 +1035,12 @@ static int xpad_probe(struct usb_interfa +@@ -914,65 +1036,12 @@ static int xpad_probe(struct usb_interfa xpad->mapping |= MAP_STICKS_TO_NULL; } @@ -320,7 +320,7 @@ error = xpad_led_probe(xpad); if (error) -@@ -985,10 +1054,6 @@ static int xpad_probe(struct usb_interfa +@@ -986,10 +1055,6 @@ static int xpad_probe(struct usb_interfa xpad->irq_in->transfer_dma = xpad->idata_dma; xpad->irq_in->transfer_flags |= URB_NO_TRANSFER_DMA_MAP; @@ -331,7 +331,7 @@ usb_set_intfdata(intf, xpad); if (xpad->xtype == XTYPE_XBOX360W) { -@@ -996,6 +1061,7 @@ static int xpad_probe(struct usb_interfa +@@ -997,6 +1062,7 @@ static int xpad_probe(struct usb_interfa * Setup the message to set the LEDs on the * controller when it shows up */ @@ -339,7 +339,7 @@ xpad->bulk_out = usb_alloc_urb(0, GFP_KERNEL); if (!xpad->bulk_out) { error = -ENOMEM; -@@ -1037,23 +1103,55 @@ static int xpad_probe(struct usb_interfa +@@ -1048,23 +1114,55 @@ static int xpad_probe(struct usb_interfa */ xpad->irq_in->dev = xpad->udev; error = usb_submit_urb(xpad->irq_in, GFP_KERNEL); @@ -400,7 +400,7 @@ kfree(xpad); return error; -@@ -1063,8 +1161,13 @@ static void xpad_disconnect(struct usb_i +@@ -1074,8 +1172,13 @@ static void xpad_disconnect(struct usb_i { struct usb_xpad *xpad = usb_get_intfdata (intf); diff --git a/input-xpad-disconnect-all-wireless-controllers-at-init.patch b/input-xpad-disconnect-all-wireless-controllers-at-init.patch index 36cc4ae77aba77..b985e6ff88dc9d 100644 --- a/input-xpad-disconnect-all-wireless-controllers-at-init.patch +++ b/input-xpad-disconnect-all-wireless-controllers-at-init.patch @@ -25,7 +25,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> --- a/drivers/input/joystick/xpad.c +++ b/drivers/input/joystick/xpad.c -@@ -1074,11 +1074,41 @@ static int xpad_probe(struct usb_interfa +@@ -1085,11 +1085,41 @@ static int xpad_probe(struct usb_interfa usb_kill_urb(xpad->irq_in); goto fail9; } diff --git a/input-xpad-handle-present-and-gone-correctly.patch b/input-xpad-handle-present-and-gone-correctly.patch index 076f6c7c753f9a..d9770b60c24d46 100644 --- a/input-xpad-handle-present-and-gone-correctly.patch +++ b/input-xpad-handle-present-and-gone-correctly.patch @@ -15,12 +15,12 @@ Also properly disconnect any devices that we are told are removed. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> --- - drivers/input/joystick/xpad.c | 37 ++++++++++++++++++++++++++++++++----- - 1 file changed, 32 insertions(+), 5 deletions(-) + drivers/input/joystick/xpad.c | 36 +++++++++++++++++++++++++++++++----- + 1 file changed, 31 insertions(+), 5 deletions(-) --- a/drivers/input/joystick/xpad.c +++ b/drivers/input/joystick/xpad.c -@@ -294,8 +294,11 @@ struct usb_xpad { +@@ -295,8 +295,11 @@ struct usb_xpad { int xtype; /* type of xbox device */ int joydev_id; /* the minor of the device */ const char *name; /* name of the device */ @@ -32,7 +32,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> /* * xpad_process_packet * -@@ -438,6 +441,22 @@ static void xpad360_process_packet(struc +@@ -439,6 +442,22 @@ static void xpad360_process_packet(struc input_sync(dev); } @@ -55,7 +55,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> /* * xpad360w_process_packet * -@@ -452,16 +471,24 @@ static void xpad360_process_packet(struc +@@ -453,16 +472,22 @@ static void xpad360_process_packet(struc * 01.1 - Pad state (Bytes 4+) valid * */ @@ -72,16 +72,22 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> + if (!xpad->pad_present) { + xpad->pad_present = 1; + usb_submit_urb(xpad->bulk_out, GFP_ATOMIC); -+ INIT_WORK(&xpad->work, presence_work_function); + schedule_work(&xpad->work); + } + } else { + if (xpad->pad_present) { + xpad->pad_present = 0; -+ INIT_WORK(&xpad->work, presence_work_function); + schedule_work(&xpad->work); + } + } } /* Valid pad data */ +@@ -989,6 +1014,7 @@ static int xpad_probe(struct usb_interfa + xpad->mapping = xpad_device[i].mapping; + xpad->xtype = xpad_device[i].xtype; + xpad->name = xpad_device[i].name; ++ INIT_WORK(&xpad->work, presence_work_function); + + if (xpad->xtype == XTYPE_UNKNOWN) { + if (intf->cur_altsetting->desc.bInterfaceClass == USB_CLASS_VENDOR_SPEC) { diff --git a/input-xpad-move-the-input-device-creation-to-a-new-function.patch b/input-xpad-move-the-input-device-creation-to-a-new-function.patch index 62664704be9f46..a9c619a1935e3e 100644 --- a/input-xpad-move-the-input-device-creation-to-a-new-function.patch +++ b/input-xpad-move-the-input-device-creation-to-a-new-function.patch @@ -19,7 +19,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> --- a/drivers/input/joystick/xpad.c +++ b/drivers/input/joystick/xpad.c -@@ -292,6 +292,7 @@ struct usb_xpad { +@@ -293,6 +293,7 @@ struct usb_xpad { int mapping; /* map d-pad to buttons or to axes */ int xtype; /* type of xbox device */ @@ -27,7 +27,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> }; /* -@@ -857,70 +858,21 @@ static void xpad_set_up_abs(struct input +@@ -858,70 +859,21 @@ static void xpad_set_up_abs(struct input } } @@ -104,7 +104,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> input_set_drvdata(input_dev, xpad); -@@ -965,17 +917,87 @@ static int xpad_probe(struct usb_interfa +@@ -966,17 +918,87 @@ static int xpad_probe(struct usb_interfa xpad_set_up_abs(input_dev, xpad_abs_triggers[i]); } @@ -197,7 +197,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> ep_irq_in = &intf->cur_altsetting->endpoint[0].desc; usb_fill_int_urb(xpad->irq_in, udev, -@@ -985,10 +1007,6 @@ static int xpad_probe(struct usb_interfa +@@ -986,10 +1008,6 @@ static int xpad_probe(struct usb_interfa xpad->irq_in->transfer_dma = xpad->idata_dma; xpad->irq_in->transfer_flags |= URB_NO_TRANSFER_DMA_MAP; @@ -208,7 +208,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> usb_set_intfdata(intf, xpad); if (xpad->xtype == XTYPE_XBOX360W) { -@@ -999,7 +1017,7 @@ static int xpad_probe(struct usb_interfa +@@ -1000,7 +1018,7 @@ static int xpad_probe(struct usb_interfa xpad->bulk_out = usb_alloc_urb(0, GFP_KERNEL); if (!xpad->bulk_out) { error = -ENOMEM; @@ -217,7 +217,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> } xpad->bdata = kzalloc(XPAD_PKT_LEN, GFP_KERNEL); -@@ -1037,24 +1055,25 @@ static int xpad_probe(struct usb_interfa +@@ -1048,24 +1066,25 @@ static int xpad_probe(struct usb_interfa */ xpad->irq_in->dev = xpad->udev; error = usb_submit_urb(xpad->irq_in, GFP_KERNEL); diff --git a/input-xpad-set-the-correct-led-number.patch b/input-xpad-set-the-correct-led-number.patch index 6c4b9a01685b38..af21ed65261b64 100644 --- a/input-xpad-set-the-correct-led-number.patch +++ b/input-xpad-set-the-correct-led-number.patch @@ -20,7 +20,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> --- a/drivers/input/joystick/xpad.c +++ b/drivers/input/joystick/xpad.c -@@ -292,6 +292,7 @@ struct usb_xpad { +@@ -293,6 +293,7 @@ struct usb_xpad { int mapping; /* map d-pad to buttons or to axes */ int xtype; /* type of xbox device */ @@ -28,7 +28,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> const char *name; /* name of the device */ }; -@@ -788,11 +789,6 @@ static int xpad_led_probe(struct usb_xpa +@@ -789,11 +790,6 @@ static int xpad_led_probe(struct usb_xpa return error; } @@ -40,7 +40,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> return 0; } -@@ -858,9 +854,17 @@ static void xpad_set_up_abs(struct input +@@ -859,9 +855,17 @@ static void xpad_set_up_abs(struct input } } @@ -58,7 +58,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> int i, error; input_dev = input_allocate_device(); -@@ -925,6 +929,17 @@ static int xpad_init_input(struct usb_xp +@@ -926,6 +930,17 @@ static int xpad_init_input(struct usb_xp if (error) goto fail_input_register; diff --git a/input-xpad-set-the-leds-properly-on-xbox-wireless-controllers.patch b/input-xpad-set-the-leds-properly-on-xbox-wireless-controllers.patch index b746a0f1fce0af..f062ba9e6cd6a7 100644 --- a/input-xpad-set-the-leds-properly-on-xbox-wireless-controllers.patch +++ b/input-xpad-set-the-leds-properly-on-xbox-wireless-controllers.patch @@ -18,7 +18,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> --- a/drivers/input/joystick/xpad.c +++ b/drivers/input/joystick/xpad.c -@@ -714,15 +714,37 @@ struct xpad_led { +@@ -715,15 +715,37 @@ struct xpad_led { static void xpad_send_led_command(struct usb_xpad *xpad, int command) { @@ -60,7 +60,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> } static void xpad_led_set(struct led_classdev *led_cdev, -@@ -742,7 +764,7 @@ static int xpad_led_probe(struct usb_xpa +@@ -743,7 +765,7 @@ static int xpad_led_probe(struct usb_xpa struct led_classdev *led_cdev; int error; diff --git a/input-xpad-use-proper-endpoint-type.patch b/input-xpad-use-proper-endpoint-type.patch new file mode 100644 index 00000000000000..28439f20fadd50 --- /dev/null +++ b/input-xpad-use-proper-endpoint-type.patch @@ -0,0 +1,43 @@ +From foo@baz Wed Jan 29 10:20:37 PST 2014 +Date: Wed, 29 Jan 2014 10:20:37 -0800 +To: Greg KH <gregkh@linuxfoundation.org> +From: Greg Kroah-Hartman <gregkh@linuxfoundation.org> +Subject: [PATCH] Input: xpad: use proper endpoint type + +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: Greg Kroah-Hartman <gregkh@linuxfoundation.org> +--- + drivers/input/joystick/xpad.c | 16 +++++++++++++--- + 1 file changed, 13 insertions(+), 3 deletions(-) + +--- a/drivers/input/joystick/xpad.c ++++ b/drivers/input/joystick/xpad.c +@@ -1003,9 +1003,19 @@ static int xpad_probe(struct usb_interfa + } + + 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 @@ -1,5 +1,6 @@ +input-xpad-use-proper-endpoint-type.patch input-xpad-set-the-leds-properly-on-xbox-wireless-controllers.patch -defer-input-nodes-and-led-support +#defer-input-nodes-and-led-support input-xpad-move-the-input-device-creation-to-a-new-function.patch input-xpad-set-the-correct-led-number.patch input-xpad-disconnect-all-wireless-controllers-at-init.patch |
