aboutsummaryrefslogtreecommitdiff
path: root/src/mainboard/google/storm/chromeos.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/mainboard/google/storm/chromeos.c')
-rw-r--r--src/mainboard/google/storm/chromeos.c20
1 files changed, 8 insertions, 12 deletions
diff --git a/src/mainboard/google/storm/chromeos.c b/src/mainboard/google/storm/chromeos.c
index 2640c6a253..a379280ca5 100644
--- a/src/mainboard/google/storm/chromeos.c
+++ b/src/mainboard/google/storm/chromeos.c
@@ -42,18 +42,14 @@ static int read_gpio(gpio_t gpio_num)
void fill_lb_gpios(struct lb_gpios *gpios)
{
- struct lb_gpio *gpio;
- const int GPIO_COUNT = 5;
-
- gpios->size = sizeof(*gpios) + (GPIO_COUNT * sizeof(struct lb_gpio));
- gpios->count = GPIO_COUNT;
-
- gpio = gpios->gpios;
- fill_lb_gpio(gpio++, DEV_SW, ACTIVE_LOW, "developer", read_gpio(DEV_SW));
- fill_lb_gpio(gpio++, REC_SW, ACTIVE_LOW, "recovery", read_gpio(REC_SW));
- fill_lb_gpio(gpio++, WP_SW, ACTIVE_LOW, "write protect", read_gpio(WP_SW));
- fill_lb_gpio(gpio++, -1, ACTIVE_LOW, "power", 1);
- fill_lb_gpio(gpio++, -1, ACTIVE_LOW, "lid", 0);
+ struct lb_gpio chromeos_gpios[] = {
+ {DEV_SW, ACTIVE_LOW, read_gpio(DEV_SW), "developer"},
+ {REC_SW, ACTIVE_LOW, read_gpio(REC_SW), "recovery"},
+ {WP_SW, ACTIVE_LOW, read_gpio(WP_SW), "write protect"},
+ {-1, ACTIVE_LOW, 1, "power"},
+ {-1, ACTIVE_LOW, 0, "lid"},
+ };
+ lb_add_gpios(gpios, chromeos_gpios, ARRAY_SIZE(chromeos_gpios));
}
int get_developer_mode_switch(void)