summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVic Yang <victoryang@chromium.org>2013-07-29 11:53:54 +0800
committerVincent Palatin <vpalatin@chromium.org>2013-07-29 06:06:45 -0700
commit3b3e0a919c1f6ad91326ff34aa24d08a548e46f2 (patch)
tree62a68a8b35f69189454c0ff11b54340d1f4ef0d4
parent00cb64eb4c498947b0015cb926739ce3a6bb2cf8 (diff)
downloadchrome-ec-3b3e0a919c1f6ad91326ff34aa24d08a548e46f2.tar.gz
spring: Do not pull low VAC on old boards
TPS_RESET is actually wired to reset TPS65090 on old boards, and therefore we cannot attempt to pull down VAC. Fortunately u-boot tells us about board rev by setting auto-hibernate delay. BUG=chrome-os-partner:21107 TEST=Boot on old boards, unplug a charger and the system is still alive. TEST=Boot on new boards, unplug a charger and VAC goes low. BRANCH=Spring Change-Id: I25f28a5622f9a6efb700b2655853814b5be16943 Signed-off-by: Vic Yang <victoryang@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/63575 Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
-rw-r--r--board/spring/usb_charging.c15
-rw-r--r--common/gaia_power.c5
-rw-r--r--include/chipset.h5
3 files changed, 21 insertions, 4 deletions
diff --git a/board/spring/usb_charging.c b/board/spring/usb_charging.c
index c480e07e59..08f55708bb 100644
--- a/board/spring/usb_charging.c
+++ b/board/spring/usb_charging.c
@@ -731,11 +731,18 @@ static void notify_dev_type_change(int dev_type)
/*
* If the charger is surely removed (not coming back within
* BATTERY_KEY_DELAY), pull down VAC.
+ *
+ * For older boards, doing this actually resets TPS65090. Fortunately,
+ * auto-hibernate is disabled on these boards by host command.
+ * Therefore, we can check auto-hibernate delay to determine if we can
+ * do this.
*/
- if (!(dev_type & TSU6721_TYPE_VBUS_DEBOUNCED))
- hook_call_deferred(usb_pull_vac, BATTERY_KEY_DELAY);
- else
- hook_call_deferred(usb_pull_vac, -1);
+ if (chipset_get_auto_hibernate_delay()) {
+ if (!(dev_type & TSU6721_TYPE_VBUS_DEBOUNCED))
+ hook_call_deferred(usb_pull_vac, BATTERY_KEY_DELAY);
+ else
+ hook_call_deferred(usb_pull_vac, -1);
+ }
}
static int usb_want_redetect(int dev_type)
diff --git a/common/gaia_power.c b/common/gaia_power.c
index 878ea7331b..b18d52b367 100644
--- a/common/gaia_power.c
+++ b/common/gaia_power.c
@@ -158,6 +158,11 @@ static void check_hibernate_timer(void)
system_hibernate(CONFIG_HIBERNATE_WAKE_PERIOD_SECS, 0);
}
}
+
+int chipset_get_auto_hibernate_delay(void)
+{
+ return hibernate_delay;
+}
#else
static void hibernate_timer_arm(void)
{
diff --git a/include/chipset.h b/include/chipset.h
index e652ec23d8..e5765a00a4 100644
--- a/include/chipset.h
+++ b/include/chipset.h
@@ -75,4 +75,9 @@ void chipset_force_shutdown(void);
*/
void chipset_reset(int cold_reset);
+/**
+ * Return the auto-hibernate delay in seconds.
+ */
+int chipset_get_auto_hibernate_delay(void);
+
#endif /* __CROS_EC_CHIPSET_H */