From 7eae25ba10d4c53f80b85a25865f66ffc8f08aeb Mon Sep 17 00:00:00 2001 From: Vincent Palatin Date: Wed, 6 May 2015 12:32:37 -0700 Subject: [PATCH] twinkie: fix initialization in sniffer mode Do not set the Rd pull-down by default when we are passively sniffing and we don't need VBUS detection in sniffer mode. Signed-off-by: Vincent Palatin BRANCH=none BUG=none TEST=run Twinkie without any type-C connected, using the "adc" command, check that both CC are floating at startup. Change-Id: I8889b22d978b9911bc4441e485e1984ccedf3425 Reviewed-on: https://chromium-review.googlesource.com/269782 Trybot-Ready: Vincent Palatin Tested-by: Vincent Palatin Reviewed-by: Todd Broch Tested-by: Todd Broch Commit-Queue: Vincent Palatin --- board/twinkie/usb_pd_config.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/board/twinkie/usb_pd_config.h b/board/twinkie/usb_pd_config.h index 6a5e18b128..7645d7500b 100644 --- a/board/twinkie/usb_pd_config.h +++ b/board/twinkie/usb_pd_config.h @@ -140,12 +140,14 @@ static inline void pd_tx_init(void) { gpio_config_module(MODULE_USB_PD, 1); +#ifndef CONFIG_USB_PD_TX_PHY_ONLY /* Detect when VBUS crosses the 4.5V threshold (1.25mV/bit) */ ina2xx_write(0, INA2XX_REG_ALERT, 4500 * 100 / 125); ina2xx_write(0, INA2XX_REG_MASK, INA2XX_MASK_EN_BOL); /* start as a power consumer */ gpio_set_level(GPIO_CC1_RD, 0); gpio_set_level(GPIO_CC2_RD, 0); +#endif /* CONFIG_USB_PD_TX_PHY_ONLY */ } static inline void pd_set_host_mode(int port, int enable)