From c4a867984ef707d974f95f4f06f80c4b04db3bc2 Mon Sep 17 00:00:00 2001 From: Randall Spangler Date: Thu, 26 Jan 2012 13:39:36 -0800 Subject: [PATCH] Fix missing GPIO interrupts Signed-off-by: Randall Spangler BUG=none TEST=push and release power button; should see debug messages Change-Id: I4a08b56247baa85555514623db7a04ab4638ca0e --- board/link/board.c | 5 +++-- chip/lm4/gpio.c | 6 +++--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/board/link/board.c b/board/link/board.c index 3f0add3836..20a2437b00 100644 --- a/board/link/board.c +++ b/board/link/board.c @@ -5,16 +5,17 @@ /* EC for Link board configuration */ #include "board.h" +#include "config.h" #include "gpio.h" #include "power_button.h" #include "registers.h" #include "util.h" #include "x86_power.h" -#ifndef CONFIG_X86POWER +#ifndef CONFIG_TASK_X86POWER #define x86_power_interrupt NULL #endif -#ifndef CONFIG_POWERBTN +#ifndef CONFIG_TASK_POWERBTN #define power_button_interrupt NULL #endif diff --git a/chip/lm4/gpio.c b/chip/lm4/gpio.c index c637f26b1e..9cc0d30d51 100644 --- a/chip/lm4/gpio.c +++ b/chip/lm4/gpio.c @@ -87,6 +87,9 @@ int gpio_pre_init(void) /* Set all GPIOs to defaults */ for (i = 0; i < GPIO_COUNT; i++, g++) { + /* Use as GPIO, not alternate function */ + gpio_set_alternate_function(g->port, g->mask, 0); + /* Handle GPIO direction */ if (g->flags & GPIO_OUTPUT) { /* Output with default level */ @@ -103,9 +106,6 @@ int gpio_pre_init(void) } } - /* Use as GPIO, not alternate function */ - gpio_set_alternate_function(g->port, g->mask, 0); - /* Set up interrupts if necessary */ if (g->flags & GPIO_INT_LEVEL) LM4_GPIO_IS(g->port) |= g->mask;