/* Sending HID_REQ_GET_REPORT changes the operation mode of the ps3 controller to "operational". Without this, the ps3 controller will not report any events.  */
static int sony_set_operational(struct hid_device *hdev)
/* Sending HID_REQ_GET_REPORT changes the operation mode of the ps3 controller to "operational". Without this, the ps3 controller will not report any events.  */
static int sony_set_operational(struct hid_device *hdev)
{
	struct usb_interface *intf = to_usb_interface(hdev->dev.parent);
	struct usb_device *dev = interface_to_usbdev(intf);
	__u16 ifnum = intf->cur_altsetting->desc.bInterfaceNumber;
	int ret;
	char *buf = kmalloc(18, GFP_KERNEL);
	if (!buf)
		return -ENOMEM;
	ret = usb_control_msg(dev, usb_rcvctrlpipe(dev, 0),
				 HID_REQ_GET_REPORT,
				 USB_DIR_IN | USB_TYPE_CLASS |
				 USB_RECIP_INTERFACE,
				 (3 << 8) | 0xf2, ifnum, buf, 17,
				 USB_CTRL_GET_TIMEOUT);
	if (ret < 0)
		dev_err(&hdev->dev, "can't set operational mode\n");
	kfree(buf);
	return ret;
}