remarkable-linux/include
Dmitry Torokhov 2e210bbb74 HID: input: fix battery level reporting on BT mice
The commit 581c448476 ("HID: input: map digitizer battery usage")
assumed that devices having input (qas opposed to feature) report for
battery strength would report the data on their own, without the need to
be polled by the kernel; unfortunately it is not so. Many wireless mice
do not send unsolicited reports with battery strength data and have to
be polled explicitly. As a complication, stylus devices on digitizers
are not normally connected to the base and thus can not be polled - the
base can only determine battery strength in the stylus when it is in
proximity.

To solve this issue, we add a special flag that tells the kernel
to avoid polling the device (and expect unsolicited reports) and set it
when report field with physical usage of digitizer stylus (HID_DG_STYLUS).
Unless this flag is set, and we have not seen the unsolicited reports,
the kernel will attempt to poll the device when userspace attempts to
read "capacity" and "state" attributes of power_supply object
corresponding to the devices battery.

Fixes: 581c448476 ("HID: input: map digitizer battery usage")
Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=198095
Cc: stable@vger.kernel.org
Reported-and-tested-by: Martin van Es <martin@mrvanes.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2018-04-09 09:26:12 +02:00
..
acpi
asm-generic arm64 updates for 4.17 2018-04-04 16:01:43 -07:00
clocksource
crypto
drm
dt-bindings sound updates for 4.17-rc1 2018-04-05 10:42:07 -07:00
keys
kvm
linux HID: input: fix battery level reporting on BT mice 2018-04-09 09:26:12 +02:00
math-emu
media media updates for v4.17-rc1 2018-04-03 17:16:59 -07:00
memory
misc
net ipv6: allow to cache dst for a connected sk in ip6_sk_dst_lookup_flow() 2018-04-04 11:31:57 -04:00
pcmcia
ras
rdma
scsi dma-mapping updates for 4.17: 2018-04-05 10:23:24 -07:00
soc
sound sound updates for 4.17-rc1 2018-04-05 10:42:07 -07:00
target
trace Cleanups and bugfixes for ext4, including some fixes to make ext4 more 2018-04-04 14:19:24 -07:00
uapi sound updates for 4.17-rc1 2018-04-05 10:42:07 -07:00
video
xen