aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/hid/hid-sony.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/hid/hid-sony.c b/drivers/hid/hid-sony.c
index c372368e438c..ecc6616ab550 100644
--- a/drivers/hid/hid-sony.c
+++ b/drivers/hid/hid-sony.c
@@ -935,12 +935,13 @@ static void sixaxis_parse_report(struct sony_sc *sc, __u8 *rd, int size)
935 if (rd[30] >= 0xee) { 935 if (rd[30] >= 0xee) {
936 battery_capacity = 100; 936 battery_capacity = 100;
937 battery_charging = !(rd[30] & 0x01); 937 battery_charging = !(rd[30] & 0x01);
938 cable_state = 1;
938 } else { 939 } else {
939 __u8 index = rd[30] <= 5 ? rd[30] : 5; 940 __u8 index = rd[30] <= 5 ? rd[30] : 5;
940 battery_capacity = sixaxis_battery_capacity[index]; 941 battery_capacity = sixaxis_battery_capacity[index];
941 battery_charging = 0; 942 battery_charging = 0;
943 cable_state = 0;
942 } 944 }
943 cable_state = !(rd[31] & 0x04);
944 945
945 spin_lock_irqsave(&sc->lock, flags); 946 spin_lock_irqsave(&sc->lock, flags);
946 sc->cable_state = cable_state; 947 sc->cable_state = cable_state;