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-02 17:04:17 +0000
commit6a9cebfb94f85215c3c3dd430d6c00b3d0eec178 (patch)
tree2457c1a82d8710c3bfb4dae3d351a528974e1664
parentd98dd1b27c82d0a583a3419b8a9548e8ff09016b (diff)
downloadchrome-ec-6a9cebfb94f85215c3c3dd430d6c00b3d0eec178.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: I1e4615d99ee9a386b25e58b991e846c5d2beaa39 Signed-off-by: Dave Parker <dparker@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/192686 Reviewed-by: Randall Spangler <rspangler@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 d7c92fe2a4..b589bf5a4a 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)
{