diff options
author | Alec Berg <alecaberg@chromium.org> | 2014-08-07 13:06:46 -0700 |
---|---|---|
committer | chrome-internal-fetch <chrome-internal-fetch@google.com> | 2014-08-09 00:19:58 +0000 |
commit | 566de98ca6b0d6a579a2dae84ecaac40c703abf7 (patch) | |
tree | 099d8911777b830142ca026423a6e6b007ff5905 | |
parent | 8bbee7645840cf9f96b2f0343ab68571c02322a2 (diff) | |
download | chrome-ec-566de98ca6b0d6a579a2dae84ecaac40c703abf7.tar.gz |
samus_pd: change port C1 PD comparator to use window mode
Change USBC port 1 PD comparator to use window mode, which
uses COMP1's non-inverting input for COMP2's non-inverting
input (pin PA1). This allows us to free up pin PA3 and PA7
for the next build.
BUG=chrome-os-partner:31215
BRANCH=none
TEST=make sure PD communication works on both ports by plugging
in a zinger. Then set gpioset USB_C0_REF_PD_ODL 1, to change
comparator voltage to 1.5 V and verify that neither port works.
Then gpioset USB_C0_REF_PD_ODL 0 and gpioset USB_C1_REF_PD_ODL 1
and make sure that both ports work. This proves that both ports
are using USB_C0_REF_PD_ODL as the comparator value (PA1).
Change-Id: I6e1e5606af43196b04c84417552002b063aa4134
Signed-off-by: Alec Berg <alecaberg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/211416
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
-rw-r--r-- | board/samus_pd/usb_pd_config.h | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/board/samus_pd/usb_pd_config.h b/board/samus_pd/usb_pd_config.h index 6a11f827e2..60925b3077 100644 --- a/board/samus_pd/usb_pd_config.h +++ b/board/samus_pd/usb_pd_config.h @@ -163,15 +163,16 @@ static inline void pd_tx_disable(int port, int polarity) static inline void pd_select_polarity(int port, int polarity) { if (port == 0) { - /* use the right comparator non inverted input for COMP1 */ + /* use the right comparator inverted input for COMP1 */ STM32_COMP_CSR = (STM32_COMP_CSR & ~STM32_COMP_CMP1INSEL_MASK) | STM32_COMP_CMP1EN | (polarity ? STM32_COMP_CMP1INSEL_INM4 : STM32_COMP_CMP1INSEL_INM6); } else { - /* use the right comparator non inverted input for COMP2 */ + /* use the right comparator inverted input for COMP2 */ + /* use window mode on COMP2 to use COMP1 non-inverting input */ STM32_COMP_CSR = (STM32_COMP_CSR & ~STM32_COMP_CMP2INSEL_MASK) - | STM32_COMP_CMP2EN + | STM32_COMP_CMP2EN | STM32_COMP_WNDWEN | (polarity ? STM32_COMP_CMP2INSEL_INM5 : STM32_COMP_CMP2INSEL_INM6); } |