summaryrefslogtreecommitdiff
path: root/chip
diff options
context:
space:
mode:
authorGerrit <chrome-bot@google.com>2012-05-10 16:25:39 -0700
committerGerrit Code Review <gerrit@gerrit.golo.chromium.org>2012-05-10 16:25:39 -0700
commit058079977e3d94d05d40e44144549b9d4e391144 (patch)
treec3aac22f04caedfc72ccef108590251b0f2fef5e /chip
parent9a5b4927c9985304ff63053408c07edbcd1dab93 (diff)
parentf28f2b2e518d50001b03aeffac747e2f17d2917f (diff)
downloadchrome-ec-058079977e3d94d05d40e44144549b9d4e391144.tar.gz
Merge "Use open drain reset signals, and clean up signals to 5VALW-powered devices"
Diffstat (limited to 'chip')
-rw-r--r--chip/lm4/gpio.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/chip/lm4/gpio.c b/chip/lm4/gpio.c
index 54ab546f00..cb08533413 100644
--- a/chip/lm4/gpio.c
+++ b/chip/lm4/gpio.c
@@ -184,14 +184,18 @@ int gpio_set_flags(enum gpio_signal signal, int flags)
if (flags & GPIO_OUTPUT) {
/* Output */
- LM4_GPIO_DIR(g->port) |= g->mask;
-
+ /* 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)
LM4_GPIO_ODR(g->port) |= g->mask;
else
LM4_GPIO_ODR(g->port) &= ~g->mask;
+
+ LM4_GPIO_DIR(g->port) |= g->mask;
} else {
/* Input */
+ LM4_GPIO_DIR(g->port) &= ~g->mask;
+
if (g->flags & GPIO_PULL) {
/* With pull up/down */
if (g->flags & GPIO_HIGH)