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 <gabeblack@google.com> Reviewed-on: https://chromium-review.googlesource.com/174418 Reviewed-by: Julius Werner <jwerner@chromium.org> Commit-Queue: Gabe Black <gabeblack@chromium.org> Tested-by: Gabe Black <gabeblack@chromium.org>
This commit is contained in:
parent
20ae9dee73
commit
fba4ae1080
1 changed files with 6 additions and 6 deletions
|
|
@ -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));
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue