summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDave Parker <dparker@chromium.org>2014-04-01 18:05:53 -0700
committerchrome-internal-fetch <chrome-internal-fetch@google.com>2014-04-08 21:52:38 +0000
commit4da95203866c871aa47c0bd779bdc110381360f0 (patch)
treee2c0eeae69f26cebf278deb89f6b54f5c56364e3
parentb12206307e3a6a2b4c2c577c95d9fb298ec366a3 (diff)
downloadchrome-ec-4da95203866c871aa47c0bd779bdc110381360f0.tar.gz
DPTF: Don't restore charging current limit on resume
The host should be responsible for setting any required charge throttling at resume. EC the should not restore the previous charge current limit as the the charging and thermal state of the device are likely to be different when the device resumes. BUG=chrome-os-partner:27369 BRANCH=ToT TEST=Suspend the device with the adapter unplugged. Plug in the adapter and resume. Verify that the charging LED doesn't flash two or three times at resume. (tested on squawks) Change-Id: I1fbba0652419501193e713e130830a005c6b5a22 Origianl-Change-Id: I1e4615d99ee9a386b25e58b991e846c5d2beaa39 Signed-off-by: Dave Parker <dparker@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/192686 Reviewed-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/193341 Reviewed-by: Bill Richardson <wfrichar@chromium.org>
-rw-r--r--common/charger.c21
1 files changed, 3 insertions, 18 deletions
diff --git a/common/charger.c b/common/charger.c
index 9d153c4159..8a07a62818 100644
--- a/common/charger.c
+++ b/common/charger.c
@@ -20,7 +20,6 @@
/* DPTF current limit, -1 = none */
static int dptf_limit_ma = -1;
-static int dptf_limit_ma_bak = -1;
void dptf_set_charging_current_limit(int ma)
{
@@ -32,27 +31,13 @@ int dptf_get_charging_current_limit(void)
return dptf_limit_ma;
}
-static void dptf_suspend_hook(void)
+static void dptf_disable_hook(void)
{
/* Before get to Sx, EC should take control of charger from DPTF */
- dptf_limit_ma_bak = dptf_limit_ma;
dptf_limit_ma = -1;
}
-DECLARE_HOOK(HOOK_CHIPSET_SUSPEND, dptf_suspend_hook, HOOK_PRIO_DEFAULT);
-
-static void dptf_shutdown_hook(void)
-{
- dptf_limit_ma = -1;
- dptf_limit_ma_bak = -1;
-}
-DECLARE_HOOK(HOOK_CHIPSET_SHUTDOWN, dptf_shutdown_hook, HOOK_PRIO_DEFAULT);
-
-static void dptf_s0_hook(void)
-{
- /* Before go to S0, EC restore charger control */
- dptf_limit_ma = dptf_limit_ma_bak;
-}
-DECLARE_HOOK(HOOK_CHIPSET_RESUME, dptf_s0_hook, HOOK_PRIO_DEFAULT);
+DECLARE_HOOK(HOOK_CHIPSET_SUSPEND, dptf_disable_hook, HOOK_PRIO_DEFAULT);
+DECLARE_HOOK(HOOK_CHIPSET_SHUTDOWN, dptf_disable_hook, HOOK_PRIO_DEFAULT);
int charger_closest_voltage(int voltage)
{