Fix missing GPIO interrupts

Signed-off-by: Randall Spangler <rspangler@chromium.org>

BUG=none
TEST=push and release power button; should see debug messages

Change-Id: I4a08b56247baa85555514623db7a04ab4638ca0e
This commit is contained in:
Randall Spangler
2012-01-26 13:39:36 -08:00
parent 028150a059
commit c4a867984e
2 changed files with 6 additions and 5 deletions

View File

@@ -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

View File

@@ -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;