summaryrefslogtreecommitdiff
path: root/drivers/hid/hid-lg-g15.c
diff options
context:
space:
mode:
authorFilipe Laíns <lains@archlinux.org>2021-01-04 21:29:37 +0300
committerJiri Kosina <jkosina@suse.cz>2021-01-18 13:01:03 +0300
commite037acf0b1aed31cb5f3b09ccb602b4768c133d5 (patch)
tree083bc01d7d555e203f9e5220c2cd8ec4193fbc1d /drivers/hid/hid-lg-g15.c
parent2bbe17ae87938ca44756741ec77e3be76a4a0ea0 (diff)
downloadlinux-e037acf0b1aed31cb5f3b09ccb602b4768c133d5.tar.xz
HID: logitech-hidpp: add support for Unified Battery (1004) feature
This new feature present in new devices replaces the old Battery Level Status (0x1000) feature. It keeps essentially the same information for levels (reporting critical, low, good and full) but makes these levels optional, the device exports a capability setting which describes which levels it supports. In addition to this, there is an optional state_of_charge paramenter that exports the battery percentage. This patch adds support for this new feature. There were some implementation choices, as described below and in the code. If the device supports the state_of_charge parameter, we will just export the battery percentage and not the levels, which the device might still support. Since this feature can co-exist with the Battery Voltage (0x1001) feature and we currently only support one battery feature, I changed the battery feature discovery to try to use 0x1000 and 0x1004 first and only then 0x1001, the battery voltage feature. In the future we could uncouple this and make the battery feature co-exists with 0x1000 and 0x1004, allowing the device to export voltage information in addition to the battery percentage or level. I tested this patch with a MX Anywhere 3, which supports the new feature. Since I don't have any device that doesn't support the state_of_charge parameter of this feature, I forced the MX Anywhere 3 to use the level information, instead of battery percentage, to test that part of the implementation. I also tested with a MX Master 3, which supports the Battery Level Status (0x1000) feature, and a G703 Hero, which supports the Battery Voltage (0x1001) feature, to make sure nothing broke there. [jkosina@suse.cz: fix comment] Signed-off-by: Filipe Laíns <lains@archlinux.org> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Diffstat (limited to 'drivers/hid/hid-lg-g15.c')
0 files changed, 0 insertions, 0 deletions