]> git.baikalelectronics.ru Git - kernel.git/commit
HID: sony: Set the Sixaxis cable state correctly
authorFrank Praznik <frank.praznik@oh.rr.com>
Fri, 29 Aug 2014 17:11:52 +0000 (13:11 -0400)
committerJiri Kosina <jkosina@suse.cz>
Mon, 1 Sep 2014 09:20:52 +0000 (11:20 +0200)
commite4a7589704ef38325f1dbdeeeeb373ab8d9b654e
treecea0734b40c126147fcaf39e8ac995743ed19fc2
parentfad14a46529cafd2f8605a339c05dfa7029d3cfe
HID: sony: Set the Sixaxis cable state correctly

Bit 3 in byte 31 of the Sixaxis report indicates whether the battery is
charging or not charging as opposed to whether or not the cable is plugged in.
As a result, when connected via USB and fully charged, the power_supply status
is wrongly reported as 'Discharging' instead of 'Full'.

Use the battery level value to set the cable state so that the power status
is reported correctly as that seems to be the only reliable way to determine the
cable status on the Sixaxis.

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