>From 975adbe05fcb29606346f866bf2683ff228590f8 Mon Sep 17 00:00:00 2001 From: Joshua Roys Date: Thu, 17 Nov 2011 15:16:46 -0500 Subject: [PATCH 2/2] Fix it87_gpio_set IT87xx chips don't have a GPIO port 0. Signed-off-by: Joshua Roys --- board_enable.c | 6 ++++-- 1 files changed, 4 insertions(+), 2 deletions(-) diff --git a/board_enable.c b/board_enable.c index c10350f..954695f 100644 --- a/board_enable.c +++ b/board_enable.c @@ -1961,6 +1961,8 @@ static int it87_gpio_set(unsigned int gpio, int raise) } found: + gpio -= 10; + /* Check whether the gpio is allowed. */ if (gpio < 32) allowed = (cfg->bank0 >> gpio) & 0x01; @@ -1973,7 +1975,7 @@ found: if (!allowed) { msg_perr("\nERROR: IT%02X does not allow setting GPIO%02u.\n", - cfg->id, gpio); + cfg->id, gpio + 10); return -1; } @@ -1992,7 +1994,7 @@ found: msg_pdbg("Using IT87 GPIO base 0x%04x\n", base); - port = gpio / 10 - 1; + port = gpio / 10; gpio %= 10; /* set GPIO. */ -- 1.7.4.1