Skip to contentSkip to conversation

xpad: wireless rumble support

PATCH In review Chris Moeller 2 participants 2 messages Jun 13, 2011 – Jul 5, 2011

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 2/3 xpad: wireless rumble support

This patch implements rumble support for XBox360 Wireless Controllers.

drivers/input/joystick/xpad.c renamed from drivers/input/joystick/xpad.c.orig +18 -1
@@ -632,6 +632,23 @@ static int xpad_play_effect(struct input
 
 			return usb_submit_urb(xpad->irq_out, GFP_ATOMIC);
 
+		case XTYPE_XBOX360W:
+			xpad->odata[0] = 0x00;
+			xpad->odata[1] = 0x01;
+			xpad->odata[2] = 0x0F;
+			xpad->odata[3] = 0xC0;
+			xpad->odata[4] = 0x00;
+			xpad->odata[5] = strong / 256;
+			xpad->odata[6] = weak / 256;
+			xpad->odata[7] = 0x00;
+			xpad->odata[8] = 0x00;
+			xpad->odata[9] = 0x00;
+			xpad->odata[10] = 0x00;
+			xpad->odata[11] = 0x00;
+			xpad->irq_out->transfer_buffer_length = 12;
+
+			return usb_submit_urb(xpad->irq_out, GFP_ATOMIC);
+
 		default:
 			dbg("%s - rumble command sent to unsupported xpad type: %d",
 				__func__, xpad->xtype);
@@ -644,7 +661,7 @@ static int xpad_play_effect(struct input
 
 static int xpad_init_ff(struct usb_xpad *xpad)
 {
-	if (xpad->xtype != XTYPE_XBOX360 && xpad->xtype != XTYPE_XBOX)
+	if (xpad->xtype == XTYPE_UNKNOWN)
 		return 0;
 
 	input_set_capability(xpad->dev, EV_FF, FF_RUMBLE);
maintainer
#1 lore raw
Quoted 3 lines · Chris Moeller

This patch implements rumble support for XBox360 Wireless Controllers.

Folded 1st into 2nd and applied, thanks Chris.

Still looking and the 3rd...

Signature · 1 line
Dmitry