power: charger-manager: Not to start charging directly in cable nofitication.
authorJonghwa Lee <jonghwa3.lee@samsung.com>
Wed, 22 Oct 2014 06:13:51 +0000 (15:13 +0900)
committerChanho Park <chanho61.park@samsung.com>
Tue, 18 Nov 2014 03:01:03 +0000 (12:01 +0900)
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>
drivers/power/charger-manager.c

index 5abc379..b2a4fed 100644 (file)
@@ -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.
         */