summaryrefslogtreecommitdiff
path: root/drivers/hid/hid-sony.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/hid/hid-sony.c')
-rw-r--r--drivers/hid/hid-sony.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/hid/hid-sony.c b/drivers/hid/hid-sony.c
index 947d2088a700..0111d3028c4b 100644
--- a/drivers/hid/hid-sony.c
+++ b/drivers/hid/hid-sony.c
@@ -845,12 +845,12 @@ static void sixaxis_parse_report(struct sony_sc *sc, __u8 *rd, int size)
*/
if (rd[30] >= 0xee) {
battery_capacity = 100;
- battery_charging = rd[30] & 0x01;
+ battery_charging = !(rd[30] & 0x01);
} else {
battery_capacity = sixaxis_battery_capacity[rd[30]];
battery_charging = 0;
}
- cable_state = (rd[31] >> 4) & 0x01;
+ cable_state = !((rd[31] >> 4) & 0x01);
spin_lock_irqsave(&sc->lock, flags);
sc->cable_state = cable_state;