Skip to content

Commit 74500cc

Browse files
soreauJiri Kosina
authored andcommitted
HID: sony: Add nyko core controller support
This adds rumble and LED support for nyko core controllers using the sino lite chip vendor:1345 product:3008, for PS3. Setting operational mode and output reports are the same as sixaxis but the input report has a different format since the PS3 accepts HID usb devices. For it to work, an exception is needed to skip overriding the report descriptor and use the original one. Signed-off-by: Scott Moreau <[email protected]> Acked-by: Antonio Ospite <[email protected]> Signed-off-by: Jiri Kosina <[email protected]>
1 parent 19f4c2b commit 74500cc

File tree

3 files changed

+11
-0
lines changed

3 files changed

+11
-0
lines changed

drivers/hid/hid-core.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2003,6 +2003,7 @@ static const struct hid_device_id hid_have_special_driver[] = {
20032003
{ HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_SONY, USB_DEVICE_ID_SONY_PS4_CONTROLLER) },
20042004
{ HID_USB_DEVICE(USB_VENDOR_ID_SONY, USB_DEVICE_ID_SONY_VAIO_VGX_MOUSE) },
20052005
{ HID_USB_DEVICE(USB_VENDOR_ID_SONY, USB_DEVICE_ID_SONY_VAIO_VGP_MOUSE) },
2006+
{ HID_USB_DEVICE(USB_VENDOR_ID_SINO_LITE, USB_DEVICE_ID_SINO_LITE_CONTROLLER) },
20062007
{ HID_USB_DEVICE(USB_VENDOR_ID_STEELSERIES, USB_DEVICE_ID_STEELSERIES_SRWS1) },
20072008
{ HID_USB_DEVICE(USB_VENDOR_ID_SUNPLUS, USB_DEVICE_ID_SUNPLUS_WDESKTOP) },
20082009
{ HID_USB_DEVICE(USB_VENDOR_ID_THINGM, USB_DEVICE_ID_BLINK1) },

drivers/hid/hid-ids.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -872,6 +872,9 @@
872872
#define USB_DEVICE_ID_SONY_BUZZ_CONTROLLER 0x0002
873873
#define USB_DEVICE_ID_SONY_WIRELESS_BUZZ_CONTROLLER 0x1000
874874

875+
#define USB_VENDOR_ID_SINO_LITE 0x1345
876+
#define USB_DEVICE_ID_SINO_LITE_CONTROLLER 0x3008
877+
875878
#define USB_VENDOR_ID_SOUNDGRAPH 0x15c2
876879
#define USB_DEVICE_ID_SOUNDGRAPH_IMON_FIRST 0x0034
877880
#define USB_DEVICE_ID_SOUNDGRAPH_IMON_LAST 0x0046

drivers/hid/hid-sony.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@
5050
#define MOTION_CONTROLLER_BT BIT(8)
5151
#define NAVIGATION_CONTROLLER_USB BIT(9)
5252
#define NAVIGATION_CONTROLLER_BT BIT(10)
53+
#define SINO_LITE_CONTROLLER BIT(11)
5354

5455
#define SIXAXIS_CONTROLLER (SIXAXIS_CONTROLLER_USB | SIXAXIS_CONTROLLER_BT)
5556
#define MOTION_CONTROLLER (MOTION_CONTROLLER_USB | MOTION_CONTROLLER_BT)
@@ -1118,6 +1119,9 @@ static __u8 *sony_report_fixup(struct hid_device *hdev, __u8 *rdesc,
11181119
{
11191120
struct sony_sc *sc = hid_get_drvdata(hdev);
11201121

1122+
if (sc->quirks & SINO_LITE_CONTROLLER)
1123+
return rdesc;
1124+
11211125
/*
11221126
* Some Sony RF receivers wrongly declare the mouse pointer as a
11231127
* a constant non-data variable.
@@ -2523,6 +2527,9 @@ static const struct hid_device_id sony_devices[] = {
25232527
.driver_data = DUALSHOCK4_CONTROLLER_USB },
25242528
{ HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_SONY, USB_DEVICE_ID_SONY_PS4_CONTROLLER),
25252529
.driver_data = DUALSHOCK4_CONTROLLER_BT },
2530+
/* Nyko Core Controller for PS3 */
2531+
{ HID_USB_DEVICE(USB_VENDOR_ID_SINO_LITE, USB_DEVICE_ID_SINO_LITE_CONTROLLER),
2532+
.driver_data = SIXAXIS_CONTROLLER_USB | SINO_LITE_CONTROLLER },
25262533
{ }
25272534
};
25282535
MODULE_DEVICE_TABLE(hid, sony_devices);

0 commit comments

Comments
 (0)