Skip to content

Commit

Permalink
power_supply: max17040: Use system efficient workqueues
Browse files Browse the repository at this point in the history
The scheduled work in max17040_battery driver reads device parameters
and stores them in memory. Any CPU could do that so use system efficient
workqueues to limit unnecessary CPU wake ups.

Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Signed-off-by: Sebastian Reichel <sre@kernel.org>
  • Loading branch information
krzk authored and sre committed Feb 25, 2015
1 parent dd18a66 commit 52fa74e
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions drivers/power/max17040_battery.c
Expand Up @@ -188,7 +188,8 @@ static void max17040_work(struct work_struct *work)
max17040_get_online(chip->client);
max17040_get_status(chip->client);

schedule_delayed_work(&chip->work, MAX17040_DELAY);
queue_delayed_work(system_power_efficient_wq, &chip->work,
MAX17040_DELAY);
}

static enum power_supply_property max17040_battery_props[] = {
Expand Down Expand Up @@ -233,7 +234,8 @@ static int max17040_probe(struct i2c_client *client,
max17040_get_version(client);

INIT_DEFERRABLE_WORK(&chip->work, max17040_work);
schedule_delayed_work(&chip->work, MAX17040_DELAY);
queue_delayed_work(system_power_efficient_wq, &chip->work,
MAX17040_DELAY);

return 0;
}
Expand Down Expand Up @@ -263,7 +265,8 @@ static int max17040_resume(struct device *dev)
struct i2c_client *client = to_i2c_client(dev);
struct max17040_chip *chip = i2c_get_clientdata(client);

schedule_delayed_work(&chip->work, MAX17040_DELAY);
queue_delayed_work(system_power_efficient_wq, &chip->work,
MAX17040_DELAY);
return 0;
}

Expand Down

0 comments on commit 52fa74e

Please sign in to comment.