Input: wacom - wireless battery status
Signed-off-by: Chris Bagwell <chris@cnpbagwell.com>
Tested-by: Jason Gerecke <killertofu@gmail.com>
Acked-by: Ping Cheng <pingc@wacom.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
diff --git a/drivers/input/tablet/wacom_wac.c b/drivers/input/tablet/wacom_wac.c
index fce7a09..99fb6fe 100644
--- a/drivers/input/tablet/wacom_wac.c
+++ b/drivers/input/tablet/wacom_wac.c
@@ -1054,17 +1054,20 @@
connected = data[1] & 0x01;
if (connected) {
- int pid;
+ int pid, battery;
pid = get_unaligned_be16(&data[6]);
+ battery = data[5] & 0x3f;
if (wacom->pid != pid) {
wacom->pid = pid;
wacom_schedule_work(wacom);
}
+ wacom->battery_capacity = battery;
} else if (wacom->pid != 0) {
/* disconnected while previously connected */
wacom->pid = 0;
wacom_schedule_work(wacom);
+ wacom->battery_capacity = 0;
}
return 0;