diff options
author | Vincent Palatin <vpalatin@chromium.org> | 2014-05-05 11:45:05 -0700 |
---|---|---|
committer | chrome-internal-fetch <chrome-internal-fetch@google.com> | 2014-05-07 03:39:24 +0000 |
commit | 58c50a970ab7df4f0e3f1b188e6b1966a9d47d1d (patch) | |
tree | bbe7ce91abb197f656fc6f2e430c8dc3e419a636 /board | |
parent | 165c7375da9641c9ab278c47b1135019a79c84f8 (diff) | |
download | chrome-ec-58c50a970ab7df4f0e3f1b188e6b1966a9d47d1d.tar.gz |
zinger: invert output control
The electrical design has changed :
the output enable GPIO (PF0) has switched from being the LM5050 shutdown
pin to controlling directly the FET enabling. We need to invert the
control logic and use it in push-pull mode rather than open-drain.
Signed-off-by: Vincent Palatin <vpalatin@chromium.org>
BRANCH=none
BUG=chrome-os-partner:28332
TEST=plug a reworked Zinger to a firefly and check the firefly LED is
displaying a solid ON (meaning the voltage is right).
Change-Id: Iee79b07f49eade1fee7cac1986bc38ba21e04b25
Reviewed-on: https://chromium-review.googlesource.com/198240
Reviewed-by: Alec Berg <alecaberg@chromium.org>
Commit-Queue: Vincent Palatin <vpalatin@chromium.org>
Tested-by: Vincent Palatin <vpalatin@chromium.org>
Diffstat (limited to 'board')
-rw-r--r-- | board/zinger/hardware.c | 6 | ||||
-rw-r--r-- | board/zinger/usb_pd_policy.c | 12 |
2 files changed, 9 insertions, 9 deletions
diff --git a/board/zinger/hardware.c b/board/zinger/hardware.c index 0a939a72eb..1f9851c707 100644 --- a/board/zinger/hardware.c +++ b/board/zinger/hardware.c @@ -87,10 +87,10 @@ static void pins_init(void) STM32_GPIO_MODER(GPIO_A) = OUT(0) | ANALOG(1) | ANALOG(2) | ANALOG(3) | OUT(4) | AF(5) /*| AF(6)*/ | AF(7) | AF(9) | AF(10) | OUT(13) | OUT(14); - /* set PF0 / PF1 as output, PF0 is open-drain, high by default */ - STM32_GPIO_ODR(GPIO_F) = HIGH(0); + /* set PF0 / PF1 as output */ + STM32_GPIO_ODR(GPIO_F) = 0; STM32_GPIO_MODER(GPIO_F) = OUT(0) | OUT(1); - STM32_GPIO_OTYPER(GPIO_F) = ODR(0); + STM32_GPIO_OTYPER(GPIO_F) = 0; /* Set PB1 as AF0 (TIM14_CH1) */ STM32_GPIO_OSPEEDR(GPIO_B) = HISPEED(1); diff --git a/board/zinger/usb_pd_policy.c b/board/zinger/usb_pd_policy.c index de5794771d..3b72902793 100644 --- a/board/zinger/usb_pd_policy.c +++ b/board/zinger/usb_pd_policy.c @@ -36,20 +36,20 @@ static inline void set_output_voltage(enum volt v) static inline void output_enable(void) { - /* GPF0 (FET driver shutdown) = 0 */ - STM32_GPIO_BSRR(GPIO_F) = GPIO_RESET(0); + /* GPF0 (enable OR'ing FETs) = 1 */ + STM32_GPIO_BSRR(GPIO_F) = GPIO_SET(0); } static inline void output_disable(void) { - /* GPF0 (FET driver shutdown) = 1 */ - STM32_GPIO_BSRR(GPIO_F) = GPIO_SET(0); + /* GPF0 (disable OR'ing FETs) = 0 */ + STM32_GPIO_BSRR(GPIO_F) = GPIO_RESET(0); } static inline int output_is_enabled(void) { - /* GPF0 = FET driver shutdown */ - return !(STM32_GPIO_IDR(GPIO_F) & 1); + /* GPF0 = enable output FET */ + return STM32_GPIO_IDR(GPIO_F) & 1; } /* ----- fault conditions ----- */ |