From: Jeremy Fitzhardinge <jeremy@goop.org>
To: Chase Douglas <chase.douglas@canonical.com>
Cc: Jiri Kosina <jkosina@suse.cz>,
linux-input@vger.kernel.org, vojtech@ucw.cz,
Przemo Firszt <przemo@firszt.eu>
Subject: Re: [PATCH RFC] hid-input: add support for HID devices reporting Battery Strength
Date: Wed, 23 Nov 2011 13:07:13 -0800 [thread overview]
Message-ID: <4ECD6081.6080003@goop.org> (raw)
In-Reply-To: <4ECD20FB.7030705@canonical.com>
On 11/23/2011 08:36 AM, Chase Douglas wrote:
> On 11/23/2011 12:49 AM, Jeremy Fitzhardinge wrote:
>> Some HID devices, such as my Bluetooth mouse, report their battery
>> strength as an event. Rather than passing it through as a strange
>> absolute input event, this patch registers it with the power_supply
>> subsystem as a battery, so that the device's Battery Strength can be
>> reported to usermode.
>>
>> The battery appears in sysfs names
>> /sys/class/power_supply/hid-<UNIQ>-battery, and it is a child of the
>> battery-containing device, so it should be clear what it's the battery of.
>>
>> Unfortunately on my current Fedora 16 system, while the battery does
>> appear in the UI, it is listed as a Laptop Battery with 0% charge (since
>> it ignores the "capacity" property of the battery and instead computes
>> it from the "energy*" fields, which we can't supply given the limited
>> information contained within the HID Report).
>>
>> Still, this patch is the first step.
>>
>> Signed-off-by: Jeremy Fitzhardinge <jeremy@goop.org>
>>
>> diff --git a/drivers/hid/Kconfig b/drivers/hid/Kconfig
>> index 22a4a05..3a97f1f 100644
>> --- a/drivers/hid/Kconfig
>> +++ b/drivers/hid/Kconfig
>> @@ -31,6 +31,11 @@ config HID
>>
>> If unsure, say Y.
>>
>> +config HID_BATTERY_STRENGTH
>> + bool
>> + depends on POWER_SUPPLY
>> + default y
> This functionality will be great to have :). I'm curious why you made a
> config option for it, though. It's not a big patch, I can't think of any
> reason people wouldn't want it, and this could lead to dependency issues
> (i.e. needing to sprinkle #ifdef HID_BATTERY_STRENGTH in drivers).
>
It depends on CONFIG_POWER_SUPPLY, and I guess its possible that people
may want to unconfig it because the extra power supplies confuse
usermode (as they do Gnome 3, but non-fatally). I'm just worried that
something might want to start hibernating my machine because the mouse
is running out :/...
However, I left it as a non-user-visible config option so that it
doesn't create any more noise on that front.
The Wacom driver's version of this also has its own user-visible config
option; I don't know if there's any reason you'd turn it off.
J
next prev parent reply other threads:[~2011-11-23 21:07 UTC|newest]
Thread overview: 45+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-11-19 6:52 Supporting Battery Strength from my Bluetooth Mouse Jeremy Fitzhardinge
2011-11-19 11:18 ` Jiri Kosina
2011-11-19 21:34 ` Jeremy Fitzhardinge
2011-11-20 10:26 ` Jiri Kosina
2011-11-21 16:38 ` Jeremy Fitzhardinge
2011-11-21 17:36 ` Dmitry Torokhov
2011-11-21 17:49 ` Jeremy Fitzhardinge
2011-11-21 23:29 ` Jiri Kosina
2011-11-21 23:34 ` Jeremy Fitzhardinge
2011-11-22 0:03 ` Jiri Kosina
2011-11-23 8:49 ` [PATCH RFC] hid-input: add support for HID devices reporting Battery Strength Jeremy Fitzhardinge
2011-11-23 16:36 ` Chase Douglas
2011-11-23 21:07 ` Jeremy Fitzhardinge [this message]
2011-11-23 21:52 ` Przemo Firszt
2011-11-28 21:33 ` Jiri Kosina
2011-12-02 5:52 ` Daniel Nicoletti
2011-12-02 17:44 ` Jeremy Fitzhardinge
2011-12-02 18:29 ` Daniel Nicoletti
2011-12-03 6:09 ` Jeremy Fitzhardinge
2011-12-03 6:13 ` [GIT PULL RFC] directly poll battery strength when reading power_supply Jeremy Fitzhardinge
2011-12-06 9:17 ` Jiri Kosina
2011-12-08 1:56 ` Jeremy Fitzhardinge
2012-05-19 4:10 ` Daniel Nicoletti
2011-12-06 9:56 ` Richard Hughes
2011-12-06 17:10 ` Jeremy Fitzhardinge
2011-12-07 12:51 ` Richard Hughes
2011-12-07 17:25 ` Jeremy Fitzhardinge
2011-12-07 17:29 ` Richard Hughes
2011-12-07 17:36 ` Jeremy Fitzhardinge
2011-12-07 17:41 ` Richard Hughes
2011-12-08 1:41 ` [GIT PULL] power_supply: add power supply scope Jeremy Fitzhardinge
2011-12-08 10:02 ` Anton Vorontsov
2011-12-08 10:05 ` Richard Hughes
2011-12-08 10:42 ` Anton Vorontsov
2011-12-08 10:41 ` Anton Vorontsov
2011-12-08 16:53 ` Jeremy Fitzhardinge
2011-12-08 23:36 ` Anton Vorontsov
2011-12-09 8:18 ` Jeremy Fitzhardinge
2011-12-09 9:59 ` Anton Vorontsov
2011-12-09 16:58 ` Jeremy Fitzhardinge
2011-12-09 10:17 ` Anton Vorontsov
2011-12-09 17:49 ` Jeremy Fitzhardinge
2011-12-09 20:00 ` Daniel Nicoletti
2011-12-09 20:36 ` Jeremy Fitzhardinge
2011-12-02 17:58 ` [PATCH RFC] hid-input: add support for HID devices reporting Battery Strength Jeremy Fitzhardinge
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=4ECD6081.6080003@goop.org \
--to=jeremy@goop.org \
--cc=chase.douglas@canonical.com \
--cc=jkosina@suse.cz \
--cc=linux-input@vger.kernel.org \
--cc=przemo@firszt.eu \
--cc=vojtech@ucw.cz \
/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).