summaryrefslogtreecommitdiff
path: root/src/mainboard/google/cyan
diff options
context:
space:
mode:
Diffstat (limited to 'src/mainboard/google/cyan')
-rw-r--r--src/mainboard/google/cyan/chromeos.c25
1 files changed, 9 insertions, 16 deletions
diff --git a/src/mainboard/google/cyan/chromeos.c b/src/mainboard/google/cyan/chromeos.c
index 08d7363cb6..a038d1ff7f 100644
--- a/src/mainboard/google/cyan/chromeos.c
+++ b/src/mainboard/google/cyan/chromeos.c
@@ -33,27 +33,20 @@
#if ENV_RAMSTAGE
#include <boot/coreboot_tables.h>
-#define GPIO_COUNT 6
#define ACTIVE_LOW 0
#define ACTIVE_HIGH 1
void fill_lb_gpios(struct lb_gpios *gpios)
{
- struct lb_gpio *gpio;
-
- gpios->size = sizeof(*gpios) + (GPIO_COUNT * sizeof(struct lb_gpio));
- gpios->count = GPIO_COUNT;
-
- gpio = gpios->gpios;
- fill_lb_gpio(gpio++, -1, ACTIVE_HIGH, "write protect",
- get_write_protect_state());
- fill_lb_gpio(gpio++, -1, ACTIVE_HIGH, "recovery",
- recovery_mode_enabled());
- fill_lb_gpio(gpio++, -1, ACTIVE_HIGH, "developer",
- get_developer_mode_switch());
- fill_lb_gpio(gpio++, -1, ACTIVE_HIGH, "lid", get_lid_switch());
- fill_lb_gpio(gpio++, -1, ACTIVE_HIGH, "power", 0);
- fill_lb_gpio(gpio++, -1, ACTIVE_HIGH, "oprom", gfx_get_init_done());
+ struct lb_gpio chromeos_gpios[] = {
+ {-1, ACTIVE_HIGH, get_write_protect_state(), "write protect"},
+ {-1, ACTIVE_HIGH, recovery_mode_enabled(), "recovery"},
+ {-1, ACTIVE_HIGH, get_developer_mode_switch(), "developer"},
+ {-1, ACTIVE_HIGH, get_lid_switch(), "lid"},
+ {-1, ACTIVE_HIGH, 0, "power"},
+ {-1, ACTIVE_HIGH, gfx_get_init_done(), "oprom"},
+ };
+ lb_add_gpios(gpios, chromeos_gpios, ARRAY_SIZE(chromeos_gpios));
}
#endif /* ENV_RAMSTAGE */