diff options
author | Simon Glass <sjg@chromium.org> | 2012-08-22 03:15:52 +0100 |
---|---|---|
committer | Gerrit <chrome-bot@google.com> | 2012-08-27 12:16:10 -0700 |
commit | 130531ab8ca916de4934315264353bfbfcda7871 (patch) | |
tree | 16cc033d0e40d7085f65119b6a0df1e81e55e8d3 /chip/lm4/gpio.c | |
parent | ecd4e1b5d6cc0530b3416ce626b4665ec298e4e4 (diff) | |
download | chrome-ec-130531ab8ca916de4934315264353bfbfcda7871.tar.gz |
Allow GPIOs to be set up later
At present GPIOs must be staticly defined in a table. This is efficient
but inflexible, and requires error-prone and correponding #ifdefs both
in the board's gpio.h and gpio.c files.
Create a GPIO_UNSET option for GPIOs. This allows them to be assigned
an enum value, but have the actual use under program control.
BUG=chrome-os-partner:13064
BRANCH=snow,link
TEST=manual
build and boot on snow with later changes. See the AC power GPIO does
not change when un/plugging power.
Change-Id: Iab58275923d7d6cfce62c890b5db9b6758279a4c
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/31302
Reviewed-by: David Hendricks <dhendrix@chromium.org>
Diffstat (limited to 'chip/lm4/gpio.c')
-rw-r--r-- | chip/lm4/gpio.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/chip/lm4/gpio.c b/chip/lm4/gpio.c index 665b261483..f5eca38a79 100644 --- a/chip/lm4/gpio.c +++ b/chip/lm4/gpio.c @@ -180,6 +180,8 @@ int gpio_set_flags(enum gpio_signal signal, int flags) { const struct gpio_info *g = gpio_list + signal; + if (flags & GPIO_DEFAULT) + return EC_SUCCESS; if (flags & GPIO_OUTPUT) { /* Output */ /* Select open drain first, so that we don't glitch the signal |