Commit 9434e453 authored by Jonghwa Lee's avatar Jonghwa Lee Committed by Sebastian Reichel

power: supply: charger-manager: Don't start charging in cable nofitication

Prevents direct charging control in cable notification and only set the
input current limit according to cable type.  Leave the enabling of
charing to cm_monitor() where charging management proceeds.  We may lose
a few ms to enable charging compared to before, but it's more important
that charging is enabled always in safe context.
Signed-off-by: default avatarJonghwa Lee <jonghwa3.lee@samsung.com>
Signed-off-by: default avatarKrzysztof Kozlowski <k.kozlowski@samsung.com>
Signed-off-by: default avatarJonathan Bakker <xc-racer2@live.ca>
Signed-off-by: default avatarSebastian Reichel <sebastian.reichel@collabora.com>
parent e132fc6b
...@@ -907,7 +907,8 @@ static void charger_extcon_work(struct work_struct *work) ...@@ -907,7 +907,8 @@ static void charger_extcon_work(struct work_struct *work)
cable->min_uA, cable->max_uA); 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);
} }
/** /**
...@@ -930,15 +931,6 @@ static int charger_extcon_notifier(struct notifier_block *self, ...@@ -930,15 +931,6 @@ static int charger_extcon_notifier(struct notifier_block *self,
*/ */
cable->attached = event; 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) * Setup work for controlling charger(regulator)
* according to charger cable. * according to charger cable.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment