diff options
author | Chris Bagwell <chris@cnpbagwell.com> | 2012-03-26 02:26:30 -0400 |
---|---|---|
committer | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2012-03-26 02:33:17 -0400 |
commit | a1d552cc15b0be9124ccba593f99f59c4ec1e153 (patch) | |
tree | bae307464abfba32dfc3a4c19bbe38c1106746fe /drivers/input/tablet/wacom_wac.c | |
parent | 16bf288c4be67b68c3fcb6561ff145702cb7bd22 (diff) |
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.c | 5 |
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) | |||
1054 | 1054 | ||
1055 | connected = data[1] & 0x01; | 1055 | connected = data[1] & 0x01; |
1056 | if (connected) { | 1056 | if (connected) { |
1057 | int pid; | 1057 | int pid, battery; |
1058 | 1058 | ||
1059 | pid = get_unaligned_be16(&data[6]); | 1059 | pid = get_unaligned_be16(&data[6]); |
1060 | battery = data[5] & 0x3f; | ||
1060 | if (wacom->pid != pid) { | 1061 | if (wacom->pid != pid) { |
1061 | wacom->pid = pid; | 1062 | wacom->pid = pid; |
1062 | wacom_schedule_work(wacom); | 1063 | wacom_schedule_work(wacom); |
1063 | } | 1064 | } |
1065 | wacom->battery_capacity = battery; | ||
1064 | } else if (wacom->pid != 0) { | 1066 | } else if (wacom->pid != 0) { |
1065 | /* disconnected while previously connected */ | 1067 | /* disconnected while previously connected */ |
1066 | wacom->pid = 0; | 1068 | wacom->pid = 0; |
1067 | wacom_schedule_work(wacom); | 1069 | wacom_schedule_work(wacom); |
1070 | wacom->battery_capacity = 0; | ||
1068 | } | 1071 | } |
1069 | 1072 | ||
1070 | return 0; | 1073 | return 0; |