From 7f235b5cbe98b822857ba5f2b71bb00bc174f151 Mon Sep 17 00:00:00 2001 From: Nagarjuna Kristam Date: Wed, 11 Apr 2012 11:11:06 +0530 Subject: 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 Reviewed-on: http://git-master/r/95804 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Bharat Nihalani --- drivers/hid/hid-sony.c | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) (limited to 'drivers/hid') 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; -- cgit v1.2.3