Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1655281 > unrolled thread

[PATCH 3.16 061/212] power: bq24190_charger: Change first_time flag reset condition

Started byBen Hutchings <ben@decadent.org.uk>
First post2017-06-01 17:50 +0200
Last post2017-06-01 17:50 +0200
Articles 1 — 1 participant

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH 3.16 061/212] power: bq24190_charger: Change first_time  flag reset condition Ben Hutchings <ben@decadent.org.uk> - 2017-06-01 17:50 +0200

#1655281 — [PATCH 3.16 061/212] power: bq24190_charger: Change first_time flag reset condition

FromBen Hutchings <ben@decadent.org.uk>
Date2017-06-01 17:50 +0200
Subject[PATCH 3.16 061/212] power: bq24190_charger: Change first_time flag reset condition
Message-ID<tNAwk-4oP-75@gated-at.bofh.it>
3.16.44-rc1 review patch.  If anyone has any objections, please let me know.

------------------

From: Thomas Elste <thomas.elste@imms.de>

commit cd054ee16580690830297dbda0abe9c184276d6a 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: Thomas Elste <thomas.elste@imms.de>
Signed-off-by: Sebastian Reichel <sre@kernel.org>
[bwh: Backported to 3.16: adjust context]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
 drivers/power/bq24190_charger.c | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

--- a/drivers/power/bq24190_charger.c
+++ b/drivers/power/bq24190_charger.c
@@ -1268,10 +1268,13 @@ static irqreturn_t bq24190_irq_handler_t
 	 * 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:

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web