summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVic Yang <victoryang@chromium.org>2013-11-14 12:27:15 +0800
committerchrome-internal-fetch <chrome-internal-fetch@google.com>2013-11-14 17:27:36 +0000
commite88d3a0ee8f7f5fbc407ed69aaacd70d0f91f05a (patch)
tree9601bec2727d30ad30b0802bec48dde19eecacae
parent48b1be818ac26fe48482905395f6ff4257f989ed (diff)
downloadchrome-ec-e88d3a0ee8f7f5fbc407ed69aaacd70d0f91f05a.tar.gz
spring: Don't re-arm charger idle timer when it's running
When the charger idle timer is already armed, we should ignore all events that may trigger charger idle mode. BUG=none TEST=Repeatedly trigger charger idle mode and see it doesn't re-arm. BRANCH=spring Change-Id: Ic87a128feaec6fc412c9c1cbd00b64a50022f288 Signed-off-by: Vic Yang <victoryang@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/176820 Reviewed-by: Vincent Palatin <vpalatin@chromium.org> Commit-Queue: Vincent Palatin <vpalatin@chromium.org> Tested-by: Vincent Palatin <vpalatin@chromium.org>
-rw-r--r--board/spring/usb_charging.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/board/spring/usb_charging.c b/board/spring/usb_charging.c
index 69e7caed4f..b4d94664ba 100644
--- a/board/spring/usb_charging.c
+++ b/board/spring/usb_charging.c
@@ -648,7 +648,7 @@ static void check_spring_brick_deferred(void)
uint8_t id = tsu6721_read(TSU6721_REG_ADC);
if ((power_removed_type[1] & TSU6721_TYPE_CHG12) &&
- (current_dev_type == 0) && (id == 0x17)) {
+ (current_dev_type == 0) && (id == 0x17) && !charger_idle) {
/*
* the power brick is still plugged
* but has internally cut its voltage.
@@ -692,7 +692,7 @@ static void usb_detect_overcurrent(int dev_type)
timestamp_t now = get_time();
if ((power_removed_type[1] & TSU6721_TYPE_CHG12) &&
((now.val - power_removed_time[1].val) <
- SPRING_GLITCH_THR)) {
+ SPRING_GLITCH_THR) && !charger_idle) {
/*
* the spring brick should not glitch,
* put it in idle.