aboutsummaryrefslogtreecommitdiff
path: root/drivers/power/bq2415x_charger.c
diff options
context:
space:
mode:
authorMark Brown <broonie@kernel.org>2014-09-17 11:19:07 -0700
committerMark Brown <broonie@kernel.org>2014-09-17 11:19:07 -0700
commit72df321f602520b6ea09f47a71b6795efc0a83c8 (patch)
treee32e2d9dff3d90f49e95f0bfa61860eac0dc3ed3 /drivers/power/bq2415x_charger.c
parent1414ffefd32b80f827a697505a9eede86978ebbb (diff)
parent0111d0f13469831266d716e3b50d580a3e25cff9 (diff)
Merge branch 'linux-linaro-lsk-v3.14' into linux-linaro-lsk-v3.14-rtlsk-v3.14-rt-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;