summaryrefslogtreecommitdiff
path: root/chip/mec1322/system.c
diff options
context:
space:
mode:
authorAnton Staaf <robotboy@chromium.org>2016-01-20 14:48:28 -0800
committerchrome-bot <chrome-bot@chromium.org>2016-01-27 08:44:20 -0800
commit255a55106292891caead93c1e4b87beee18ca8f7 (patch)
tree07270b02e9be98c273e4afc377727259b576bfbc /chip/mec1322/system.c
parent2e37a50b377fa169f2fa0d4e103e903343ad63f6 (diff)
downloadchrome-ec-255a55106292891caead93c1e4b87beee18ca8f7.tar.gz
GPIO: Use gpio_reset in a few more places
The new gpio_reset function simplifies the pattern used in this code, that of returning a GPIO to its original configured state. It also removes a few instances of using port/mask pairs. Signed-off-by: Anton Staaf <robotboy@chromium.org> BRANCH=None BUG=None TEST=make buildall -j Change-Id: I6e411aaf2f0fbc18aca0ed8742c400a0efe5690d Reviewed-on: https://chromium-review.googlesource.com/324059 Commit-Ready: Anton Staaf <robotboy@chromium.org> Tested-by: Anton Staaf <robotboy@chromium.org> Reviewed-by: Shawn N <shawnn@chromium.org>
Diffstat (limited to 'chip/mec1322/system.c')
-rw-r--r--chip/mec1322/system.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/chip/mec1322/system.c b/chip/mec1322/system.c
index 967d8eb03b..fd38321d39 100644
--- a/chip/mec1322/system.c
+++ b/chip/mec1322/system.c
@@ -270,13 +270,10 @@ void system_hibernate(uint32_t seconds, uint32_t microseconds)
if (hibernate_wake_pins_used > 0) {
for (i = 0; i < hibernate_wake_pins_used; ++i) {
- const enum gpio_signal *pin = &hibernate_wake_pins[i];
- gpio_set_flags_by_mask(gpio_list[*pin].port,
- gpio_list[*pin].mask,
- gpio_list[*pin].flags);
- gpio_set_alternate_function(gpio_list[*pin].port,
- gpio_list[*pin].mask, -1);
- gpio_enable_interrupt(*pin);
+ const enum gpio_signal pin = hibernate_wake_pins[i];
+
+ gpio_reset(pin);
+ gpio_enable_interrupt(pin);
}
interrupt_enable();