summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorNagarjuna Kristam <nkristam@nvidia.com>2012-04-11 11:11:06 +0530
committerRohan Somvanshi <rsomvanshi@nvidia.com>2012-04-16 03:49:39 -0700
commit7f235b5cbe98b822857ba5f2b71bb00bc174f151 (patch)
treea0f376933c1a07ad30e43cd3b05f98640f7ca880 /drivers
parent1e0269efe4c107a9bae415cb6b18fb2ab3866cda (diff)
HID: hid-sony: set sony PS3 controller LEDs over bluetooth
set PS3 controller first LED, when connected over bluetooth. Bug 847075 Change-Id: Ia32c692cbd5d7e041625d8bccfcb935ae669e82a Signed-off-by: Nagarjuna Kristam <nkristam@nvidia.com> Reviewed-on: http://git-master/r/95804 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/hid/hid-sony.c25
1 files changed, 24 insertions, 1 deletions
diff --git a/drivers/hid/hid-sony.c b/drivers/hid/hid-sony.c
index 5cd25bd907f8..81c054e866df 100644
--- a/drivers/hid/hid-sony.c
+++ b/drivers/hid/hid-sony.c
@@ -155,6 +155,26 @@ static int sixaxis_set_operational_bt(struct hid_device *hdev)
return hdev->hid_output_raw_report(hdev, buf, sizeof(buf), HID_FEATURE_REPORT);
}
+static void sixaxis_set_led_bt(struct hid_device *hdev)
+{
+ hid_info(hdev, "set LED BT\n");
+ /* set first LED on BT connection */
+ unsigned char led_data[] = {
+ 0x01,
+ /* rumble values */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ /* LED settings 0x02=LED1 .. 0x10=LED4 */
+ 0x02,
+ 0xff, 0x27, 0x10, 0x00, 0x32, /* LED 4 */
+ 0xff, 0x27, 0x10, 0x00, 0x32, /* LED 3 */
+ 0xff, 0x27, 0x10, 0x00, 0x32, /* LED 2 */
+ 0xff, 0x27, 0x10, 0x00, 0x32, /* LED 1 */
+ 0x00, 0x00, 0x00, 0x00, 0x00
+ };
+ hdev->hid_output_raw_report(hdev, led_data, sizeof(led_data),
+ HID_OUTPUT_REPORT);
+}
+
static int sony_probe(struct hid_device *hdev, const struct hid_device_id *id)
{
int ret;
@@ -187,8 +207,11 @@ static int sony_probe(struct hid_device *hdev, const struct hid_device_id *id)
hdev->hid_output_raw_report = sixaxis_usb_output_raw_report;
ret = sixaxis_set_operational_usb(hdev);
}
- else if (sc->quirks & SIXAXIS_CONTROLLER_BT)
+ else if (sc->quirks & SIXAXIS_CONTROLLER_BT) {
ret = sixaxis_set_operational_bt(hdev);
+ if (ret >= 0)
+ sixaxis_set_led_bt(hdev);
+ }
else
ret = 0;