Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1760063AbaJ3Moi (ORCPT ); Thu, 30 Oct 2014 08:44:38 -0400 Received: from mailout1.samsung.com ([203.254.224.24]:23881 "EHLO mailout1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1759800AbaJ3Mnb (ORCPT ); Thu, 30 Oct 2014 08:43:31 -0400 X-AuditID: cbfee68d-f79296d000004278-17-5452326a8ea4 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 08/10] power: charger-manager: Not to start charging directly in cable nofitication. Date: Thu, 30 Oct 2014 21:43:14 +0900 Message-id: <1414672996-28355-9-git-send-email-jonghwa3.lee@samsung.com> X-Mailer: git-send-email 1.7.9.5 In-reply-to: <1414672996-28355-1-git-send-email-jonghwa3.lee@samsung.com> References: <1414672996-28355-1-git-send-email-jonghwa3.lee@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrALMWRmVeSWpSXmKPExsWyRsSkUDfLKCjE4Ox6IYuDWzUtrn95zmox 6cl7ZouJKyczW3SefcJscXnXHDaLz71HGC1uN65gs7h76iibxendJQ5cHhP6PzF67Jx1l91j 8wotj02rOtk8+rasYvRYsfo7u8fnTXIB7FFcNimpOZllqUX6dglcGY8+RRbs4a64fOwAYwPj Yc4uRk4OCQETid5HvYwQtpjEhXvr2boYuTiEBJYyShyb2soCU7Rxy0JWiMQiRon/7+YyQjht TBJ3mlawg1SxCehI/N93E8wWEVCQ2Nz7DKyDWeAKo8TNxeuZQBLCAmkSh1s+gRWxCKhKzL98 HmgSBwevgIfE4ccKIKYEUO+cSTYgFZwCnhKbrswEO0IIqOLBri52kJESAvvYJQ7vu80EMUZA 4tvkQywQvbISmw4wQxwtKXFwxQ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xcEo1MM4uiGjZnHO+5kLtlLUu8kKuM+6tNC7e mJaVb+DtE3T6/gvDlCefLjZYl9tEzVH2/uJ6+FqUffpVUbmtu79P0bKZ++rVtJUnHFfy8q/Z 90BwusnDD7UGorNaXxXf2eocYVejtz/PfNGeG3b/3//Y83XnkpRnwfztBfdn7ppTeODZSV3u sC0PJbKUWIozEg21mIuKEwGpMjfzzQIAAA== 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/