diff options
author | Vic Yang <victoryang@chromium.org> | 2013-07-30 08:27:53 +0800 |
---|---|---|
committer | ChromeBot <chrome-bot@google.com> | 2013-07-29 19:59:45 -0700 |
commit | 1eba04284a82c931dfd3758abbb26c3f83f8ba89 (patch) | |
tree | 0e13e7239d37b7bdba3bb425cf1bb146b1c17207 | |
parent | cd89d523b1f6bb9488dd3aed2c9d0019709ad690 (diff) | |
download | chrome-ec-1eba04284a82c931dfd3758abbb26c3f83f8ba89.tar.gz |
spring: hack: Use EC_CMD_SET_HIB_DELAY to receive board rev
(Spring branch only)
We need to know board rev in order to do the right thing about
TPS_RESET. This hack takes the hibernate delay from u-boot but only use
that as an indicator of board rev.
BUG=chrome-os-partner:21107
TEST=None
BRANCH=Spring
Change-Id: I6da09178ebdd7ac56c74cb3da1b41cb59ce47f7c
Signed-off-by: Vic Yang <victoryang@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/63673
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
-rw-r--r-- | board/spring/usb_charging.c | 24 |
1 files changed, 18 insertions, 6 deletions
diff --git a/board/spring/usb_charging.c b/board/spring/usb_charging.c index c33a64d85b..56916527d5 100644 --- a/board/spring/usb_charging.c +++ b/board/spring/usb_charging.c @@ -99,6 +99,8 @@ static int pending_dev_type_update; static int pending_video_power_off; static int restore_id_mux; +static int board_rev = 1; /* Assume new boards unless told otherwise */ + static int s5_boost_ctrl; static enum { @@ -722,13 +724,8 @@ 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 (chipset_get_auto_hibernate_delay()) { + if (board_rev) { if (!(dev_type & TSU6721_TYPE_VBUS_DEBOUNCED)) hook_call_deferred(usb_pull_vac, BATTERY_KEY_DELAY); else @@ -1055,3 +1052,18 @@ static int ext_power_command_current_limit(struct host_cmd_handler_args *args) DECLARE_HOST_COMMAND(EC_CMD_EXT_POWER_CURRENT_LIMIT, ext_power_command_current_limit, EC_VER_MASK(0)); + +static int ext_power_command_hack_board_rev(struct host_cmd_handler_args *args) +{ + const struct ec_params_hib_delay *p = args->params; + + if (p->delay_secs) + board_rev = 1; + else + board_rev = 0; + + return EC_RES_SUCCESS; +} +DECLARE_HOST_COMMAND(EC_CMD_SET_HIB_DELAY, + ext_power_command_hack_board_rev, + EC_VER_MASK(0)); |