diff options
author | Randall Spangler <rspangler@chromium.org> | 2013-04-12 15:07:58 -0700 |
---|---|---|
committer | ChromeBot <chrome-bot@google.com> | 2013-04-15 14:27:45 -0700 |
commit | 108235225d2536f75a3100cd535f44f732b486c3 (patch) | |
tree | 3f111879d86eddbc6979af513ed466dc20faf13d /board/mccroskey | |
parent | 27459f8600d76d5a7ccc4cc1c396ef59cb26ff19 (diff) | |
download | chrome-ec-108235225d2536f75a3100cd535f44f732b486c3.tar.gz |
Refactor gpio_set_level() and gpio_pre_init()
gpio_set_level() now allows setting the pin level if GPIO_LOW or
GPIO_HIGH is specified. Previously, stm32 platforms did this even
though the definition of gpio_set_level() said it wouldn't work.
Fixed gpio_set_level() not setting level after warm reboot on stm32
because it was checking the GPIO_DEFAULT flag in the wrong place.
Fixed LM4 still mucking with alternate function settings and levels
even if GPIO_DEFAULT was specified.
And checked gpio_list[] and all of the calls to gpio_set_flags() to
make sure everything still behaves the same way it did before (or
better, in the case of actual bugs).
BUG=chrome-os-partner:18718
BRANCH=none
TEST=build all platforms; boot spring and link
Change-Id: I4b84815f76060252df235ff9a37da52c54a8eac5
Signed-off-by: Randall Spangler <rspangler@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/48058
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
Diffstat (limited to 'board/mccroskey')
-rw-r--r-- | board/mccroskey/board.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/board/mccroskey/board.c b/board/mccroskey/board.c index fbfac0fb7a..0f56b2ebae 100644 --- a/board/mccroskey/board.c +++ b/board/mccroskey/board.c @@ -17,9 +17,8 @@ #include "timer.h" #include "util.h" -#define GPIO_OUTPUT_OD (GPIO_OUTPUT | GPIO_OPEN_DRAIN) #define GPIO_KB_INPUT (GPIO_INPUT | GPIO_PULL_UP | GPIO_INT_BOTH) -#define GPIO_KB_OUTPUT GPIO_OUTPUT_OD +#define GPIO_KB_OUTPUT (GPIO_OUTPUT | GPIO_OPEN_DRAIN | GPIO_OUT_LOW) #define HARD_RESET_TIMEOUT_MS 5 @@ -47,7 +46,7 @@ const struct gpio_info gpio_list[GPIO_COUNT] = { {"KBD_PWR_BUTTON", GPIO_B, (1<<2), GPIO_INPUT, kbd_power_on}, {"OMZO_RDY_L", GPIO_A, (1<<0), GPIO_INPUT, NULL}, /* PA0_WKUP */ - {"OZMO_RST_L", GPIO_A, (1<<2), GPIO_OUTPUT_OD, NULL}, + {"OZMO_RST_L", GPIO_A, (1<<2), GPIO_HI_Z, NULL}, {"VBUS_UP_DET", GPIO_A, (1<<3), GPIO_INPUT, NULL}, {"OZMO_REQ_L", GPIO_A, (1<<8), GPIO_INPUT, NULL}, {"CHARGE_ZERO", GPIO_B, (1<<0), GPIO_INPUT, NULL}, @@ -74,8 +73,8 @@ const struct gpio_info gpio_list[GPIO_COUNT] = { {"KB_OUT10", GPIO_C, (1<<10), GPIO_KB_OUTPUT, NULL}, {"KB_OUT11", GPIO_C, (1<<11), GPIO_KB_OUTPUT, NULL}, {"KB_OUT12", GPIO_C, (1<<12), GPIO_KB_OUTPUT, NULL}, - {"USB_VBUS_CTRL", GPIO_C, (1<<13), GPIO_OUTPUT, NULL}, - {"HUB_RESET", GPIO_C, (1<<14), GPIO_OUTPUT_OD, NULL}, + {"USB_VBUS_CTRL", GPIO_C, (1<<13), GPIO_OUT_LOW, NULL}, + {"HUB_RESET", GPIO_C, (1<<14), GPIO_HI_Z, NULL}, {"WP_L", GPIO_D, (1<<2), GPIO_INPUT, NULL}, /* FIXME: make this alt. function */ |