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 <thomas.elste@imms.de> Signed-off-by: Sebastian Reichel <sre@kernel.org>
This commit is contained in:
parent
843735b788
commit
cd054ee165
|
@ -1258,10 +1258,13 @@ static irqreturn_t bq24190_irq_handler_thread(int irq, void *data)
|
|||
* register reset so we should ignore that one (the very first
|
||||
* interrupt received).
|
||||
*/
|
||||
if (alert_userspace && !bdi->first_time) {
|
||||
power_supply_changed(bdi->charger);
|
||||
power_supply_changed(bdi->battery);
|
||||
bdi->first_time = false;
|
||||
if (alert_userspace) {
|
||||
if (!bdi->first_time) {
|
||||
power_supply_changed(bdi->charger);
|
||||
power_supply_changed(bdi->battery);
|
||||
} else {
|
||||
bdi->first_time = false;
|
||||
}
|
||||
}
|
||||
|
||||
out:
|
||||
|
|
Loading…
Reference in New Issue