linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Input: wacom - Export battery scope
@ 2013-10-13 19:49 Bastien Nocera
  2013-10-16  6:36 ` Dmitry Torokhov
  0 siblings, 1 reply; 2+ messages in thread
From: Bastien Nocera @ 2013-10-13 19:49 UTC (permalink / raw)
  To: linux-input; +Cc: dmitry.torokhov, peter.hutterer, chris, killertofu


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>
---
 drivers/input/tablet/wacom_sys.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/input/tablet/wacom_sys.c b/drivers/input/tablet/wacom_sys.c
index 79b69ea..e53416a 100644
--- a/drivers/input/tablet/wacom_sys.c
+++ b/drivers/input/tablet/wacom_sys.c
@@ -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;
-- 
1.8.3.1



^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] Input: wacom - Export battery scope
  2013-10-13 19:49 [PATCH] Input: wacom - Export battery scope Bastien Nocera
@ 2013-10-16  6:36 ` Dmitry Torokhov
  0 siblings, 0 replies; 2+ messages in thread
From: Dmitry Torokhov @ 2013-10-16  6:36 UTC (permalink / raw)
  To: Bastien Nocera; +Cc: linux-input, peter.hutterer, chris, killertofu

On Sun, Oct 13, 2013 at 09:49:22PM +0200, Bastien Nocera wrote:
> 
> 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>


Applied, thank you.

> ---
>  drivers/input/tablet/wacom_sys.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/drivers/input/tablet/wacom_sys.c b/drivers/input/tablet/wacom_sys.c
> index 79b69ea..e53416a 100644
> --- a/drivers/input/tablet/wacom_sys.c
> +++ b/drivers/input/tablet/wacom_sys.c
> @@ -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;
> -- 
> 1.8.3.1
> 
> 

-- 
Dmitry

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-10-16  6:36 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-10-13 19:49 [PATCH] Input: wacom - Export battery scope Bastien Nocera
2013-10-16  6:36 ` Dmitry Torokhov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).