All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jonghwa Lee <jonghwa3.lee@samsung.com>
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 <jonghwa3.lee@samsung.com>
Subject: [PATCH 08/10] power: charger-manager: Not to start charging directly in cable nofitication.
Date: Thu, 30 Oct 2014 21:43:14 +0900	[thread overview]
Message-ID: <1414672996-28355-9-git-send-email-jonghwa3.lee@samsung.com> (raw)
In-Reply-To: <1414672996-28355-1-git-send-email-jonghwa3.lee@samsung.com>

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 <jonghwa3.lee@samsung.com>
---
 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


  parent reply	other threads:[~2014-10-30 12:44 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-30 12:43 [PATCH V2 0/10] Improve charger manager driver for optimized operation Jonghwa Lee
2014-10-30 12:43 ` [PATCH 01/10] power: charger-manager: Use thermal subsystem interface only to get temperature Jonghwa Lee
2014-10-30 13:11   ` Krzysztof Kozłowski
2014-10-31  2:25     ` jonghwa3.lee
2014-10-30 12:43 ` [PATCH 02/10] power: charger-manager: Use power_supply_changed() not private uevent Jonghwa Lee
2014-10-30 12:43 ` [PATCH 03/10] power: charger-manager: Remove deprecated function, cm_notify_event() Jonghwa Lee
2014-10-30 12:43 ` [PATCH 04/10] power: charger-manager: Fix to use CHARGE_NOW/FULL property correctly Jonghwa Lee
2014-10-30 12:43 ` [PATCH 05/10] power: charger-manager: Concentrate scattered power_supply_changed() calls Jonghwa Lee
2014-10-30 12:43 ` [PATCH 06/10] power: charger-manager: Get external power souce information only from EXTCON Jonghwa Lee
2014-10-30 12:43 ` [PATCH 07/10] power: charger-manager: Make chraging decision focusing on battery status Jonghwa Lee
2014-10-30 12:43 ` Jonghwa Lee [this message]
2014-10-30 12:43 ` [PATCH 09/10] power: charger-manager: Support different polling mode for sleep state Jonghwa Lee
2014-10-30 12:43 ` [PATCH 10/10] power: charger-manager: Support to change polling rate in runtime Jonghwa Lee

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1414672996-28355-9-git-send-email-jonghwa3.lee@samsung.com \
    --to=jonghwa3.lee@samsung.com \
    --cc=anton@enomsg.org \
    --cc=cw00.choi@samsung.com \
    --cc=dbaryshkov@gmail.com \
    --cc=dwmw2@infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=myungjoo.ham@samsung.com \
    --cc=pavel@ucw.cz \
    --cc=sre@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.