summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonghwa Lee <jonghwa3.lee@samsung.com>2014-10-22 15:13:51 +0900
committerChanho Park <chanho61.park@samsung.com>2014-11-18 12:01:03 +0900
commit502a2ce42f035112cb455446b823444eeb2b7421 (patch)
tree6bf5215b51d8a80e1f9e6d7523e1b871708b9c31
parent59ec47bda4ba1c0df507b4c6dfd9969af6120373 (diff)
downloadlinux-3.10-502a2ce42f035112cb455446b823444eeb2b7421.tar.gz
linux-3.10-502a2ce42f035112cb455446b823444eeb2b7421.tar.bz2
linux-3.10-502a2ce42f035112cb455446b823444eeb2b7421.zip
power: charger-manager: Not to start charging directly in cable nofitication.
This patch prevents direct charging control in cable notification. It sets only input current limit according to cable type and yields charging control to be done by cm_monitor() where charging management proceeds. It may loose few ms to enable charging compared to before, even though it's more important that charging is enabled only for safe context. Change-Id: Ic736b9d18829f6d6dab946515dd0fe62fe7b75c4 Signed-off-by: Jonghwa Lee <jonghwa3.lee@samsung.com>
-rw-r--r--drivers/power/charger-manager.c12
1 files changed, 2 insertions, 10 deletions
diff --git a/drivers/power/charger-manager.c b/drivers/power/charger-manager.c
index 5abc379ca24..b2a4fedb6e0 100644
--- a/drivers/power/charger-manager.c
+++ b/drivers/power/charger-manager.c
@@ -820,7 +820,8 @@ static void charger_extcon_work(struct work_struct *work)
cable->min_uA, cable->max_uA);
}
- try_charger_enable(cable->cm, cable->attached);
+ cancel_delayed_work(&cm_monitor_work);
+ queue_delayed_work(cm_wq, &cm_monitor_work, 0);
}
/**
@@ -844,15 +845,6 @@ static int charger_extcon_notifier(struct notifier_block *self,
cable->attached = event;
/*
- * Setup monitoring to check battery state
- * when charger cable is attached.
- */
- if (cable->attached && is_polling_required(cable->cm)) {
- cancel_work_sync(&setup_polling);
- schedule_work(&setup_polling);
- }
-
- /*
* Setup work for controlling charger(regulator)
* according to charger cable.
*/