From: Bastien Nocera <hadess@hadess.net>
To: linux-input@vger.kernel.org
Cc: dmitry.torokhov@gmail.com, peter.hutterer@who-t.net,
chris@cnpbagwell.com, killertofu@gmail.com
Subject: [PATCH] Input: wacom - Export battery scope
Date: Sun, 13 Oct 2013 21:49:22 +0200 [thread overview]
Message-ID: <1381693762.21482.2.camel@nuvo> (raw)
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
next reply other threads:[~2013-10-13 19:49 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-10-13 19:49 Bastien Nocera [this message]
2013-10-16 6:36 ` [PATCH] Input: wacom - Export battery scope Dmitry Torokhov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1381693762.21482.2.camel@nuvo \
--to=hadess@hadess.net \
--cc=chris@cnpbagwell.com \
--cc=dmitry.torokhov@gmail.com \
--cc=killertofu@gmail.com \
--cc=linux-input@vger.kernel.org \
--cc=peter.hutterer@who-t.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).