Commit d9a293a9 authored by Frank Praznik's avatar Frank Praznik Committed by Jiri Kosina

HID: sony: Set initial battery level to 100% to avoid false low battery warnings

Set the initial battery level to 100% to avoid false low battery warnings if
the battery state is polled before a report with the actual battery level is
received.
Signed-off-by: default avatarFrank Praznik <frank.praznik@oh.rr.com>
Reviewed-by: default avatarDavid Herrmann <dh.herrmann@gmail.com>
Signed-off-by: default avatarJiri Kosina <jkosina@suse.cz>
parent 6c5f860d
...@@ -1402,6 +1402,11 @@ static int sony_battery_probe(struct sony_sc *sc) ...@@ -1402,6 +1402,11 @@ static int sony_battery_probe(struct sony_sc *sc)
struct hid_device *hdev = sc->hdev; struct hid_device *hdev = sc->hdev;
int ret; int ret;
/* Set the default battery level to 100% to avoid low battery warnings
* if the battery is polled before the first device report is received.
*/
sc->battery_capacity = 100;
power_id = (unsigned long)atomic_inc_return(&power_id_seq); power_id = (unsigned long)atomic_inc_return(&power_id_seq);
sc->battery.properties = sony_battery_props; sc->battery.properties = sony_battery_props;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment