diff options
| -rw-r--r-- | drivers/hid/hid-sony.c | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/drivers/hid/hid-sony.c b/drivers/hid/hid-sony.c index d61f26840afe..0c164b3dce3a 100644 --- a/drivers/hid/hid-sony.c +++ b/drivers/hid/hid-sony.c | |||
| @@ -46,6 +46,25 @@ static void sony_report_fixup(struct hid_device *hdev, __u8 *rdesc, | |||
| 46 | } | 46 | } |
| 47 | } | 47 | } |
| 48 | 48 | ||
| 49 | static int sixaxis_usb_output_raw_report(struct hid_device *hid, __u8 *buf, | ||
| 50 | size_t count, unsigned char report_type) | ||
| 51 | { | ||
| 52 | struct usb_interface *intf = to_usb_interface(hid->dev.parent); | ||
| 53 | struct usb_device *dev = interface_to_usbdev(intf); | ||
| 54 | struct usb_host_interface *interface = intf->cur_altsetting; | ||
| 55 | int report_id = buf[0]; | ||
| 56 | int ret; | ||
| 57 | |||
| 58 | ret = usb_control_msg(dev, usb_sndctrlpipe(dev, 0), | ||
| 59 | HID_REQ_SET_REPORT, | ||
| 60 | USB_DIR_OUT | USB_TYPE_CLASS | USB_RECIP_INTERFACE, | ||
| 61 | ((report_type + 1) << 8) | report_id, | ||
| 62 | interface->desc.bInterfaceNumber, buf, count, | ||
| 63 | USB_CTRL_SET_TIMEOUT); | ||
| 64 | |||
| 65 | return ret; | ||
| 66 | } | ||
| 67 | |||
| 49 | /* | 68 | /* |
| 50 | * Sending HID_REQ_GET_REPORT changes the operation mode of the ps3 controller | 69 | * Sending HID_REQ_GET_REPORT changes the operation mode of the ps3 controller |
| 51 | * to "operational". Without this, the ps3 controller will not report any | 70 | * to "operational". Without this, the ps3 controller will not report any |
| @@ -110,8 +129,10 @@ static int sony_probe(struct hid_device *hdev, const struct hid_device_id *id) | |||
| 110 | goto err_free; | 129 | goto err_free; |
| 111 | } | 130 | } |
| 112 | 131 | ||
| 113 | if (sc->quirks & SIXAXIS_CONTROLLER_USB) | 132 | if (sc->quirks & SIXAXIS_CONTROLLER_USB) { |
| 133 | hdev->hid_output_raw_report = sixaxis_usb_output_raw_report; | ||
| 114 | ret = sixaxis_set_operational_usb(hdev); | 134 | ret = sixaxis_set_operational_usb(hdev); |
| 135 | } | ||
| 115 | else if (sc->quirks & SIXAXIS_CONTROLLER_BT) | 136 | else if (sc->quirks & SIXAXIS_CONTROLLER_BT) |
| 116 | ret = sixaxis_set_operational_bt(hdev); | 137 | ret = sixaxis_set_operational_bt(hdev); |
| 117 | else | 138 | else |
