aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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,
840 if (bq->automode < 1) 840 if (bq->automode < 1)
841 return NOTIFY_OK; 841 return NOTIFY_OK;
842 842
843 sysfs_notify(&bq->charger.dev->kobj, NULL, "reported_mode"); 843 schedule_delayed_work(&bq->work, 0);
844 bq2415x_set_mode(bq, bq->reported_mode);
845 844
846 return NOTIFY_OK; 845 return NOTIFY_OK;
847} 846}
@@ -892,6 +891,11 @@ static void bq2415x_timer_work(struct work_struct *work)
892 int error; 891 int error;
893 int boost; 892 int boost;
894 893
894 if (bq->automode > 0 && (bq->reported_mode != bq->mode)) {
895 sysfs_notify(&bq->charger.dev->kobj, NULL, "reported_mode");
896 bq2415x_set_mode(bq, bq->reported_mode);
897 }
898
895 if (!bq->autotimer) 899 if (!bq->autotimer)
896 return; 900 return;
897 901