]> git.baikalelectronics.ru Git - kernel.git/commit
HID: input: do not report stylus battery state as "full"
authorDmitry Torokhov <dmitry.torokhov@gmail.com>
Tue, 29 Jun 2021 18:25:50 +0000 (11:25 -0700)
committerJiri Kosina <jkosina@suse.cz>
Thu, 15 Jul 2021 18:55:30 +0000 (20:55 +0200)
commite84229b3c4d47890c8c5467fe2218dafdff193dc
tree1a9cd50b70deb45fc9525887b087ead44390b147
parent703fa3ac0c74a9be62f102ad87341ef247c5729b
HID: input: do not report stylus battery state as "full"

The power supply states of discharging, charging, full, etc, represent
state of charging, not the capacity level of the battery (for which
we have a separate property). Current HID usage tables to not allow
for expressing charging state of the batteries found in generic
styli, so we should simply assume that the battery is discharging
even if current capacity is at 100% when battery strength reporting
is done via HID interface. In fact, we were doing just that before
commit 09251ea2c9f3.

This change helps UIs to not mis-represent fully charged batteries in
styli as being charging/topping-off.

Fixes: 09251ea2c9f3 ("HID: input: map digitizer battery usage")
Reported-by: Kenneth Albanowski <kenalba@google.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
drivers/hid/hid-input.c