From patchwork Fri Dec 19 02:47:28 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonghwa Lee X-Patchwork-Id: 5517201 Return-Path: X-Original-To: patchwork-linux-pm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 5C782BEEA8 for ; Fri, 19 Dec 2014 02:48:51 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 908A420131 for ; Fri, 19 Dec 2014 02:48:50 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A98042012D for ; Fri, 19 Dec 2014 02:48:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751194AbaLSCsd (ORCPT ); Thu, 18 Dec 2014 21:48:33 -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 Received: from epcpsbgr2.samsung.com (u142.gpu120.samsung.co.kr [203.254.230.142]) by mailout4.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0NGT00FZY6FD9320@mailout4.samsung.com>; Fri, 19 Dec 2014 11:47:37 +0900 (KST) Received: from epcpsbgm2.samsung.com ( [172.20.52.116]) by epcpsbgr2.samsung.com (EPCPMTA) with SMTP id 04.AA.11124.9C193945; Fri, 19 Dec 2014 11:47:37 +0900 (KST) X-AuditID: cbfee68e-f79b46d000002b74-4e-549391c9a890 Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm2.samsung.com (EPCPMTA) with SMTP id 93.E2.09430.9C193945; Fri, 19 Dec 2014 11:47:37 +0900 (KST) Received: from localhost.localdomain ([10.252.82.199]) by mmp1.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0NGT004F46F82Y30@mmp1.samsung.com>; Fri, 19 Dec 2014 11:47:37 +0900 (KST) 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+Db5EAtEr6zEpgNQz0hKHFxxg2UCo/ACRoZVjKKpBckFxUnpRUZ6xYm5xaV56XrJ+bmb GIHx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vkj c9urQvaJFr2aJ32q3f7cWPSBa2HzNudQhdu7n8n43KljNpu567vX8h9/vS8lbJvHXGkYffDO p9CN25cG33cWnve/yifDeabKd8mK0wZzvEJ9MsVa+7wUP97iYzrwVl+gjGFOo946vTB5+1hm JZbijERDLeai4kQAStmzOswCAAA= DLP-Filter: Pass X-MTR: 20000000000000000@CPGS X-CFilter-Loop: Reflected Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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. */