summaryrefslogtreecommitdiffstats
path: root/drivers/hid/hid-sony.c
diff options
context:
space:
mode:
authorFrank Praznik <frank.praznik@oh.rr.com>2014-03-15 14:41:15 +0100
committerJiri Kosina <jkosina@suse.cz>2014-04-01 18:44:06 +0200
commit914c578391c7cf55d88e2a553208e7523d0ddf1a (patch)
tree487929d4522bb9de85996c3a077477c5101f03af /drivers/hid/hid-sony.c
parentHID: hidp: Add a comment that some devices depend on the current behavior of ... (diff)
downloadlinux-914c578391c7cf55d88e2a553208e7523d0ddf1a.tar.xz
linux-914c578391c7cf55d88e2a553208e7523d0ddf1a.zip
HID: sony: Fix Sixaxis cable state detection
Byte 31 of the Sixaxis report can change depending on whether or not the controller is rumbling. Using bit 3 is the only reliable way to detect the state of the cable regardless of rumble activity. Signed-off-by: Frank Praznik <frank.praznik@oh.rr.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Diffstat (limited to '')
-rw-r--r--drivers/hid/hid-sony.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/hid/hid-sony.c b/drivers/hid/hid-sony.c
index b1aa6f00c827..31ba01a39e81 100644
--- a/drivers/hid/hid-sony.c
+++ b/drivers/hid/hid-sony.c
@@ -864,7 +864,7 @@ static void sixaxis_parse_report(struct sony_sc *sc, __u8 *rd, int size)
battery_capacity = sixaxis_battery_capacity[index];
battery_charging = 0;
}
- cable_state = !((rd[31] >> 4) & 0x01);
+ cable_state = !(rd[31] & 0x04);
spin_lock_irqsave(&sc->lock, flags);
sc->cable_state = cable_state;