HID: wacom: generic: Scale battery capacity measurements to percentages
authorJason Gerecke <killertofu@gmail.com>
Fri, 28 Apr 2017 16:25:30 +0000 (09:25 -0700)
committerJiri Kosina <jkosina@suse.cz>
Fri, 5 May 2017 19:46:09 +0000 (21:46 +0200)
commit37d1601938349e79e9c31a8aba431d5543e09e72
treef36bdb6b0f3af60a8467958b6ae430840da31eed
parent7af4c727c7b6104f94f2ffc3d0899e75a9cc1e55
HID: wacom: generic: Scale battery capacity measurements to percentages

The power_supply subsystem expects us to provide it with capacity values
measured in percent. In particular, AES devices (HID_DG_BATTERYSTRENGTH)
use the range 0-255, which needs to be rescaled. The MobileStudio Pro
(WACOM_HID_WD_BATTERY_LEVEL) uses the range 0-100, but there's no guarantee
that future devices will share the same range.

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_wac.c