diff options
author | Vic Yang <victoryang@chromium.org> | 2013-02-21 15:43:56 +0800 |
---|---|---|
committer | ChromeBot <chrome-bot@google.com> | 2013-02-21 21:16:43 -0800 |
commit | 517d4d771b4d73adb5e189cca11fafa41ffba923 (patch) | |
tree | 7ddf3cfc73d97183943912d28e1935879dbd8e8f /board | |
parent | 070943e9bfa2530603bb84ddaecd209aa53208da (diff) | |
download | chrome-ec-517d4d771b4d73adb5e189cca11fafa41ffba923.tar.gz |
spring: Handle AP VBUS power
The VBUS power from AP is now incorrectly recognized as AC source. Let's
gate this with device type and BOOST_EN.
BUG=chrome-os-partner:14319
TEST=Manual
BRANCH=None
Change-Id: Id8127ab6f85fb25adfadb1c2bef4c753a58cdc4f
Signed-off-by: Vic Yang <victoryang@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/43709
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
Diffstat (limited to 'board')
-rw-r--r-- | board/spring/board.c | 3 | ||||
-rw-r--r-- | board/spring/usb_charging.c | 3 |
2 files changed, 4 insertions, 2 deletions
diff --git a/board/spring/board.c b/board/spring/board.c index 9e783d8081..8307dd9ab8 100644 --- a/board/spring/board.c +++ b/board/spring/board.c @@ -295,7 +295,8 @@ int board_pmu_init(void) int board_get_ac(void) { /* UVLO is 4.1V. We consider AC bad when its voltage drops below 4.3V */ - return adc_read_channel(ADC_CH_USB_VBUS_SNS) >= 4300; + return gpio_get_level(GPIO_BOOST_EN) && + adc_read_channel(ADC_CH_USB_VBUS_SNS) >= 4300; } int board_battery_led(enum charging_state state) diff --git a/board/spring/usb_charging.c b/board/spring/usb_charging.c index 135405d483..fa943c1fdb 100644 --- a/board/spring/usb_charging.c +++ b/board/spring/usb_charging.c @@ -239,7 +239,8 @@ static void usb_device_change(int dev_type) else gpio_set_level(GPIO_BOOST_EN, 1); - if (dev_type & TSU6721_TYPE_VBUS_DEBOUNCED) { + if ((dev_type & TSU6721_TYPE_VBUS_DEBOUNCED) && + !(dev_type & POWERED_DEVICE_TYPE)) { /* Limit USB port current. 500mA for not listed types. */ int current_limit = I_LIMIT_500MA; if (dev_type & TSU6721_TYPE_CHG12) |