Commit d3b941b0 authored by Thomas Elste's avatar Thomas Elste Committed by Ben Hutchings

power: bq24190_charger: Change first_time flag reset condition

commit cd054ee1 upstream.

The initial register reset of BQ24190 generates a charger status change
whose propagation via power_supply_changed is prevented using a flag.
This flag gets never reset so all following events are ignored as well
leading for example to userspace not detecting charger connects/disconnects.

Therefor change the reset condition of first_time flag, so only the
propagation of the first charger status change is prevented.
Signed-off-by: default avatarThomas Elste <thomas.elste@imms.de>
Signed-off-by: default avatarSebastian Reichel <sre@kernel.org>
[bwh: Backported to 3.16: adjust context]
Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
parent ebe8733e
...@@ -1268,10 +1268,13 @@ static irqreturn_t bq24190_irq_handler_thread(int irq, void *data) ...@@ -1268,10 +1268,13 @@ static irqreturn_t bq24190_irq_handler_thread(int irq, void *data)
* register reset so we should ignore that one (the very first * register reset so we should ignore that one (the very first
* interrupt received). * interrupt received).
*/ */
if (alert_userspace && !bdi->first_time) { if (alert_userspace) {
power_supply_changed(&bdi->charger); if (!bdi->first_time) {
power_supply_changed(&bdi->battery); power_supply_changed(&bdi->charger);
bdi->first_time = false; power_supply_changed(&bdi->battery);
} else {
bdi->first_time = false;
}
} }
out: out:
......
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