Skip to content

Commit 70fd936

Browse files
dtorgregkh
authored andcommitted
HID: input: do not report stylus battery state as "full"
[ Upstream commit f4abaa9 ] 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 581c448. This change helps UIs to not mis-represent fully charged batteries in styli as being charging/topping-off. Fixes: 581c448 ("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> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent 4e89aea commit 70fd936

File tree

1 file changed

+0
-2
lines changed

1 file changed

+0
-2
lines changed

drivers/hid/hid-input.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -415,8 +415,6 @@ static int hidinput_get_battery_property(struct power_supply *psy,
415415

416416
if (dev->battery_status == HID_BATTERY_UNKNOWN)
417417
val->intval = POWER_SUPPLY_STATUS_UNKNOWN;
418-
else if (dev->battery_capacity == 100)
419-
val->intval = POWER_SUPPLY_STATUS_FULL;
420418
else
421419
val->intval = POWER_SUPPLY_STATUS_DISCHARGING;
422420
break;

0 commit comments

Comments
 (0)