HID: hid-sony - allow 3rd party INTEC controller to turn off all leds
authorSimon Wood <simon@mungewell.org>
Mon, 14 Apr 2014 14:11:37 +0000 (10:11 -0400)
committerJiri Kosina <jkosina@suse.cz>
Thu, 24 Apr 2014 16:53:42 +0000 (18:53 +0200)
Without this patch the 3rd party INTEC (PS3) controller will blink all
leds when user turns them off, it appears to require an extra flag set.

Signed-off-by: Simon Wood <simon@mungewell.org>
Signed-off-by: Frank Praznik <frank.praznik@oh.rr.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
drivers/hid/hid-sony.c

index 243722bbc3ed990d692f531005dbaabe98c4dbdd..2259eaa8b98886d8ae0ec454a2a0fce8aa99e695 100644 (file)
@@ -1420,6 +1420,10 @@ static void sixaxis_state_worker(struct work_struct *work)
        report.data.leds_bitmap |= sc->led_state[2] << 3;
        report.data.leds_bitmap |= sc->led_state[3] << 4;
 
+       /* Set flag for all leds off, required for 3rd party INTEC controller */
+       if ((report.data.leds_bitmap & 0x1E) == 0)
+               report.data.leds_bitmap |= 0x20;
+
        /*
         * The LEDs in the report are indexed in reverse order to their
         * corresponding light on the controller.