Skip to content

Commit cd054ee

Browse files
Thomas Elstesre
authored andcommitted
power: bq24190_charger: Change first_time flag reset condition
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: Thomas Elste <[email protected]> Signed-off-by: Sebastian Reichel <[email protected]>
1 parent 843735b commit cd054ee

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

drivers/power/bq24190_charger.c

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1258,10 +1258,13 @@ static irqreturn_t bq24190_irq_handler_thread(int irq, void *data)
12581258
* register reset so we should ignore that one (the very first
12591259
* interrupt received).
12601260
*/
1261-
if (alert_userspace && !bdi->first_time) {
1262-
power_supply_changed(bdi->charger);
1263-
power_supply_changed(bdi->battery);
1264-
bdi->first_time = false;
1261+
if (alert_userspace) {
1262+
if (!bdi->first_time) {
1263+
power_supply_changed(bdi->charger);
1264+
power_supply_changed(bdi->battery);
1265+
} else {
1266+
bdi->first_time = false;
1267+
}
12651268
}
12661269

12671270
out:

0 commit comments

Comments
 (0)