summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVic Yang <victoryang@chromium.org>2012-12-25 11:24:22 +0800
committerChromeBot <chrome-bot@google.com>2013-01-08 08:58:38 -0800
commit92bf81948de9333764ed62d620a27f5a46b215d6 (patch)
treea978b1a91cf98cccff55c175ad1553879b17b322
parent5019591f68b22f8d09a139e30488a8e4525311eb (diff)
downloadchrome-ec-92bf81948de9333764ed62d620a27f5a46b215d6.tar.gz
spring: Control BOOST_EN according to device type
BOOST_EN should be turned off when attached device needs power. BUG=chrome-os-partner:14319 TEST=Manual BRANCH=none Change-Id: Ic8d75bdad98eb33ab99792345ddfd90609a1ddbd Signed-off-by: Vic Yang <victoryang@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/40200 Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
-rw-r--r--board/spring/usb_charging.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/board/spring/usb_charging.c b/board/spring/usb_charging.c
index e4d9a362fd..ee87d896ea 100644
--- a/board/spring/usb_charging.c
+++ b/board/spring/usb_charging.c
@@ -20,6 +20,10 @@
#define CPUTS(outstr) cputs(CC_USBCHARGE, outstr)
#define CPRINTF(format, args...) cprintf(CC_USBCHARGE, format, ## args)
+/* Devices that need VBUS power */
+#define POWERED_DEVICE_TYPE (TSU6721_TYPE_OTG | \
+ TSU6721_TYPE_JIG_UART_ON)
+
static enum ilim_config current_ilim_config = ILIM_CONFIG_MANUAL_OFF;
static void board_ilim_use_gpio(void)
@@ -119,6 +123,13 @@ static void usb_device_change(int dev_type)
return;
last_dev_type = dev_type;
+ /* Supply VBUS if needed */
+ if (dev_type & POWERED_DEVICE_TYPE)
+ gpio_set_level(GPIO_BOOST_EN, 0);
+ else
+ gpio_set_level(GPIO_BOOST_EN, 1);
+
+ /* Log to console */
CPRINTF("[%T USB Attached: ");
if (dev_type == TSU6721_TYPE_NONE)
CPRINTF("Nothing]\n");