diff options
author | Frank Praznik <frank.praznik@oh.rr.com> | 2014-01-16 21:42:31 -0500 |
---|---|---|
committer | Jiri Kosina <jkosina@suse.cz> | 2014-01-17 04:47:40 -0500 |
commit | 8ab1676b614e4ef816a83ba214523b4fac256fce (patch) | |
tree | c87b480b28cff34cff858227103e310e4f4899b0 /drivers/hid | |
parent | cad665a2a937d070e5909beec37f891a95911bef (diff) |
HID: sony: Use separate identifiers for USB and Bluetooth connected Dualshock 4 controllers.
Use separate identifiers for Dualshock 4 controllers connected via USB and
Bluetooth.
Signed-off-by: Frank Praznik <frank.praznik@oh.rr.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Diffstat (limited to 'drivers/hid')
-rw-r--r-- | drivers/hid/hid-sony.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/drivers/hid/hid-sony.c b/drivers/hid/hid-sony.c index 1dfed2365d40..2f992e12f6f9 100644 --- a/drivers/hid/hid-sony.c +++ b/drivers/hid/hid-sony.c | |||
@@ -38,9 +38,10 @@ | |||
38 | #define SIXAXIS_CONTROLLER_BT BIT(2) | 38 | #define SIXAXIS_CONTROLLER_BT BIT(2) |
39 | #define BUZZ_CONTROLLER BIT(3) | 39 | #define BUZZ_CONTROLLER BIT(3) |
40 | #define PS3REMOTE BIT(4) | 40 | #define PS3REMOTE BIT(4) |
41 | #define DUALSHOCK4_CONTROLLER BIT(5) | 41 | #define DUALSHOCK4_CONTROLLER_USB BIT(5) |
42 | #define DUALSHOCK4_CONTROLLER_BT BIT(6) | ||
42 | 43 | ||
43 | #define SONY_LED_SUPPORT (SIXAXIS_CONTROLLER_USB | BUZZ_CONTROLLER | DUALSHOCK4_CONTROLLER) | 44 | #define SONY_LED_SUPPORT (SIXAXIS_CONTROLLER_USB | BUZZ_CONTROLLER | DUALSHOCK4_CONTROLLER_USB) |
44 | 45 | ||
45 | #define MAX_LEDS 4 | 46 | #define MAX_LEDS 4 |
46 | 47 | ||
@@ -478,7 +479,7 @@ static void sony_set_leds(struct hid_device *hdev, const __u8 *leds, int count) | |||
478 | if (drv_data->quirks & BUZZ_CONTROLLER && count == 4) { | 479 | if (drv_data->quirks & BUZZ_CONTROLLER && count == 4) { |
479 | buzz_set_leds(hdev, leds); | 480 | buzz_set_leds(hdev, leds); |
480 | } else if ((drv_data->quirks & SIXAXIS_CONTROLLER_USB) || | 481 | } else if ((drv_data->quirks & SIXAXIS_CONTROLLER_USB) || |
481 | (drv_data->quirks & DUALSHOCK4_CONTROLLER)) { | 482 | (drv_data->quirks & DUALSHOCK4_CONTROLLER_USB)) { |
482 | for (n = 0; n < count; n++) | 483 | for (n = 0; n < count; n++) |
483 | drv_data->led_state[n] = leds[n]; | 484 | drv_data->led_state[n] = leds[n]; |
484 | schedule_work(&drv_data->state_worker); | 485 | schedule_work(&drv_data->state_worker); |
@@ -583,7 +584,7 @@ static int sony_leds_init(struct hid_device *hdev) | |||
583 | name_fmt = "%s::sony%d"; | 584 | name_fmt = "%s::sony%d"; |
584 | } | 585 | } |
585 | 586 | ||
586 | if (drv_data->quirks & DUALSHOCK4_CONTROLLER) { | 587 | if (drv_data->quirks & DUALSHOCK4_CONTROLLER_USB) { |
587 | drv_data->led_count = 3; | 588 | drv_data->led_count = 3; |
588 | max_brightness = 255; | 589 | max_brightness = 255; |
589 | } else { | 590 | } else { |
@@ -775,7 +776,7 @@ static int sony_probe(struct hid_device *hdev, const struct hid_device_id *id) | |||
775 | } | 776 | } |
776 | else if (sc->quirks & SIXAXIS_CONTROLLER_BT) | 777 | else if (sc->quirks & SIXAXIS_CONTROLLER_BT) |
777 | ret = sixaxis_set_operational_bt(hdev); | 778 | ret = sixaxis_set_operational_bt(hdev); |
778 | else if (sc->quirks & DUALSHOCK4_CONTROLLER) { | 779 | else if (sc->quirks & DUALSHOCK4_CONTROLLER_USB) { |
779 | ret = 0; | 780 | ret = 0; |
780 | INIT_WORK(&sc->state_worker, dualshock4_state_worker); | 781 | INIT_WORK(&sc->state_worker, dualshock4_state_worker); |
781 | } else { | 782 | } else { |
@@ -840,9 +841,9 @@ static const struct hid_device_id sony_devices[] = { | |||
840 | .driver_data = PS3REMOTE }, | 841 | .driver_data = PS3REMOTE }, |
841 | /* Sony Dualshock 4 controllers for PS4 */ | 842 | /* Sony Dualshock 4 controllers for PS4 */ |
842 | { HID_USB_DEVICE(USB_VENDOR_ID_SONY, USB_DEVICE_ID_SONY_PS4_CONTROLLER), | 843 | { HID_USB_DEVICE(USB_VENDOR_ID_SONY, USB_DEVICE_ID_SONY_PS4_CONTROLLER), |
843 | .driver_data = DUALSHOCK4_CONTROLLER }, | 844 | .driver_data = DUALSHOCK4_CONTROLLER_USB }, |
844 | { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_SONY, USB_DEVICE_ID_SONY_PS4_CONTROLLER), | 845 | { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_SONY, USB_DEVICE_ID_SONY_PS4_CONTROLLER), |
845 | .driver_data = DUALSHOCK4_CONTROLLER }, | 846 | .driver_data = DUALSHOCK4_CONTROLLER_BT }, |
846 | { } | 847 | { } |
847 | }; | 848 | }; |
848 | MODULE_DEVICE_TABLE(hid, sony_devices); | 849 | MODULE_DEVICE_TABLE(hid, sony_devices); |