diff options
author | Alec Berg <alecaberg@chromium.org> | 2014-06-03 11:54:36 -0700 |
---|---|---|
committer | chrome-internal-fetch <chrome-internal-fetch@google.com> | 2014-06-04 20:59:11 +0000 |
commit | 46e9d7b468085c6c1c3c4e3852484a75a74faa08 (patch) | |
tree | 74adacaefd8b58f7bb5d129c56a50b32b5213fb9 | |
parent | 976260dc69c4356b866b901ade15895a59a0077b (diff) | |
download | chrome-ec-46e9d7b468085c6c1c3c4e3852484a75a74faa08.tar.gz |
samus_pd: pd tx should output low when not transmitting
Change pd spi tx pin to output low when not transmitting.
BUG=none
BRANCH=none
TEST=tested on samus by making sure we can still talk PD
to charger and charge.
Change-Id: I33665d01860c765cc0ff2e7813b04cac0ab9c8fe
Signed-off-by: Alec Berg <alecaberg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/202511
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
-rw-r--r-- | board/samus_pd/board.c | 21 | ||||
-rw-r--r-- | board/samus_pd/board.h | 13 | ||||
-rw-r--r-- | board/samus_pd/usb_pd_config.h | 5 |
3 files changed, 16 insertions, 23 deletions
diff --git a/board/samus_pd/board.c b/board/samus_pd/board.c index 9105c9322e..07fc4fa14a 100644 --- a/board/samus_pd/board.c +++ b/board/samus_pd/board.c @@ -67,10 +67,14 @@ const struct gpio_info gpio_list[] = { {"USB_C1_REF_PD_ODL", GPIO_A, (1<<7), GPIO_ODR_LOW, NULL}, {"USB_C_CC_EN", GPIO_C, (1<<10), GPIO_OUT_LOW, NULL}, - {"USB_C0_CC1_TX_EN", GPIO_A, (1<<15), GPIO_OUT_LOW, NULL}, - {"USB_C0_CC2_TX_EN", GPIO_E, (1<<12), GPIO_OUT_LOW, NULL}, - {"USB_C1_CC1_TX_EN", GPIO_B, (1<<9), GPIO_OUT_LOW, NULL}, - {"USB_C1_CC2_TX_EN", GPIO_B, (1<<12), GPIO_OUT_LOW, NULL}, + {"USB_C0_CC1_TX_EN", GPIO_A, (1<<15), GPIO_OUT_LOW, NULL}, + {"USB_C0_CC2_TX_EN", GPIO_E, (1<<12), GPIO_OUT_LOW, NULL}, + {"USB_C1_CC1_TX_EN", GPIO_B, (1<<9), GPIO_OUT_LOW, NULL}, + {"USB_C1_CC2_TX_EN", GPIO_B, (1<<12), GPIO_OUT_LOW, NULL}, + {"USB_C0_CC1_TX_DATA", GPIO_B, (1<<4), GPIO_OUT_LOW, NULL}, + {"USB_C1_CC1_TX_DATA", GPIO_B, (1<<14), GPIO_OUT_LOW, NULL}, + {"USB_C0_CC2_TX_DATA", GPIO_E, (1<<14), GPIO_OUT_LOW, NULL}, + {"USB_C1_CC2_TX_DATA", GPIO_D, (1<<3), GPIO_OUT_LOW, NULL}, #if 0 /* Alternate functions */ @@ -78,15 +82,6 @@ const struct gpio_info gpio_list[] = { {"USB_C1_TX_CLKOUT", GPIO_E, (1<<1), GPIO_OUT_LOW, NULL}, {"USB_C0_TX_CLKIN", GPIO_B, (1<<3), GPIO_OUT_LOW, NULL}, {"USB_C1_TX_CLKIN", GPIO_B, (1<<13), GPIO_OUT_LOW, NULL}, - - {"USB_C0_CC1_TX_DATA", GPIO_B, (1<<4), GPIO_OUT_LOW, NULL}, - {"USB_C0_CC1_TX_DATA", GPIO_B, (1<<5), GPIO_INPUT, NULL}, - {"USB_C1_CC1_TX_DATA", GPIO_B, (1<<14), GPIO_OUT_LOW, NULL}, - {"USB_C1_CC1_TX_DATA", GPIO_B, (1<<15), GPIO_INPUT, NULL}, - {"USB_C0_CC2_TX_DATA", GPIO_E, (1<<14), GPIO_OUT_LOW, NULL}, - {"USB_C0_CC2_TX_DATA", GPIO_E, (1<<15), GPIO_INPUT, NULL}, - {"USB_C1_CC2_TX_DATA", GPIO_D, (1<<3), GPIO_OUT_LOW, NULL}, - {"USB_C1_CC2_TX_DATA", GPIO_D, (1<<4), GPIO_INPUT, NULL}, #endif /* Power and muxes control */ diff --git a/board/samus_pd/board.h b/board/samus_pd/board.h index 024b27bc6e..265f3e18a0 100644 --- a/board/samus_pd/board.h +++ b/board/samus_pd/board.h @@ -70,6 +70,10 @@ enum gpio_signal { GPIO_USB_C0_CC2_TX_EN, GPIO_USB_C1_CC1_TX_EN, GPIO_USB_C1_CC2_TX_EN, + GPIO_USB_C0_CC1_TX_DATA, + GPIO_USB_C1_CC1_TX_DATA, + GPIO_USB_C0_CC2_TX_DATA, + GPIO_USB_C1_CC2_TX_DATA, #if 0 /* Alternate functions */ @@ -77,15 +81,6 @@ enum gpio_signal { GPIO_USB_C1_TX_CLKOUT, GPIO_USB_C0_TX_CLKIN, GPIO_USB_C1_TX_CLKIN, - - GPIO_USB_C0_CC1_TX_DATA, - GPIO_USB_C0_CC1_TX_DATA, - GPIO_USB_C1_CC1_TX_DATA, - GPIO_USB_C1_CC1_TX_DATA, - GPIO_USB_C0_CC2_TX_DATA, - GPIO_USB_C0_CC2_TX_DATA, - GPIO_USB_C1_CC2_TX_DATA, - GPIO_USB_C1_CC2_TX_DATA, #endif /* Power and muxes control */ diff --git a/board/samus_pd/usb_pd_config.h b/board/samus_pd/usb_pd_config.h index 016394e8bb..767c104e71 100644 --- a/board/samus_pd/usb_pd_config.h +++ b/board/samus_pd/usb_pd_config.h @@ -59,7 +59,10 @@ static inline void pd_tx_enable(int polarity) /* Put the TX driver in Hi-Z state */ static inline void pd_tx_disable(int polarity) { - /* put SPI TX in Hi-Z */ + /* + * output low on SPI TX by removing alternate function mode which + * restores to the initial configuration in board.c + */ if (polarity) /* PE14 is SPI1 MISO */ gpio_set_alternate_function(GPIO_E, 0x4000, -1); else /* PB4 is SPI1 MISO */ |