summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVincent Palatin <vpalatin@chromium.org>2013-11-15 18:08:57 -0800
committerchrome-internal-fetch <chrome-internal-fetch@google.com>2013-11-19 18:20:41 +0000
commitfecd16603c8649b3d01b8900f97a573d876bd7d9 (patch)
tree502b6afee3e22b9120da86570ad3663759c9eeed
parentf7e70eb328954eb3c3f199463ad940bc3f94aa6f (diff)
downloadchrome-ec-fecd16603c8649b3d01b8900f97a573d876bd7d9.tar.gz
spring: remove minimum delay when the charger enters idle
If the charger enters idle mode on its own, do not enforce a minimum idle period, only enforce it when we detect a glitch. Signed-off-by: Vincent Palatin <vpalatin@chromium.org> BRANCH=spring BUG=none TEST=on Spring, exercise both charger idle paths and unplug/re-plug the brick afterwards and check the charging LED behavior. Change-Id: I2ecc067904677a4114e32a0d8218c2cc9d7d1f65 Reviewed-on: https://chromium-review.googlesource.com/177100 Reviewed-by: Puneet Kumar <puneetster@chromium.org> Commit-Queue: Vincent Palatin <vpalatin@chromium.org> Tested-by: Vincent Palatin <vpalatin@chromium.org>
-rw-r--r--board/spring/usb_charging.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/board/spring/usb_charging.c b/board/spring/usb_charging.c
index b7c9f6c445..ec7ecb034f 100644
--- a/board/spring/usb_charging.c
+++ b/board/spring/usb_charging.c
@@ -655,7 +655,7 @@ static void check_spring_brick_deferred(void)
*/
CPRINTF("[%T Spring brick went to IDLE\n");
charger_idle = 1;
- charger_idle_time = get_time();
+ charger_idle_time.val = 0 /* no minimum idle period */;
}
}
@@ -758,8 +758,9 @@ static void usb_update_ilim(int dev_type)
* and re-detected.
*/
if ((dev_type == TSU6721_TYPE_VBUS_DEBOUNCED) &&
- ((get_time().val - charger_idle_time.val) >
- CHARGER_IDLE_MINIMUM_PERIOD)) {
+ ((charger_idle_time.val == 0) ||
+ ((get_time().val - charger_idle_time.val) >
+ CHARGER_IDLE_MINIMUM_PERIOD))) {
charger_idle = 0;
CPRINTF("[%T RESET charger idle]\n");
} else {