diff options
author | Hans de Goede <hdegoede@redhat.com> | 2017-04-14 20:32:52 +0200 |
---|---|---|
committer | Sebastian Reichel <sre@kernel.org> | 2017-05-01 12:37:32 +0200 |
commit | dcdddda8fdd23048f2eaf54a18a33e9f225d8fb6 (patch) | |
tree | ae187038185aa324060e18ab3b585d2ae435de3a /drivers/power | |
parent | power: supply: max17042_battery: Add support for the STATUS property (diff) | |
download | linux-dcdddda8fdd23048f2eaf54a18a33e9f225d8fb6.tar.xz linux-dcdddda8fdd23048f2eaf54a18a33e9f225d8fb6.zip |
power: supply: max17042_battery: Add external_power_changed callback
If our supplier changes status, chances are we've changed status too,
let any listeners know about this.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Krzysztof Kozlowski <krzk@kernel.org>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk>
Diffstat (limited to 'drivers/power')
-rw-r--r-- | drivers/power/supply/max17042_battery.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/power/supply/max17042_battery.c b/drivers/power/supply/max17042_battery.c index 62efe7eeb3f8..d355ee54b06d 100644 --- a/drivers/power/supply/max17042_battery.c +++ b/drivers/power/supply/max17042_battery.c @@ -429,6 +429,11 @@ static int max17042_property_is_writeable(struct power_supply *psy, return ret; } +static void max17042_external_power_changed(struct power_supply *psy) +{ + power_supply_changed(psy); +} + static int max17042_write_verify_reg(struct regmap *map, u8 reg, u32 value) { int retries = 8; @@ -917,6 +922,7 @@ static const struct power_supply_desc max17042_psy_desc = { .get_property = max17042_get_property, .set_property = max17042_set_property, .property_is_writeable = max17042_property_is_writeable, + .external_power_changed = max17042_external_power_changed, .properties = max17042_battery_props, .num_properties = ARRAY_SIZE(max17042_battery_props), }; |