aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input/joystick
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2011-07-27 12:24:56 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2011-07-27 12:24:56 -0400
commit70a3eff5768350c0313a9ae70a15da113171d0ab (patch)
tree9c2558f92e567bcb35c79f59bc7ebc9cf6fdc9d3 /drivers/input/joystick
parent9ed3689bdceb0064ee6faf0e76f6467122794970 (diff)
parentaa7eb8e78d8ecd6cd0475d86ea8385ff9cb47ece (diff)
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input: (53 commits) Input: synaptics - fix reporting of min coordinates Input: tegra-kbc - enable key autorepeat Input: kxtj9 - fix locking typo in kxtj9_set_poll() Input: kxtj9 - fix bug in probe() Input: intel-mid-touch - remove pointless checking for variable 'found' Input: hp_sdc - staticize hp_sdc_kicker() Input: pmic8xxx-keypad - fix a leak of the IRQ during init failure Input: cy8ctmg110_ts - set reset_pin and irq_pin from platform data Input: cy8ctmg110_ts - constify i2c_device_id table Input: cy8ctmg110_ts - fix checking return value of i2c_master_send Input: lifebook - make dmi callback functions return 1 Input: atkbd - make dmi callback functions return 1 Input: gpio_keys - switch to using SIMPLE_DEV_PM_OPS Input: gpio_keys - add support for device-tree platform data Input: aiptek - remove double define Input: synaptics - set minimum coordinates as reported by firmware Input: synaptics - process button bits in AGM packets Input: synaptics - rename set_slot to be more descriptive Input: synaptics - fuzz position for touchpad with reduced filtering Input: synaptics - set resolution for MT_POSITION_X/Y axes ...
Diffstat (limited to 'drivers/input/joystick')
-rw-r--r--drivers/input/joystick/xpad.c31
1 files changed, 26 insertions, 5 deletions
diff --git a/drivers/input/joystick/xpad.c b/drivers/input/joystick/xpad.c
index 56abf3d0e911..d72887585a14 100644
--- a/drivers/input/joystick/xpad.c
+++ b/drivers/input/joystick/xpad.c
@@ -154,10 +154,13 @@ static const struct xpad_device {
154 { 0x0f30, 0x8888, "BigBen XBMiniPad Controller", 0, XTYPE_XBOX }, 154 { 0x0f30, 0x8888, "BigBen XBMiniPad Controller", 0, XTYPE_XBOX },
155 { 0x102c, 0xff0c, "Joytech Wireless Advanced Controller", 0, XTYPE_XBOX }, 155 { 0x102c, 0xff0c, "Joytech Wireless Advanced Controller", 0, XTYPE_XBOX },
156 { 0x12ab, 0x8809, "Xbox DDR dancepad", MAP_DPAD_TO_BUTTONS, XTYPE_XBOX }, 156 { 0x12ab, 0x8809, "Xbox DDR dancepad", MAP_DPAD_TO_BUTTONS, XTYPE_XBOX },
157 { 0x12ab, 0x0004, "Honey Bee Xbox360 dancepad", MAP_DPAD_TO_BUTTONS, XTYPE_XBOX360 },
158 { 0x0e6f, 0x0105, "HSM3 Xbox360 dancepad", MAP_DPAD_TO_BUTTONS, XTYPE_XBOX360 },
157 { 0x1430, 0x4748, "RedOctane Guitar Hero X-plorer", 0, XTYPE_XBOX360 }, 159 { 0x1430, 0x4748, "RedOctane Guitar Hero X-plorer", 0, XTYPE_XBOX360 },
158 { 0x1430, 0x8888, "TX6500+ Dance Pad (first generation)", MAP_DPAD_TO_BUTTONS, XTYPE_XBOX }, 160 { 0x1430, 0x8888, "TX6500+ Dance Pad (first generation)", MAP_DPAD_TO_BUTTONS, XTYPE_XBOX },
159 { 0x146b, 0x0601, "BigBen Interactive XBOX 360 Controller", 0, XTYPE_XBOX360 }, 161 { 0x146b, 0x0601, "BigBen Interactive XBOX 360 Controller", 0, XTYPE_XBOX360 },
160 { 0x045e, 0x028e, "Microsoft X-Box 360 pad", 0, XTYPE_XBOX360 }, 162 { 0x045e, 0x028e, "Microsoft X-Box 360 pad", 0, XTYPE_XBOX360 },
163 { 0x1bad, 0x0002, "Harmonix Rock Band Guitar", 0, XTYPE_XBOX360 },
161 { 0x1bad, 0x0003, "Harmonix Rock Band Drumkit", MAP_DPAD_TO_BUTTONS, XTYPE_XBOX360 }, 164 { 0x1bad, 0x0003, "Harmonix Rock Band Drumkit", MAP_DPAD_TO_BUTTONS, XTYPE_XBOX360 },
162 { 0x0f0d, 0x0016, "Hori Real Arcade Pro.EX", MAP_TRIGGERS_TO_BUTTONS, XTYPE_XBOX360 }, 165 { 0x0f0d, 0x0016, "Hori Real Arcade Pro.EX", MAP_TRIGGERS_TO_BUTTONS, XTYPE_XBOX360 },
163 { 0x0f0d, 0x000d, "Hori Fighting Stick EX2", MAP_TRIGGERS_TO_BUTTONS, XTYPE_XBOX360 }, 166 { 0x0f0d, 0x000d, "Hori Fighting Stick EX2", MAP_TRIGGERS_TO_BUTTONS, XTYPE_XBOX360 },
@@ -236,9 +239,10 @@ static struct usb_device_id xpad_table [] = {
236 XPAD_XBOX360_VENDOR(0x046d), /* Logitech X-Box 360 style controllers */ 239 XPAD_XBOX360_VENDOR(0x046d), /* Logitech X-Box 360 style controllers */
237 XPAD_XBOX360_VENDOR(0x0738), /* Mad Catz X-Box 360 controllers */ 240 XPAD_XBOX360_VENDOR(0x0738), /* Mad Catz X-Box 360 controllers */
238 XPAD_XBOX360_VENDOR(0x0e6f), /* 0x0e6f X-Box 360 controllers */ 241 XPAD_XBOX360_VENDOR(0x0e6f), /* 0x0e6f X-Box 360 controllers */
242 XPAD_XBOX360_VENDOR(0x12ab), /* X-Box 360 dance pads */
239 XPAD_XBOX360_VENDOR(0x1430), /* RedOctane X-Box 360 controllers */ 243 XPAD_XBOX360_VENDOR(0x1430), /* RedOctane X-Box 360 controllers */
240 XPAD_XBOX360_VENDOR(0x146b), /* BigBen Interactive Controllers */ 244 XPAD_XBOX360_VENDOR(0x146b), /* BigBen Interactive Controllers */
241 XPAD_XBOX360_VENDOR(0x1bad), /* Rock Band Drums */ 245 XPAD_XBOX360_VENDOR(0x1bad), /* Harminix Rock Band Guitar and Drums */
242 XPAD_XBOX360_VENDOR(0x0f0d), /* Hori Controllers */ 246 XPAD_XBOX360_VENDOR(0x0f0d), /* Hori Controllers */
243 { } 247 { }
244}; 248};
@@ -545,7 +549,7 @@ static int xpad_init_output(struct usb_interface *intf, struct usb_xpad *xpad)
545 struct usb_endpoint_descriptor *ep_irq_out; 549 struct usb_endpoint_descriptor *ep_irq_out;
546 int error; 550 int error;
547 551
548 if (xpad->xtype != XTYPE_XBOX360 && xpad->xtype != XTYPE_XBOX) 552 if (xpad->xtype == XTYPE_UNKNOWN)
549 return 0; 553 return 0;
550 554
551 xpad->odata = usb_alloc_coherent(xpad->udev, XPAD_PKT_LEN, 555 xpad->odata = usb_alloc_coherent(xpad->udev, XPAD_PKT_LEN,
@@ -579,13 +583,13 @@ static int xpad_init_output(struct usb_interface *intf, struct usb_xpad *xpad)
579 583
580static void xpad_stop_output(struct usb_xpad *xpad) 584static void xpad_stop_output(struct usb_xpad *xpad)
581{ 585{
582 if (xpad->xtype == XTYPE_XBOX360 || xpad->xtype == XTYPE_XBOX) 586 if (xpad->xtype != XTYPE_UNKNOWN)
583 usb_kill_urb(xpad->irq_out); 587 usb_kill_urb(xpad->irq_out);
584} 588}
585 589
586static void xpad_deinit_output(struct usb_xpad *xpad) 590static void xpad_deinit_output(struct usb_xpad *xpad)
587{ 591{
588 if (xpad->xtype == XTYPE_XBOX360 || xpad->xtype == XTYPE_XBOX) { 592 if (xpad->xtype != XTYPE_UNKNOWN) {
589 usb_free_urb(xpad->irq_out); 593 usb_free_urb(xpad->irq_out);
590 usb_free_coherent(xpad->udev, XPAD_PKT_LEN, 594 usb_free_coherent(xpad->udev, XPAD_PKT_LEN,
591 xpad->odata, xpad->odata_dma); 595 xpad->odata, xpad->odata_dma);
@@ -632,6 +636,23 @@ static int xpad_play_effect(struct input_dev *dev, void *data, struct ff_effect
632 636
633 return usb_submit_urb(xpad->irq_out, GFP_ATOMIC); 637 return usb_submit_urb(xpad->irq_out, GFP_ATOMIC);
634 638
639 case XTYPE_XBOX360W:
640 xpad->odata[0] = 0x00;
641 xpad->odata[1] = 0x01;
642 xpad->odata[2] = 0x0F;
643 xpad->odata[3] = 0xC0;
644 xpad->odata[4] = 0x00;
645 xpad->odata[5] = strong / 256;
646 xpad->odata[6] = weak / 256;
647 xpad->odata[7] = 0x00;
648 xpad->odata[8] = 0x00;
649 xpad->odata[9] = 0x00;
650 xpad->odata[10] = 0x00;
651 xpad->odata[11] = 0x00;
652 xpad->irq_out->transfer_buffer_length = 12;
653
654 return usb_submit_urb(xpad->irq_out, GFP_ATOMIC);
655
635 default: 656 default:
636 dbg("%s - rumble command sent to unsupported xpad type: %d", 657 dbg("%s - rumble command sent to unsupported xpad type: %d",
637 __func__, xpad->xtype); 658 __func__, xpad->xtype);
@@ -644,7 +665,7 @@ static int xpad_play_effect(struct input_dev *dev, void *data, struct ff_effect
644 665
645static int xpad_init_ff(struct usb_xpad *xpad) 666static int xpad_init_ff(struct usb_xpad *xpad)
646{ 667{
647 if (xpad->xtype != XTYPE_XBOX360 && xpad->xtype != XTYPE_XBOX) 668 if (xpad->xtype == XTYPE_UNKNOWN)
648 return 0; 669 return 0;
649 670
650 input_set_capability(xpad->dev, EV_FF, FF_RUMBLE); 671 input_set_capability(xpad->dev, EV_FF, FF_RUMBLE);