summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaisuke Nojiri <dnojiri@chromium.org>2017-02-22 10:39:33 -0800
committerchrome-bot <chrome-bot@chromium.org>2017-02-23 16:02:05 -0800
commit918cb2ca3aacf6fa4bda71619fbeaea1c0257bdf (patch)
treefe518d86d029a1695cf9fed80319016e033240e4
parent416cdfd36e99eac9b985ad054e36e1742ea970b2 (diff)
downloadchrome-ec-918cb2ca3aacf6fa4bda71619fbeaea1c0257bdf.tar.gz
Reef: Fix power-up sequence for Anx3429
Power-up sequence must bring up PWR_NE followed by RESETN according to Figure 5-16 of the datasheet. BUG=chrome-os-partner:63045 BRANCH=none TEST=Test charging, external monitor, usb flash drive in s0/s3/s5. Change-Id: I0e69f0fd0a06f3c828ca59172e0ca045cdc4f5d7 Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/445934 Reviewed-by: Kevin K Wong <kevin.k.wong@intel.com> Reviewed-by: Nicolas Boichat <drinkcat@chromium.org>
-rw-r--r--board/reef/board.c20
1 files changed, 16 insertions, 4 deletions
diff --git a/board/reef/board.c b/board/reef/board.c
index 2a0850da78..4ae14414fb 100644
--- a/board/reef/board.c
+++ b/board/reef/board.c
@@ -295,10 +295,22 @@ struct usb_mux usb_muxes[CONFIG_USB_PD_PORT_COUNT] = {
/* called from anx74xx_set_power_mode() */
void board_set_tcpc_power_mode(int port, int mode)
{
- if (port == 0) {
- gpio_set_level(GPIO_USB_C0_PD_RST_L, mode);
- msleep(mode ? 10 : 1);
- gpio_set_level(GPIO_EN_USB_TCPC_PWR, mode);
+ if (port != USB_PD_PORT_ANX74XX)
+ return;
+
+ switch (mode) {
+ case ANX74XX_NORMAL_MODE:
+ gpio_set_level(GPIO_EN_USB_TCPC_PWR, 1);
+ msleep(10);
+ gpio_set_level(GPIO_USB_C0_PD_RST_L, 1);
+ break;
+ case ANX74XX_STANDBY_MODE:
+ gpio_set_level(GPIO_USB_C0_PD_RST_L, 0);
+ msleep(1);
+ gpio_set_level(GPIO_EN_USB_TCPC_PWR, 0);
+ break;
+ default:
+ break;
}
}