]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
HID: logitech-hidpp: change low battery level threshold from 31 to 30 percent
authorHans de Goede <hdegoede@redhat.com>
Fri, 22 Mar 2019 07:41:40 +0000 (08:41 +0100)
committerKleber Sacilotto de Souza <kleber.souza@canonical.com>
Wed, 14 Aug 2019 09:18:49 +0000 (11:18 +0200)
commit906cf06e8956f3e08fd23268639485b7b3b9960e
treef1f1c8f545f4e51398bb0b29ba608f4e6589128b
parent145a5ff49dfc19b4606de9eee09e119f0f6f10ab
HID: logitech-hidpp: change low battery level threshold from 31 to 30 percent

BugLink: https://bugs.launchpad.net/bugs/1838700
[ Upstream commit 1f87b0cd32b3456d7efdfb017fcf74d0bfe3ec29 ]

According to hidpp20_batterylevel_get_battery_info my Logitech K270
keyboard reports only 2 battery levels. This matches with what I've seen
after testing with batteries at varying level of fullness, it always
reports either 5% or 30%.

Windows reports "battery good" for the 30% level. I've captured an USB
trace of Windows reading the battery and it is getting the same info
as the Linux hidpp code gets.

Now that Linux handles these devices as hidpp devices, it reports the
battery as being low as it treats anything under 31% as low, this leads
to the user constantly getting a "Keyboard battery is low" warning from
GNOME3, which is very annoying.

This commit fixes this by changing the low threshold to anything under
30%, which I assume is what Windows does.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
drivers/hid/hid-logitech-hidpp.c