@@ -209,10 +209,19 @@ static void max17040_check_changes(struct i2c_client *client)
static void max17040_work(struct work_struct *work)
{
struct max17040_chip *chip;
+ int last_soc, last_status;
chip = container_of(work, struct max17040_chip, work.work);
+
+ /* store SOC and status to check changes */
+ last_soc = chip->soc;
+ last_status = chip->status;
max17040_check_changes(chip->client);
+ /* check changes and send uevent */
+ if (last_soc != chip->soc || last_status != chip->status)
+ power_supply_changed(chip->battery);
+
queue_delayed_work(system_power_efficient_wq, &chip->work,
MAX17040_DELAY);
}