diff options
author | Vincent Palatin <vpalatin@chromium.org> | 2014-11-20 14:13:51 -0800 |
---|---|---|
committer | chrome-internal-fetch <chrome-internal-fetch@google.com> | 2014-11-21 02:45:06 +0000 |
commit | 1c86fa9f6dff9eaff5be29de434252daa063d4eb (patch) | |
tree | 1546dc257ba9a3aa54335f1471e354395bd530a6 /chip | |
parent | 911e21ccc12617c36caa1bb0a5c35ee7902f38c4 (diff) | |
download | chrome-ec-1c86fa9f6dff9eaff5be29de434252daa063d4eb.tar.gz |
stm32f0: fix setting GPIO in push-pull mode
When using gpio_set_flags_by_mask() to modify a GPIO pin setting, the
former code was not able to revert an open-drain GPIO into push-pull
mode (the other way round was working). Fix it to be able to transition
in each direction.
Signed-off-by: Vincent Palatin <vpalatin@chromium.org>
BRANCH=all
BUG=none
TEST=on Twinkie, run "tw res none RP3A0" then "adc" and see the RP3A0
GPIO set to 1 and pulling the CC to 3.3V.
Change-Id: Ic2d8ed95ea21b21d261a12ba298931d8bd5e6919
Reviewed-on: https://chromium-review.googlesource.com/231150
Reviewed-by: Vic Yang <victoryang@chromium.org>
Tested-by: Vincent Palatin <vpalatin@chromium.org>
Commit-Queue: Vincent Palatin <vpalatin@chromium.org>
Reviewed-by: Randall Spangler <rspangler@chromium.org>
Diffstat (limited to 'chip')
-rw-r--r-- | chip/stm32/gpio-f0-l.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/chip/stm32/gpio-f0-l.c b/chip/stm32/gpio-f0-l.c index d3369d9d89..826cb7c591 100644 --- a/chip/stm32/gpio-f0-l.c +++ b/chip/stm32/gpio-f0-l.c @@ -44,6 +44,8 @@ void gpio_set_flags_by_mask(uint32_t port, uint32_t mask, uint32_t flags) */ if (flags & GPIO_OPEN_DRAIN) STM32_GPIO_OTYPER(port) |= mask; + else + STM32_GPIO_OTYPER(port) &= ~mask; val = STM32_GPIO_MODER(port) & ~mask2; if (flags & GPIO_OUTPUT) { |