summaryrefslogtreecommitdiff
path: root/drivers/power
diff options
context:
space:
mode:
authorKrzysztof Kozlowski <krzk@kernel.org>2019-04-26 12:59:02 +0300
committerSebastian Reichel <sre@kernel.org>2019-05-02 01:27:29 +0300
commit243f8ffc883a120516b1280c799b2e5081169efd (patch)
tree6763b0b0060fb8ca4ca5cb8ca2751e8db535a45c /drivers/power
parent231a13d93d5169600f161601de8a25c7bd31af44 (diff)
downloadlinux-243f8ffc883a120516b1280c799b2e5081169efd.tar.xz
power: supply: bq27xxx_battery: Notify also about status changes
User-space might be interested in receiving uevents when the charging starts/stops or if conditions of battery changes (e.g. over-temperature). Notify about changes in battery also when the flags change, not only SoC. Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org> Reviewed-by: Pali Rohár <pali.rohar@gmail.com> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Diffstat (limited to 'drivers/power')
-rw-r--r--drivers/power/supply/bq27xxx_battery.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/power/supply/bq27xxx_battery.c b/drivers/power/supply/bq27xxx_battery.c
index 29b3a4056865..195c18c2f426 100644
--- a/drivers/power/supply/bq27xxx_battery.c
+++ b/drivers/power/supply/bq27xxx_battery.c
@@ -1612,7 +1612,8 @@ void bq27xxx_battery_update(struct bq27xxx_device_info *di)
di->charge_design_full = bq27xxx_battery_read_dcap(di);
}
- if (di->cache.capacity != cache.capacity)
+ if ((di->cache.capacity != cache.capacity) ||
+ (di->cache.flags != cache.flags))
power_supply_changed(di->bat);
if (memcmp(&di->cache, &cache, sizeof(cache)) != 0)