Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 305065
b: refs/heads/master
c: 4202f1d
h: refs/heads/master
i:
  305063: 6791b71
v: v3
  • Loading branch information
Przemo Firszt authored and Jiri Kosina committed Mar 28, 2012
1 parent 7cbd584 commit a0d6ad5
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: e31e3832927f5ee2d788120826e73d120dd39ea9
refs/heads/master: 4202f1de3b4f1edf74a7f8b2f8b56cb5a8398081
10 changes: 10 additions & 0 deletions trunk/drivers/hid/hid-wacom.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ struct wacom_data {
/*percent of battery capacity for Graphire
8th value means AC online and show 100% capacity */
static unsigned short batcap_gr[8] = { 1, 15, 25, 35, 50, 70, 100, 100 };
/*percent of battery capacity for Intuos4 WL, AC has a separate bit*/
static unsigned short batcap_i4[8] = { 1, 15, 30, 45, 60, 70, 85, 100 };

static enum power_supply_property wacom_battery_props[] = {
POWER_SUPPLY_PROP_PRESENT,
Expand Down Expand Up @@ -447,6 +449,7 @@ static int wacom_raw_event(struct hid_device *hdev, struct hid_report *report,
struct input_dev *input;
unsigned char *data = (unsigned char *) raw_data;
int i;
__u8 power_raw;

if (!(hdev->claimed & HID_CLAIMED_INPUT))
return 0;
Expand Down Expand Up @@ -474,6 +477,13 @@ static int wacom_raw_event(struct hid_device *hdev, struct hid_report *report,
wacom_i4_parse_report(hdev, wdata, input, data + i);
i += 10;
wacom_i4_parse_report(hdev, wdata, input, data + i);
power_raw = data[i+10];
if (power_raw != wdata->power_raw) {
wdata->power_raw = power_raw;
wdata->battery_capacity = batcap_i4[power_raw & 0x07];
wdata->ps_connected = power_raw & 0x08;
}

break;
default:
hid_err(hdev, "Unknown report: %d,%d size:%d\n",
Expand Down

0 comments on commit a0d6ad5

Please sign in to comment.