Skip to content

Commit c35f31f

Browse files
author
Jiri Kosina
committed
Merge branch 'for-5.12/sony' into for-linus
- tilt support on Sony Guitar Hero devices from Sanjay Govind
2 parents e2adf27 + 32e411d commit c35f31f

File tree

3 files changed

+20
-7
lines changed

3 files changed

+20
-7
lines changed

drivers/hid/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -927,6 +927,7 @@ config HID_SONY
927927
* Sony PS3 Blue-ray Disk Remote Control (Bluetooth)
928928
* Logitech Harmony adapter for Sony Playstation 3 (Bluetooth)
929929
* Guitar Hero Live PS3 and Wii U guitar dongles
930+
* Guitar Hero PS3 and PC guitar dongles
930931

931932
config SONY_FF
932933
bool "Sony PS2/3/4 accessories force feedback support"

drivers/hid/hid-ids.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,9 @@
4040
#define USB_VENDOR_ID_ACTIONSTAR 0x2101
4141
#define USB_DEVICE_ID_ACTIONSTAR_1011 0x1011
4242

43+
#define USB_VENDOR_ID_ACTIVISION 0x1430
44+
#define USB_DEVICE_ID_ACTIVISION_GUITAR_DONGLE 0x474c
45+
4346
#define USB_VENDOR_ID_ADS_TECH 0x06e1
4447
#define USB_DEVICE_ID_ADS_TECH_RADIO_SI470X 0xa155
4548

@@ -1083,8 +1086,9 @@
10831086
#define USB_DEVICE_ID_SONY_BUZZ_CONTROLLER 0x0002
10841087
#define USB_DEVICE_ID_SONY_WIRELESS_BUZZ_CONTROLLER 0x1000
10851088

1086-
#define USB_VENDOR_ID_SONY_GHLIVE 0x12ba
1089+
#define USB_VENDOR_ID_SONY_RHYTHM 0x12ba
10871090
#define USB_DEVICE_ID_SONY_PS3WIIU_GHLIVE_DONGLE 0x074b
1091+
#define USB_DEVICE_ID_SONY_PS3_GUITAR_DONGLE 0x0100
10881092

10891093
#define USB_VENDOR_ID_SINO_LITE 0x1345
10901094
#define USB_DEVICE_ID_SINO_LITE_CONTROLLER 0x3008

drivers/hid/hid-sony.c

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
* Copyright (c) 2014-2016 Frank Praznik <[email protected]>
1313
* Copyright (c) 2018 Todd Kelner
1414
* Copyright (c) 2020 Pascal Giard <[email protected]>
15+
* Copyright (c) 2020 Sanjay Govind <[email protected]>
1516
*/
1617

1718
/*
@@ -59,7 +60,8 @@
5960
#define NSG_MR5U_REMOTE_BT BIT(14)
6061
#define NSG_MR7U_REMOTE_BT BIT(15)
6162
#define SHANWAN_GAMEPAD BIT(16)
62-
#define GHL_GUITAR_PS3WIIU BIT(17)
63+
#define GH_GUITAR_CONTROLLER BIT(17)
64+
#define GHL_GUITAR_PS3WIIU BIT(18)
6365

6466
#define SIXAXIS_CONTROLLER (SIXAXIS_CONTROLLER_USB | SIXAXIS_CONTROLLER_BT)
6567
#define MOTION_CONTROLLER (MOTION_CONTROLLER_USB | MOTION_CONTROLLER_BT)
@@ -84,7 +86,7 @@
8486
#define NSG_MRXU_MAX_Y 1868
8587

8688
#define GHL_GUITAR_POKE_INTERVAL 10 /* In seconds */
87-
#define GHL_GUITAR_TILT_USAGE 44
89+
#define GUITAR_TILT_USAGE 44
8890

8991
/* Magic value and data taken from GHLtarUtility:
9092
* https://github.com/ghlre/GHLtarUtility/blob/master/PS3Guitar.cs
@@ -692,7 +694,7 @@ static int guitar_mapping(struct hid_device *hdev, struct hid_input *hi,
692694
if ((usage->hid & HID_USAGE_PAGE) == HID_UP_MSVENDOR) {
693695
unsigned int abs = usage->hid & HID_USAGE;
694696

695-
if (abs == GHL_GUITAR_TILT_USAGE) {
697+
if (abs == GUITAR_TILT_USAGE) {
696698
hid_map_usage_clear(hi, usage, bit, max, EV_ABS, ABS_RY);
697699
return 1;
698700
}
@@ -1481,7 +1483,7 @@ static int sony_mapping(struct hid_device *hdev, struct hid_input *hi,
14811483
if (sc->quirks & DUALSHOCK4_CONTROLLER)
14821484
return ds4_mapping(hdev, hi, field, usage, bit, max);
14831485

1484-
if (sc->quirks & GHL_GUITAR_PS3WIIU)
1486+
if (sc->quirks & GH_GUITAR_CONTROLLER)
14851487
return guitar_mapping(hdev, hi, field, usage, bit, max);
14861488

14871489
/* Let hid-core decide for the others */
@@ -3167,8 +3169,14 @@ static const struct hid_device_id sony_devices[] = {
31673169
{ HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_SMK, USB_DEVICE_ID_SMK_NSG_MR7U_REMOTE),
31683170
.driver_data = NSG_MR7U_REMOTE_BT },
31693171
/* Guitar Hero Live PS3 and Wii U guitar dongles */
3170-
{ HID_USB_DEVICE(USB_VENDOR_ID_SONY_GHLIVE, USB_DEVICE_ID_SONY_PS3WIIU_GHLIVE_DONGLE),
3171-
.driver_data = GHL_GUITAR_PS3WIIU},
3172+
{ HID_USB_DEVICE(USB_VENDOR_ID_SONY_RHYTHM, USB_DEVICE_ID_SONY_PS3WIIU_GHLIVE_DONGLE),
3173+
.driver_data = GHL_GUITAR_PS3WIIU | GH_GUITAR_CONTROLLER },
3174+
/* Guitar Hero PC Guitar Dongle */
3175+
{ HID_USB_DEVICE(USB_VENDOR_ID_ACTIVISION, USB_DEVICE_ID_ACTIVISION_GUITAR_DONGLE),
3176+
.driver_data = GH_GUITAR_CONTROLLER },
3177+
/* Guitar Hero PS3 World Tour Guitar Dongle */
3178+
{ HID_USB_DEVICE(USB_VENDOR_ID_SONY_RHYTHM, USB_DEVICE_ID_SONY_PS3_GUITAR_DONGLE),
3179+
.driver_data = GH_GUITAR_CONTROLLER },
31723180
{ }
31733181
};
31743182
MODULE_DEVICE_TABLE(hid, sony_devices);

0 commit comments

Comments
 (0)