From fba4ae1080c19f11abe1205b871ada14db996c61 Mon Sep 17 00:00:00 2001 From: Gabe Black Date: Thu, 24 Oct 2013 02:44:17 -0700 Subject: [PATCH] nyan: Fix up the gpio indices in chromeos.c. The code in that file was using the raw GPIO indices instead of using the GPIO macro to generate a combined gpio_t index type. This technically works just fine, but it's not how these functions are intended to be used. BUG=None TEST=Built and booted into depthcharge on nyan. BRANCH=None Change-Id: I6a886cc7b909b6622c67eeef93833f1a9cade835 Signed-off-by: Gabe Black Reviewed-on: https://chromium-review.googlesource.com/174418 Reviewed-by: Julius Werner Commit-Queue: Gabe Black Tested-by: Gabe Black --- src/mainboard/google/nyan/chromeos.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/mainboard/google/nyan/chromeos.c b/src/mainboard/google/nyan/chromeos.c index 75c99ba44a..8cf16bbb72 100644 --- a/src/mainboard/google/nyan/chromeos.c +++ b/src/mainboard/google/nyan/chromeos.c @@ -37,7 +37,7 @@ void fill_lb_gpios(struct lb_gpios *gpios) /* Write Protect: active low */ gpios->gpios[count].port = GPIO_R1_INDEX; gpios->gpios[count].polarity = ACTIVE_LOW; - gpios->gpios[count].value = gpio_get_in_value(GPIO_R1_INDEX); + gpios->gpios[count].value = gpio_get_in_value(GPIO(R1)); strncpy((char *)gpios->gpios[count].name, "write protect", GPIO_MAX_NAME_LENGTH); count++; @@ -53,14 +53,14 @@ void fill_lb_gpios(struct lb_gpios *gpios) /* Lid: active high */ gpios->gpios[count].port = GPIO_R4_INDEX; gpios->gpios[count].polarity = ACTIVE_HIGH; - gpios->gpios[count].value = gpio_get_in_value(GPIO_R4_INDEX); + gpios->gpios[count].value = gpio_get_in_value(GPIO(R4)); strncpy((char *)gpios->gpios[count].name, "lid", GPIO_MAX_NAME_LENGTH); count++; /* Power: active low */ gpios->gpios[count].port = GPIO_Q0_INDEX; gpios->gpios[count].polarity = ACTIVE_LOW; - gpios->gpios[count].value = gpio_get_in_value(GPIO_Q0_INDEX); + gpios->gpios[count].value = gpio_get_in_value(GPIO(Q0)); strncpy((char *)gpios->gpios[count].name, "power", GPIO_MAX_NAME_LENGTH); count++; @@ -81,7 +81,7 @@ void fill_lb_gpios(struct lb_gpios *gpios) int get_developer_mode_switch(void) { - return gpio_get_in_value(GPIO_Q6_INDEX); + return gpio_get_in_value(GPIO(Q6)); } int get_recovery_mode_switch(void) @@ -89,7 +89,7 @@ int get_recovery_mode_switch(void) uint32_t ec_events; /* The GPIO is active low. */ - if (!gpio_get_in_value(GPIO_Q7_INDEX)) // RECMODE_GPIO + if (!gpio_get_in_value(GPIO(Q7))) // RECMODE_GPIO return 1; ec_events = google_chromeec_get_events_b(); @@ -99,5 +99,5 @@ int get_recovery_mode_switch(void) int get_write_protect_state(void) { - return !gpio_get_in_value(GPIO_R1_INDEX); + return !gpio_get_in_value(GPIO(R1)); }