aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hid/hid-sony.c
diff options
context:
space:
mode:
authorBastien Nocera <hadess@hadess.net>2010-01-20 07:01:53 -0500
committerJiri Kosina <jkosina@suse.cz>2010-02-03 09:47:53 -0500
commitf9ce7c283c16538955d5d094101889792bcde109 (patch)
tree28888a0c359fde720b39e8a8fcf7cd202587b073 /drivers/hid/hid-sony.c
parent46a709b900bfcf43244cd19cf3245c77484ec733 (diff)
HID: Enable Sixaxis controller over Bluetooth
Now that hid_output_raw_report works, port the PS3 Sixaxis Bluetooth quirk from user-space, into kernel-space. Signed-off-by: Bastien Nocera <hadess@hadess.net> Acked-by: Marcel Holtmann <marcel@holtmann.org> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Diffstat (limited to 'drivers/hid/hid-sony.c')
-rw-r--r--drivers/hid/hid-sony.c21
1 files changed, 19 insertions, 2 deletions
diff --git a/drivers/hid/hid-sony.c b/drivers/hid/hid-sony.c
index 4e8450228a24..6ced140b1411 100644
--- a/drivers/hid/hid-sony.c
+++ b/drivers/hid/hid-sony.c
@@ -48,7 +48,7 @@ static void sony_report_fixup(struct hid_device *hdev, __u8 *rdesc,
48 * to "operational". Without this, the ps3 controller will not report any 48 * to "operational". Without this, the ps3 controller will not report any
49 * events. 49 * events.
50 */ 50 */
51static int sony_set_operational(struct hid_device *hdev) 51static int sony_set_operational_usb(struct hid_device *hdev)
52{ 52{
53 struct usb_interface *intf = to_usb_interface(hdev->dev.parent); 53 struct usb_interface *intf = to_usb_interface(hdev->dev.parent);
54 struct usb_device *dev = interface_to_usbdev(intf); 54 struct usb_device *dev = interface_to_usbdev(intf);
@@ -73,6 +73,12 @@ static int sony_set_operational(struct hid_device *hdev)
73 return ret; 73 return ret;
74} 74}
75 75
76static int sony_set_operational_bt(struct hid_device *hdev)
77{
78 unsigned char buf[] = { 0x53, 0xf4, 0x42, 0x03, 0x00, 0x00 };
79 return hdev->hid_output_raw_report(hdev, buf, sizeof(buf), HID_FEATURE_REPORT);
80}
81
76static int sony_probe(struct hid_device *hdev, const struct hid_device_id *id) 82static int sony_probe(struct hid_device *hdev, const struct hid_device_id *id)
77{ 83{
78 int ret; 84 int ret;
@@ -101,7 +107,17 @@ static int sony_probe(struct hid_device *hdev, const struct hid_device_id *id)
101 goto err_free; 107 goto err_free;
102 } 108 }
103 109
104 ret = sony_set_operational(hdev); 110 switch (hdev->bus) {
111 case BUS_USB:
112 ret = sony_set_operational_usb(hdev);
113 break;
114 case BUS_BLUETOOTH:
115 ret = sony_set_operational_bt(hdev);
116 break;
117 default:
118 ret = 0;
119 }
120
105 if (ret < 0) 121 if (ret < 0)
106 goto err_stop; 122 goto err_stop;
107 123
@@ -121,6 +137,7 @@ static void sony_remove(struct hid_device *hdev)
121 137
122static const struct hid_device_id sony_devices[] = { 138static const struct hid_device_id sony_devices[] = {
123 { HID_USB_DEVICE(USB_VENDOR_ID_SONY, USB_DEVICE_ID_SONY_PS3_CONTROLLER) }, 139 { HID_USB_DEVICE(USB_VENDOR_ID_SONY, USB_DEVICE_ID_SONY_PS3_CONTROLLER) },
140 { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_SONY, USB_DEVICE_ID_SONY_PS3_CONTROLLER) },
124 { HID_USB_DEVICE(USB_VENDOR_ID_SONY, USB_DEVICE_ID_SONY_VAIO_VGX_MOUSE), 141 { HID_USB_DEVICE(USB_VENDOR_ID_SONY, USB_DEVICE_ID_SONY_VAIO_VGX_MOUSE),
125 .driver_data = VAIO_RDESC_CONSTANT }, 142 .driver_data = VAIO_RDESC_CONSTANT },
126 { } 143 { }