summaryrefslogtreecommitdiff
path: root/src/mainboard/google/auron
diff options
context:
space:
mode:
Diffstat (limited to 'src/mainboard/google/auron')
-rw-r--r--src/mainboard/google/auron/chromeos.c39
1 files changed, 9 insertions, 30 deletions
diff --git a/src/mainboard/google/auron/chromeos.c b/src/mainboard/google/auron/chromeos.c
index 2f0e0254eb..4447ddcbbb 100644
--- a/src/mainboard/google/auron/chromeos.c
+++ b/src/mainboard/google/auron/chromeos.c
@@ -29,38 +29,17 @@
#ifndef __PRE_RAM__
#include <boot/coreboot_tables.h>
-#define GPIO_COUNT 6
-
-/*static void fill_lb_gpio(struct lb_gpio *gpio, int num,
- int polarity, const char *name, int force)
-{
- memset(gpio, 0, sizeof(*gpio));
- gpio->port = num;
- gpio->polarity = polarity;
- if (force >= 0)
- gpio->value = force;
- else if (num >= 0)
- gpio->value = get_gpio(num);
- strncpy((char *)gpio->name, name, GPIO_MAX_NAME_LENGTH);
-}
-*/
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++, CROS_WP_GPIO, ACTIVE_HIGH, "write protect", 0);
- fill_lb_gpio(gpio++, -1, ACTIVE_HIGH, "recovery",
- get_recovery_mode_switch());
- 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[] = {
+ {CROS_WP_GPIO, ACTIVE_HIGH, 0, "write protect"},
+ {-1, ACTIVE_HIGH, get_recovery_mode_switch(), "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