power: supply: bq27xxx_battery: Notify also about status changes
PATCH v2 1/1 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.
---
Changes since v1:
1. Remove unneeded backslash (pointed by Pali).
--- drivers/power/supply/bq27xxx_battery.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/power/supply/bq27xxx_battery.c +2 -1
@@ -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 )
Signature · 1 line
2.7.4
Quoted 6 lines · On Friday 26 April 2019 11:59:02 Krzysztof Kozlowski wrote:
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 <[email protected]>
Ok, you can add my
Quoted 22 lines
---
Changes since v1:
1. Remove unneeded backslash (pointed by Pali).--- drivers/power/supply/bq27xxx_battery.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)drivers/power/supply/bq27xxx_battery.c +2
-1@@ -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 )
Signature · 2 lines
Pali Rohár [email protected]
Hi,
Quoted 6 lines · Krzysztof Kozlowski
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 <[email protected]>
Thanks, queued.
-- Sebastian
Quoted 26 lines
---
Changes since v1:
1. Remove unneeded backslash (pointed by Pali).--- drivers/power/supply/bq27xxx_battery.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)drivers/power/supply/bq27xxx_battery.c +2
-1@@ -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 )Signature · 1 line
2.7.4