aboutsummaryrefslogtreecommitdiff
path: root/drivers/power/bq2415x_charger.c
diff options
context:
space:
mode:
authorMark Brown <broonie@kernel.org>2014-09-17 11:19:04 -0700
committerMark Brown <broonie@kernel.org>2014-09-17 11:19:04 -0700
commit6ca6974c8a3b97a00df9b6ec3b1d076d6ecf6e09 (patch)
tree195f5ea61e8dca15c8338c68b4161346758952b8 /drivers/power/bq2415x_charger.c
parent7dc33e02fbdf4d19e17493ff2de87a86a4ad7699 (diff)
parent0111d0f13469831266d716e3b50d580a3e25cff9 (diff)
Merge branch 'linux-linaro-lsk-v3.14' into linux-linaro-lsk-v3.14-androidlsk-v3.14-android-14.09
Diffstat (limited to 'drivers/power/bq2415x_charger.c')
-rw-r--r--drivers/power/bq2415x_charger.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/power/bq2415x_charger.c b/drivers/power/bq2415x_charger.c
index 79a37f6d3307..e384844a1ae1 100644
--- a/drivers/power/bq2415x_charger.c
+++ b/drivers/power/bq2415x_charger.c
@@ -840,8 +840,7 @@ static int bq2415x_notifier_call(struct notifier_block *nb,
if (bq->automode < 1)
return NOTIFY_OK;
- sysfs_notify(&bq->charger.dev->kobj, NULL, "reported_mode");
- bq2415x_set_mode(bq, bq->reported_mode);
+ schedule_delayed_work(&bq->work, 0);
return NOTIFY_OK;
}
@@ -892,6 +891,11 @@ static void bq2415x_timer_work(struct work_struct *work)
int error;
int boost;
+ if (bq->automode > 0 && (bq->reported_mode != bq->mode)) {
+ sysfs_notify(&bq->charger.dev->kobj, NULL, "reported_mode");
+ bq2415x_set_mode(bq, bq->reported_mode);
+ }
+
if (!bq->autotimer)
return;