summaryrefslogtreecommitdiff
path: root/chip/lm4/gpio.c
diff options
context:
space:
mode:
Diffstat (limited to 'chip/lm4/gpio.c')
-rw-r--r--chip/lm4/gpio.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/chip/lm4/gpio.c b/chip/lm4/gpio.c
index 9cc0d30d51..1722105428 100644
--- a/chip/lm4/gpio.c
+++ b/chip/lm4/gpio.c
@@ -93,8 +93,10 @@ int gpio_pre_init(void)
/* Handle GPIO direction */
if (g->flags & GPIO_OUTPUT) {
/* Output with default level */
- gpio_set_level(i, g->flags & GPIO_HIGH);
LM4_GPIO_DIR(g->port) |= g->mask;
+ /* Must set level after direction; writes to GPIO_DATA
+ * before direction is output appear to be ignored. */
+ gpio_set_level(i, g->flags & GPIO_HIGH);
} else {
/* Input */
if (g->flags & GPIO_PULL) {