Skip to content

Commit

Permalink
Input: wacom - export battery scope
Browse files Browse the repository at this point in the history
This will stop UPower from detecting the tablet as a power supply,
and using its battery status to hibernate or switch off the machine.

https://bugs.freedesktop.org/show_bug.cgi?id=70321

Signed-off-by: Bastien Nocera <hadess@hadess.net>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
  • Loading branch information
Bastien Nocera authored and Dmitry Torokhov committed Oct 16, 2013
1 parent 0a6ad06 commit 6e2a6e8
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions drivers/input/tablet/wacom_sys.c
Original file line number Diff line number Diff line change
Expand Up @@ -1031,6 +1031,7 @@ static void wacom_destroy_leds(struct wacom *wacom)
}

static enum power_supply_property wacom_battery_props[] = {
POWER_SUPPLY_PROP_SCOPE,
POWER_SUPPLY_PROP_CAPACITY
};

Expand All @@ -1042,6 +1043,9 @@ static int wacom_battery_get_property(struct power_supply *psy,
int ret = 0;

switch (psp) {
case POWER_SUPPLY_PROP_SCOPE:
val->intval = POWER_SUPPLY_SCOPE_DEVICE;
break;
case POWER_SUPPLY_PROP_CAPACITY:
val->intval =
wacom->wacom_wac.battery_capacity * 100 / 31;
Expand Down

0 comments on commit 6e2a6e8

Please sign in to comment.