Commit 9750048d authored by Dmitry Torokhov's avatar Dmitry Torokhov Committed by Treehugger Robot
Browse files

UPSTREAM: HID: hid-input: only ignore 0 battery events for digitizers



Commit 581c4484 ("HID: input: map digitizer battery usage") added
handling of battery events for digitizers (typically for batteries
presented in stylii). Digitizers typically report correct battery levels
only when stylus is actively touching the surface, and in other cases
they may report battery level of 0. To avoid confusing consumers of the
battery information the code was added to filer out reports with 0
battery levels.

However there exist other kinds of devices that may legitimately report
0 battery levels. Fix this by filtering out 0-level reports only for
digitizer usages, and continue reporting them for other kinds of devices
(Smart Batteries, etc).

Reported-by: default avatar卢国宏 <luguohong@xiaomi.com>
Fixes: 581c4484 ("HID: input: map digitizer battery usage")
Change-Id: Ib4782ca1f1951f230b95ceb1620d64ef5acc6be7
Signed-off-by: default avatarDmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: default avatarJiri Kosina <jkosina@suse.com>
(cherry picked from commit 0187c080)
Signed-off-by: default avatarGuohong Lu <luguohong@xiaomi.corp-partner.google.com>
parent c9fd0f25
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment