aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input/tablet/wacom_wac.c
diff options
context:
space:
mode:
authorChris Bagwell <chris@cnpbagwell.com>2012-03-25 23:26:30 -0700
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2012-03-25 23:33:17 -0700
commita1d552cc15b0be9124ccba593f99f59c4ec1e153 (patch)
treebae307464abfba32dfc3a4c19bbe38c1106746fe /drivers/input/tablet/wacom_wac.c
parentInput: wacom - create inputs when wireless connect (diff)
downloadlinux-dev-a1d552cc15b0be9124ccba593f99f59c4ec1e153.tar.xz
linux-dev-a1d552cc15b0be9124ccba593f99f59c4ec1e153.zip
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>
Diffstat (limited to 'drivers/input/tablet/wacom_wac.c')
-rw-r--r--drivers/input/tablet/wacom_wac.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/input/tablet/wacom_wac.c b/drivers/input/tablet/wacom_wac.c
index fce7a09fb5db..99fb6fed2bf3 100644
--- a/drivers/input/tablet/wacom_wac.c
+++ b/drivers/input/tablet/wacom_wac.c
@@ -1054,17 +1054,20 @@ static int wacom_wireless_irq(struct wacom_wac *wacom, size_t len)
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;