Thread (11 messages) flat view 11 messages, 3 authors, 2014-01-29
STALE4618d

[PATCH 5/7] HID: sony: Set inital battery level to 100% to avoid false low battery warnings

From: Frank Praznik <hidden>
Date: 2014-01-29 17:33:52
Subsystem: hid core layer, the rest · Maintainers: Jiri Kosina, Benjamin Tissoires, Linus Torvalds

Set the inital battery level to 100% to avoid false low battery warnings if the
battery level is polled before a device report is received.
 
Signed-off-by: Frank Praznik <redacted>

---
 drivers/hid/hid-sony.c | 5 +++++
 1 file changed, 5 insertions(+)
diff --git a/drivers/hid/hid-sony.c b/drivers/hid/hid-sony.c
index 7005086..cee752f 100644
--- a/drivers/hid/hid-sony.c
+++ b/drivers/hid/hid-sony.c
@@ -1404,6 +1404,11 @@ static int sony_battery_probe(struct sony_sc *sc)
 	struct hid_device *hdev = sc->hdev;
 	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);
 
 	sc->battery.properties = sony_battery_props;
-- 
1.8.5.3
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help