Skip to contentSkip to conversation

Input: wacom - Export battery scope

PATCH Applied Bastien Nocera 2 participants 2 messages Oct 13, 2013 – Oct 16, 2013

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Input: wacom - Export battery scope

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

---
 drivers/input/tablet/wacom_sys.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/input/tablet/wacom_sys.c +4 -0
index 79b69ea..e53416a 100644
@@ -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
 };
 
@@ -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;
Signature · 1 line
1.8.3.1
maintainer Applied
#1 lore raw
Quoted 7 lines · Bastien Nocera

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

Applied, thank you.

Quoted 30 lines
---
 drivers/input/tablet/wacom_sys.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/input/tablet/wacom_sys.c +4 -0
index 79b69ea..e53416a 100644
@@ -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
 };
 
@@ -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;
Signature · 1 line
1.8.3.1
Signature · 1 line
Dmitry