]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
HID: wacom: Add ability to provide explicit battery status info
authorJason Gerecke <killertofu@gmail.com>
Fri, 28 Apr 2017 16:25:33 +0000 (09:25 -0700)
committerJiri Kosina <jkosina@suse.cz>
Fri, 5 May 2017 19:46:10 +0000 (21:46 +0200)
commit16e4598905a9d7793350ffad2f627b3dfdb7b595
tree6ca0b77aa2c2c093376cd163ec2fe57c34d96372
parenta7758702879e68d221cf6dd9844bf5b2a070c8cb
HID: wacom: Add ability to provide explicit battery status info

At the moment, our driver relies on 'wacom_battery_get_property()' to
determine the most likely battery state (e.g charging, discharging, or
full) based on the information available. It is not always possible
for the function to properly determine this, however. For instance,
whenever an AES pen leaves proximity the battery state becomes
indeterminite. This commit adds the ability to provide it with explict
state information if desired. Whenever explicit state is not required
(the majority of circumstances), WACOM_POWER_SUPPLY_STATUS_AUTO can
be used in its place.

Three uses of explicit battery status are added: two wireless disconnect
paths and the AES case mentioned above.

Signed-off-by: Jason Gerecke <jason.gerecke@wacom.com>
Reviewed-by: Ping Cheng <ping.cheng@wacom.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
drivers/hid/wacom.h
drivers/hid/wacom_sys.c
drivers/hid/wacom_wac.c
drivers/hid/wacom_wac.h