diff options
author | Frank Praznik <frank.praznik@oh.rr.com> | 2014-02-05 20:03:48 -0500 |
---|---|---|
committer | Jiri Kosina <jkosina@suse.cz> | 2014-02-17 08:11:07 -0500 |
commit | d9a293a951d5cc44842acf340af51ace8e0cfdbe (patch) | |
tree | 423a1184dfd79b2d4c3e6d3a031270898977d92e /drivers/hid/hid-sony.c | |
parent | 6c5f860d3f658ff502952a0e57b7e40878391dc1 (diff) |
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: Frank Praznik <frank.praznik@oh.rr.com>
Reviewed-by: David Herrmann <dh.herrmann@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Diffstat (limited to 'drivers/hid/hid-sony.c')
-rw-r--r-- | drivers/hid/hid-sony.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/hid/hid-sony.c b/drivers/hid/hid-sony.c index 40dfa4b4252e..24ce8cd556e7 100644 --- a/drivers/hid/hid-sony.c +++ b/drivers/hid/hid-sony.c | |||
@@ -1402,6 +1402,11 @@ static int sony_battery_probe(struct sony_sc *sc) | |||
1402 | struct hid_device *hdev = sc->hdev; | 1402 | struct hid_device *hdev = sc->hdev; |
1403 | int ret; | 1403 | int ret; |
1404 | 1404 | ||
1405 | /* Set the default battery level to 100% to avoid low battery warnings | ||
1406 | * if the battery is polled before the first device report is received. | ||
1407 | */ | ||
1408 | sc->battery_capacity = 100; | ||
1409 | |||
1405 | power_id = (unsigned long)atomic_inc_return(&power_id_seq); | 1410 | power_id = (unsigned long)atomic_inc_return(&power_id_seq); |
1406 | 1411 | ||
1407 | sc->battery.properties = sony_battery_props; | 1412 | sc->battery.properties = sony_battery_props; |