Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 215545
b: refs/heads/master
c: 816651a
h: refs/heads/master
i:
  215543: 091b126
v: v3
  • Loading branch information
Antonio Ospite authored and Jiri Kosina committed Sep 2, 2010
1 parent 8af6d21 commit f46ff54
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 15 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: a10430443120205853e5f13a938e6560d027b42f
refs/heads/master: 816651a7d4a32664261e5f9f88ad0d558faed4cc
28 changes: 14 additions & 14 deletions trunk/drivers/hid/hid-sony.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@

#include "hid-ids.h"

#define VAIO_RDESC_CONSTANT 0x0001
#define VAIO_RDESC_CONSTANT (1 << 0)
#define SIXAXIS_CONTROLLER_USB (1 << 1)
#define SIXAXIS_CONTROLLER_BT (1 << 2)

struct sony_sc {
unsigned long quirks;
Expand All @@ -49,7 +51,7 @@ static void sony_report_fixup(struct hid_device *hdev, __u8 *rdesc,
* to "operational". Without this, the ps3 controller will not report any
* events.
*/
static int sony_set_operational_usb(struct hid_device *hdev)
static int sixaxis_set_operational_usb(struct hid_device *hdev)
{
struct usb_interface *intf = to_usb_interface(hdev->dev.parent);
struct usb_device *dev = interface_to_usbdev(intf);
Expand All @@ -74,7 +76,7 @@ static int sony_set_operational_usb(struct hid_device *hdev)
return ret;
}

static int sony_set_operational_bt(struct hid_device *hdev)
static int sixaxis_set_operational_bt(struct hid_device *hdev)
{
unsigned char buf[] = { 0xf4, 0x42, 0x03, 0x00, 0x00 };
return hdev->hid_output_raw_report(hdev, buf, sizeof(buf), HID_FEATURE_REPORT);
Expand Down Expand Up @@ -108,16 +110,12 @@ static int sony_probe(struct hid_device *hdev, const struct hid_device_id *id)
goto err_free;
}

switch (hdev->bus) {
case BUS_USB:
ret = sony_set_operational_usb(hdev);
break;
case BUS_BLUETOOTH:
ret = sony_set_operational_bt(hdev);
break;
default:
if (sc->quirks & SIXAXIS_CONTROLLER_USB)
ret = sixaxis_set_operational_usb(hdev);
else if (sc->quirks & SIXAXIS_CONTROLLER_BT)
ret = sixaxis_set_operational_bt(hdev);
else
ret = 0;
}

if (ret < 0)
goto err_stop;
Expand All @@ -137,8 +135,10 @@ static void sony_remove(struct hid_device *hdev)
}

static const struct hid_device_id sony_devices[] = {
{ HID_USB_DEVICE(USB_VENDOR_ID_SONY, USB_DEVICE_ID_SONY_PS3_CONTROLLER) },
{ HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_SONY, USB_DEVICE_ID_SONY_PS3_CONTROLLER) },
{ HID_USB_DEVICE(USB_VENDOR_ID_SONY, USB_DEVICE_ID_SONY_PS3_CONTROLLER),
.driver_data = SIXAXIS_CONTROLLER_USB },
{ HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_SONY, USB_DEVICE_ID_SONY_PS3_CONTROLLER),
.driver_data = SIXAXIS_CONTROLLER_BT },
{ HID_USB_DEVICE(USB_VENDOR_ID_SONY, USB_DEVICE_ID_SONY_VAIO_VGX_MOUSE),
.driver_data = VAIO_RDESC_CONSTANT },
{ }
Expand Down

0 comments on commit f46ff54

Please sign in to comment.