HID: logitech-hidpp: add battery support for HID++ 2.0 devices
authorPeter Hutterer <peter.hutterer@who-t.net>
Wed, 29 Jun 2016 09:28:01 +0000 (19:28 +1000)
committerJiri Kosina <jkosina@suse.cz>
Thu, 7 Jul 2016 09:25:50 +0000 (11:25 +0200)
commit5a2b190cddb9aa69b9037f5b1fd1c2cc8a1d68b9
treeb032a0cfcfc1a2de9460213dfbf4612296ce9d33
parent595d9e34eedc4b8d0631260ce93bbeb08e5b3bd7
HID: logitech-hidpp: add battery support for HID++ 2.0 devices

If the 0x1000 Unified Battery Level Status feature exists, expose the battery
level.

The main drawback is that while a device is plugged in its battery level is 0.
To avoid exposing that as 0% charge we make up a number based on the charging
status.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
drivers/hid/hid-logitech-hidpp.c