Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752133AbaLSCse (ORCPT ); Thu, 18 Dec 2014 21:48:34 -0500 Received: from mailout4.samsung.com ([203.254.224.34]:14641 "EHLO mailout4.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752014AbaLSCrm (ORCPT ); Thu, 18 Dec 2014 21:47:42 -0500 X-AuditID: cbfee68e-f79b46d000002b74-4e-549391c9a890 From: Jonghwa Lee To: linux-kernel@vger.kernel.org Cc: linux-pm@vger.kernel.org, sre@kernel.org, dbaryshkov@gmail.com, dwmw2@infradead.org, anton@enomsg.org, pavel@ucw.cz, myungjoo.ham@samsung.com, cw00.choi@samsung.com, Jonghwa Lee Subject: [PATCH RESEND v2 08/10] power: charger-manager: Not to start charging directly in cable nofitication. Date: Fri, 19 Dec 2014 11:47:28 +0900 Message-id: <1418957250-6542-9-git-send-email-jonghwa3.lee@samsung.com> X-Mailer: git-send-email 1.7.9.5 In-reply-to: <1418957250-6542-1-git-send-email-jonghwa3.lee@samsung.com> References: <1418957250-6542-1-git-send-email-jonghwa3.lee@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrPLMWRmVeSWpSXmKPExsWyRsSkRPfkxMkhBv+eS1kc3Kppcf3Lc1aL SU/eM1tMXDmZ2aLz7BNmi8u75rBZfO49wmhxu3EFm8XdU0fZLE7vLnHg8pjQ/4nRY+esu+we m1doeWxa1cnm0bdlFaPHitXf2T0+b5ILYI/isklJzcksSy3St0vgynj0KbJgD3fF5WMHGBsY D3N2MXJySAiYSPS83skMYYtJXLi3nq2LkYtDSGApo8TRzTPZuxg5wIpO9SWC1AgJLGKU6DzD AVHTxiSx4/JXNpAEm4COxP99N9lBbBEBBYnNvc9YQYqYBa4wStxcvJ4JJCEsUCDR8uE9mM0i oCrxr/0gmM0r4C6xYmEPK8QyBYk5k2xAwpwCHhJPLzWxQSx2lzjx7S0LyEwJgW3sEkvb1zBD zBGQ+Db5E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mb K4nzKtm3hQgJpCeWpGanphakFsH0MXFwSjUwxvfl/bBxr2E6tni5lHfs2SfBt1+XbWHtvvkj c9urQvaJFr2aJ32q3f7cWPSBa2HzNudQhdu7n8n43KljNpu567vX8h9/vS8lbJvHXGkYffDO p9CN25cG33cWnve/yifDeabKd8mK0wZzvEJ9MsVa+7wUP97iYzrwVl+gjGFOo946vTB5+1hm JZbijERDLeai4kQAStmzOswCAAA= DLP-Filter: Pass X-MTR: 20000000000000000@CPGS X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 always in safe context. Signed-off-by: Jonghwa Lee --- drivers/power/charger-manager.c | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/drivers/power/charger-manager.c b/drivers/power/charger-manager.c index 065b92a..1ccb9be 100644 --- a/drivers/power/charger-manager.c +++ b/drivers/power/charger-manager.c @@ -849,7 +849,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); } /** @@ -873,15 +874,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. */ -- 1.7.9.5 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/