summaryrefslogtreecommitdiffstats
path: root/drivers/power
diff options
context:
space:
mode:
authorThomas Elste <thomas.elste@imms.de>2015-05-28 11:05:32 +0200
committerSebastian Reichel <sre@kernel.org>2015-05-29 04:26:50 +0200
commitcd054ee16580690830297dbda0abe9c184276d6a (patch)
treeedb2a4cf8cf8481006dded3a1dfe743efd6ab373 /drivers/power
parent843735b788a4e49c453f4aefdae80e6dfbe9ee85 (diff)
downloadlinux-cd054ee16580690830297dbda0abe9c184276d6a.tar.gz
linux-cd054ee16580690830297dbda0abe9c184276d6a.tar.bz2
linux-cd054ee16580690830297dbda0abe9c184276d6a.zip
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>
Diffstat (limited to 'drivers/power')
-rw-r--r--drivers/power/bq24190_charger.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/drivers/power/bq24190_charger.c b/drivers/power/bq24190_charger.c
index 407c4af83891..052db78c3736 100644
--- a/drivers/power/bq24190_charger.c
+++ b/drivers/power/bq24190_charger.c
@@ -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: