diff options
author | Kevin Cernekee <cernekee@chromium.org> | 2015-08-17 16:01:34 -0700 |
---|---|---|
committer | ChromeOS bot <3su6n15k.default@developer.gserviceaccount.com> | 2015-08-26 23:11:24 +0000 |
commit | 84dbc0f161cee9080f90762160ea9cf00301dde7 (patch) | |
tree | 3616f13b076412469eb09f1ff41229c7609512a7 | |
parent | fb98259abd8a52978f9bca47273b226af802cc2e (diff) | |
download | chrome-ec-84dbc0f161cee9080f90762160ea9cf00301dde7.tar.gz |
lm4: Make gpio_set_flags() honor GPIO_OPEN_DRAIN
Currently gpio_set_flags() only enables ODR mode if the GPIO_OPEN_DRAIN
flag is set in the gpio_list entry. Since we need to be able to enable
and disable ODR mode dynamically from the unwedge code, check both
flags (from the caller) and g->flags (from the gpio config table).
Note that ToT only checks the flags passed in from the caller, but
if we used that scheme it might require changing additional call sites
(e.g. SPI GPIO configuration).
BUG=chromium:458878
BRANCH=link
TEST=manual
Change-Id: I4e60db30ec5333f80e5a807709d01cfdb2fbdbbb
Signed-off-by: Kevin Cernekee <cernekee@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/295095
Reviewed-by: Randall Spangler <rspangler@chromium.org>
-rw-r--r-- | chip/lm4/gpio.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/chip/lm4/gpio.c b/chip/lm4/gpio.c index 665b261483..b22c6953e3 100644 --- a/chip/lm4/gpio.c +++ b/chip/lm4/gpio.c @@ -184,7 +184,7 @@ int gpio_set_flags(enum gpio_signal signal, int flags) /* Output */ /* Select open drain first, so that we don't glitch the signal * when changing the line to an output. */ - if (g->flags & GPIO_OPEN_DRAIN) + if (g->flags & GPIO_OPEN_DRAIN || flags & GPIO_OPEN_DRAIN) LM4_GPIO_ODR(g->port) |= g->mask; else LM4_GPIO_ODR(g->port) &= ~g->mask; |