aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2014-01-31 13:26:33 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2014-01-31 13:26:33 +0100
commit9eec6a6c64e9195861d4b1208ff42b6807761935 (patch)
treed30368420a605db45487b420f8bbc4c35be1b4b4
parent10b1ffdf895c57ca46e2a667f5351451a92a6151 (diff)
downloadpatches-9eec6a6c64e9195861d4b1208ff42b6807761935.tar.gz
fix xpad patches and add another one.
-rw-r--r--input-xpad-disconnect-all-wireless-controllers-at-init.patch47
-rw-r--r--input-xpad-handle-present-and-gone-correctly.patch42
-rw-r--r--input-xpad-move-the-input-device-creation-to-a-new-function.patch48
-rw-r--r--input-xpad-properly-name-the-led-class-devices.patch93
-rw-r--r--input-xpad-set-the-correct-led-number.patch24
-rw-r--r--input-xpad-set-the-leds-properly-on-xbox-wireless-controllers.patch2
-rw-r--r--input-xpad-use-proper-endpoint-type.patch3
-rw-r--r--series1
8 files changed, 220 insertions, 40 deletions
diff --git a/input-xpad-disconnect-all-wireless-controllers-at-init.patch b/input-xpad-disconnect-all-wireless-controllers-at-init.patch
index b985e6ff88dc9..ec1e05dca4799 100644
--- a/input-xpad-disconnect-all-wireless-controllers-at-init.patch
+++ b/input-xpad-disconnect-all-wireless-controllers-at-init.patch
@@ -17,15 +17,54 @@ connected to the base station before that can happen. The allocation of
the device happens in the next patch, not here, so in a way, this patch
breaks all wireless devices...
-Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+Because we want to talk to the device, we have to set up the output urbs
+no matter if we have CONFIG_JOYSTICK_XPAD_FF or
+CONFIG_JOYSTICK_XPAD_LEDS enabled not, so take out the code that allows
+those variables and code to be disabled (it's so small it should never
+matter...)
+Signed-off-by: "Pierre-Loup A. Griffais" <pgriffais@valvesoftware.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
- drivers/input/joystick/xpad.c | 38 ++++++++++++++++++++++++++++++++++----
- 1 file changed, 34 insertions(+), 4 deletions(-)
+ drivers/input/joystick/xpad.c | 46 +++++++++++++++++++++++++++++++-----------
+ 1 file changed, 34 insertions(+), 12 deletions(-)
--- a/drivers/input/joystick/xpad.c
+++ b/drivers/input/joystick/xpad.c
-@@ -1085,11 +1085,41 @@ static int xpad_probe(struct usb_interfa
+@@ -278,12 +278,10 @@ struct usb_xpad {
+ struct urb *bulk_out;
+ unsigned char *bdata;
+
+-#if defined(CONFIG_JOYSTICK_XPAD_FF) || defined(CONFIG_JOYSTICK_XPAD_LEDS)
+ struct urb *irq_out; /* urb for interrupt out report */
+ unsigned char *odata; /* output data */
+ dma_addr_t odata_dma;
+ struct mutex odata_mutex;
+-#endif
+
+ #if defined(CONFIG_JOYSTICK_XPAD_LEDS)
+ struct xpad_led *led;
+@@ -537,7 +535,6 @@ static void xpad_bulk_out(struct urb *ur
+ }
+ }
+
+-#if defined(CONFIG_JOYSTICK_XPAD_FF) || defined(CONFIG_JOYSTICK_XPAD_LEDS)
+ static void xpad_irq_out(struct urb *urb)
+ {
+ struct usb_xpad *xpad = urb->context;
+@@ -623,11 +620,6 @@ static void xpad_deinit_output(struct us
+ xpad->odata, xpad->odata_dma);
+ }
+ }
+-#else
+-static int xpad_init_output(struct usb_interface *intf, struct usb_xpad *xpad) { return 0; }
+-static void xpad_deinit_output(struct usb_xpad *xpad) {}
+-static void xpad_stop_output(struct usb_xpad *xpad) {}
+-#endif
+
+ #ifdef CONFIG_JOYSTICK_XPAD_FF
+ static int xpad_play_effect(struct input_dev *dev, void *data, struct ff_effect *effect)
+@@ -1091,11 +1083,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 d9770b60c24d4..95ec89103d616 100644
--- a/input-xpad-handle-present-and-gone-correctly.patch
+++ b/input-xpad-handle-present-and-gone-correctly.patch
@@ -12,15 +12,15 @@ workqueue as we are in interrupt context when we learn about this.
Also properly disconnect any devices that we are told are removed.
+Signed-off-by: "Pierre-Loup A. Griffais" <pgriffais@valvesoftware.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
---
- drivers/input/joystick/xpad.c | 36 +++++++++++++++++++++++++++++++-----
- 1 file changed, 31 insertions(+), 5 deletions(-)
+ drivers/input/joystick/xpad.c | 50 +++++++++++++++++++++++++++++++++---------
+ 1 file changed, 40 insertions(+), 10 deletions(-)
--- a/drivers/input/joystick/xpad.c
+++ b/drivers/input/joystick/xpad.c
-@@ -295,8 +295,11 @@ struct usb_xpad {
+@@ -293,8 +293,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
*
-@@ -439,6 +442,22 @@ static void xpad360_process_packet(struc
+@@ -437,6 +440,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
*
-@@ -453,16 +472,22 @@ static void xpad360_process_packet(struc
+@@ -451,16 +470,22 @@ static void xpad360_process_packet(struc
* 01.1 - Pad state (Bytes 4+) valid
*
*/
@@ -83,7 +83,25 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
}
/* Valid pad data */
-@@ -989,6 +1014,7 @@ static int xpad_probe(struct usb_interfa
+@@ -507,10 +532,13 @@ static void xpad_irq_in(struct urb *urb)
+ }
+
+ exit:
+- retval = usb_submit_urb(urb, GFP_ATOMIC);
+- if (retval)
+- dev_err(dev, "%s - usb_submit_urb failed with result %d\n",
+- __func__, retval);
++ if (xpad->pad_present) {
++ retval = usb_submit_urb(urb, GFP_ATOMIC);
++ if (retval)
++ dev_err(dev,
++ "%s - usb_submit_urb failed with result %d\n",
++ __func__, retval);
++ }
+ }
+
+ static void xpad_bulk_out(struct urb *urb)
+@@ -991,6 +1019,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;
@@ -91,3 +109,13 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
if (xpad->xtype == XTYPE_UNKNOWN) {
if (intf->cur_altsetting->desc.bInterfaceClass == USB_CLASS_VENDOR_SPEC) {
+@@ -1136,7 +1165,8 @@ static void xpad_disconnect(struct usb_i
+ struct usb_xpad *xpad = usb_get_intfdata (intf);
+
+ xpad_led_disconnect(xpad);
+- input_unregister_device(xpad->dev);
++ if (xpad->pad_present)
++ input_unregister_device(xpad->dev);
+ xpad_deinit_output(xpad);
+
+ if (xpad->xtype == XTYPE_XBOX360W) {
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 a9c619a1935e3..db918fd23b0ce 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
@@ -11,11 +11,11 @@ callback, we need to initialize the input device from a separate
function. So pull that logic out now to make later patches more
"obvious" as to what they do.
-
+Signed-off-by: "Pierre-Loup A. Griffais" <pgriffais@valvesoftware.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
- drivers/input/joystick/xpad.c | 163 +++++++++++++++++++++++-------------------
- 1 file changed, 91 insertions(+), 72 deletions(-)
+ drivers/input/joystick/xpad.c | 171 +++++++++++++++++++++++-------------------
+ 1 file changed, 97 insertions(+), 74 deletions(-)
--- a/drivers/input/joystick/xpad.c
+++ b/drivers/input/joystick/xpad.c
@@ -104,26 +104,37 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
input_set_drvdata(input_dev, xpad);
-@@ -966,17 +918,87 @@ static int xpad_probe(struct usb_interfa
+@@ -966,17 +918,92 @@ static int xpad_probe(struct usb_interfa
xpad_set_up_abs(input_dev, xpad_abs_triggers[i]);
}
- error = xpad_init_output(intf, xpad);
-+ error = xpad_init_ff(xpad);
- if (error)
+- if (error)
- goto fail3;
+-
+ error = xpad_init_ff(xpad);
+ if (error)
+- goto fail4;
+ goto fail_init_ff;
-- error = xpad_init_ff(xpad);
-+ error = input_register_device(xpad->dev);
+ error = xpad_led_probe(xpad);
if (error)
-- goto fail4;
+- goto fail5;
++ goto fail_init_led;
++
++ error = input_register_device(xpad->dev);
++ if (error)
+ goto fail_input_register;
+
-+fail_init_ff:
-+ input_ff_destroy(input_dev);
++ return 0;
+
+fail_input_register:
++ xpad_led_disconnect(xpad);
++
++fail_init_led:
++ input_ff_destroy(input_dev);
++
++fail_init_ff:
+ input_free_device(input_dev);
+ return error;
+}
@@ -190,14 +201,9 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+ if (error)
+ goto fail3;
- error = xpad_led_probe(xpad);
- if (error)
-- goto fail5;
-+ goto fail4;
-
ep_irq_in = &intf->cur_altsetting->endpoint[0].desc;
usb_fill_int_urb(xpad->irq_in, udev,
-@@ -986,10 +1008,6 @@ static int xpad_probe(struct usb_interfa
+@@ -986,10 +1013,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,16 +214,16 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
usb_set_intfdata(intf, xpad);
if (xpad->xtype == XTYPE_XBOX360W) {
-@@ -1000,7 +1018,7 @@ static int xpad_probe(struct usb_interfa
+@@ -1000,7 +1023,7 @@ static int xpad_probe(struct usb_interfa
xpad->bulk_out = usb_alloc_urb(0, GFP_KERNEL);
if (!xpad->bulk_out) {
error = -ENOMEM;
- goto fail7;
-+ goto fail6;
++ goto fail4;
}
xpad->bdata = kzalloc(XPAD_PKT_LEN, GFP_KERNEL);
-@@ -1048,24 +1066,25 @@ static int xpad_probe(struct usb_interfa
+@@ -1048,24 +1071,24 @@ static int xpad_probe(struct usb_interfa
*/
xpad->irq_in->dev = xpad->udev;
error = usb_submit_urb(xpad->irq_in, GFP_KERNEL);
@@ -238,7 +244,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fail8: usb_free_urb(xpad->bulk_out);
- fail7: input_unregister_device(input_dev);
- input_dev = NULL;
- fail6: xpad_led_disconnect(xpad);
+- fail6: xpad_led_disconnect(xpad);
- fail5: if (input_dev)
- input_ff_destroy(input_dev);
fail4: xpad_deinit_output(xpad);
diff --git a/input-xpad-properly-name-the-led-class-devices.patch b/input-xpad-properly-name-the-led-class-devices.patch
new file mode 100644
index 0000000000000..5bb65928d5fd1
--- /dev/null
+++ b/input-xpad-properly-name-the-led-class-devices.patch
@@ -0,0 +1,93 @@
+From foo@baz Fri Jan 31 13:18:58 CET 2014
+Date: Fri, 31 Jan 2014 13:18:58 +0100
+To: Greg KH <gregkh@linuxfoundation.org>
+From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+Subject: [PATCH] Input: xpad: properly name the LED class devices
+
+From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+Don't just increment the LED device number, but use the joystick id so
+that you have a chance to associate the LED device to the correct xpad
+device by the name, instead of having to use the sysfs tree, which
+really doesn't work.
+
+Cc: "Pierre-Loup A. Griffais" <pgriffais@valvesoftware.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/input/joystick/xpad.c | 40 +++++++++++++++++-----------------------
+ 1 file changed, 17 insertions(+), 23 deletions(-)
+
+--- a/drivers/input/joystick/xpad.c
++++ b/drivers/input/joystick/xpad.c
+@@ -781,8 +781,6 @@ static void xpad_led_set(struct led_clas
+
+ static int xpad_led_probe(struct usb_xpad *xpad)
+ {
+- static atomic_t led_seq = ATOMIC_INIT(0);
+- long led_no;
+ struct xpad_led *led;
+ struct led_classdev *led_cdev;
+ int error;
+@@ -794,9 +792,7 @@ static int xpad_led_probe(struct usb_xpa
+ if (!led)
+ return -ENOMEM;
+
+- led_no = (long)atomic_inc_return(&led_seq) - 1;
+-
+- snprintf(led->name, sizeof(led->name), "xpad%ld", led_no);
++ snprintf(led->name, sizeof(led->name), "xpad%d", xpad->joydev_id);
+ led->xpad = xpad;
+
+ led_cdev = &led->led_cdev;
+@@ -944,16 +940,17 @@ static int xpad_init_input(struct usb_xp
+ }
+
+ error = xpad_init_ff(xpad);
+- if (error)
+- goto fail_init_ff;
+-
+- error = xpad_led_probe(xpad);
+- if (error)
+- goto fail_init_led;
++ if (error) {
++ input_free_device(input_dev);
++ return error;
++ }
+
+ error = input_register_device(xpad->dev);
+- if (error)
+- goto fail_input_register;
++ if (error) {
++ input_ff_destroy(input_dev);
++ input_free_device(input_dev);
++ return error;
++ }
+
+ joydev_dev = device_find_child(&xpad->dev->dev, NULL,
+ xpad_find_joydev);
+@@ -966,17 +963,14 @@ static int xpad_init_input(struct usb_xp
+ xpad_send_led_command(xpad, (xpad->joydev_id % 4) + 2);
+ }
+
+- return 0;
+-
+-fail_input_register:
+- xpad_led_disconnect(xpad);
+-
+-fail_init_led:
+- input_ff_destroy(input_dev);
++ error = xpad_led_probe(xpad);
++ if (error) {
++ input_ff_destroy(input_dev);
++ input_unregister_device(input_dev);
++ return error;
++ }
+
+-fail_init_ff:
+- input_free_device(input_dev);
+- return error;
++ return 0;
+ }
+
+ static int xpad_probe(struct usb_interface *intf, const struct usb_device_id *id)
diff --git a/input-xpad-set-the-correct-led-number.patch b/input-xpad-set-the-correct-led-number.patch
index af21ed65261b6..58d8ab57950d5 100644
--- a/input-xpad-set-the-correct-led-number.patch
+++ b/input-xpad-set-the-correct-led-number.patch
@@ -4,6 +4,8 @@ To: Greg KH <gregkh@linuxfoundation.org>
From: "Pierre-Loup A. Griffais" <pgriffais@valvesoftware.com>
Subject: [PATCH] Input: xpad: Set the correct LED number
+From: "Pierre-Loup A. Griffais" <pgriffais@valvesoftware.com>
+
The LED number should not just be incremented every time, that doesn't
work, set the number based on the number it actually is.
@@ -12,11 +14,11 @@ number, so we have to walk all devices in order to find a joystick
device by looking at the name of the device. Odds are, this isn't the
best way to do it, but I don't know of any other way at the moment.
+Signed-off-by: "Pierre-Loup A. Griffais" <pgriffais@valvesoftware.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
---
- drivers/input/joystick/xpad.c | 25 ++++++++++++++++++++-----
- 1 file changed, 20 insertions(+), 5 deletions(-)
+ drivers/input/joystick/xpad.c | 26 +++++++++++++++++++++-----
+ 1 file changed, 21 insertions(+), 5 deletions(-)
--- a/drivers/input/joystick/xpad.c
+++ b/drivers/input/joystick/xpad.c
@@ -40,7 +42,15 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
return 0;
}
-@@ -859,9 +855,17 @@ static void xpad_set_up_abs(struct input
+@@ -809,6 +805,7 @@ static void xpad_led_disconnect(struct u
+ #else
+ static int xpad_led_probe(struct usb_xpad *xpad) { return 0; }
+ static void xpad_led_disconnect(struct usb_xpad *xpad) { }
++static void xpad_send_led_command(struct usb_xpad *xpad, int command) { }
+ #endif
+
+
+@@ -859,9 +856,17 @@ static void xpad_set_up_abs(struct input
}
}
@@ -58,7 +68,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
int i, error;
input_dev = input_allocate_device();
-@@ -926,6 +930,17 @@ static int xpad_init_input(struct usb_xp
+@@ -930,6 +935,17 @@ static int xpad_init_input(struct usb_xp
if (error)
goto fail_input_register;
@@ -73,6 +83,6 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+ xpad_send_led_command(xpad, (xpad->joydev_id % 4) + 2);
+ }
+
- fail_init_ff:
- input_ff_destroy(input_dev);
+ return 0;
+ 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 f062ba9e6cd6a..050b304068eda 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
@@ -10,8 +10,8 @@ Add the logic to set the LEDs on XBox Wireless controllers. Command
sequence found by sniffing the Windows data stream when plugging the
device in.
+Signed-off-by: "Pierre-Loup A. Griffais" <pgriffais@valvesoftware.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
---
drivers/input/joystick/xpad.c | 32 +++++++++++++++++++++++++++-----
1 file changed, 27 insertions(+), 5 deletions(-)
diff --git a/input-xpad-use-proper-endpoint-type.patch b/input-xpad-use-proper-endpoint-type.patch
index 28439f20fadd5..9c5c5084229ac 100644
--- a/input-xpad-use-proper-endpoint-type.patch
+++ b/input-xpad-use-proper-endpoint-type.patch
@@ -4,6 +4,8 @@ To: Greg KH <gregkh@linuxfoundation.org>
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Subject: [PATCH] Input: xpad: use proper endpoint type
+From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
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
@@ -11,6 +13,7 @@ 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>
---
drivers/input/joystick/xpad.c | 16 +++++++++++++---
diff --git a/series b/series
index 57f13e0d52e60..4e2565f133e41 100644
--- a/series
+++ b/series
@@ -5,6 +5,7 @@ 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
input-xpad-handle-present-and-gone-correctly.patch
+input-xpad-properly-name-the-led-class-devices.patch
staging-rtl8812ae-add-realtek-8821-pci-wifi-driver.patch
staging-rtl8821ae-rc.c-fix-up-function-prototypes.patch