aboutsummaryrefslogtreecommitdiff
path: root/src/mainboard/google/gru/chromeos.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/mainboard/google/gru/chromeos.c')
-rw-r--r--src/mainboard/google/gru/chromeos.c24
1 files changed, 19 insertions, 5 deletions
diff --git a/src/mainboard/google/gru/chromeos.c b/src/mainboard/google/gru/chromeos.c
index da57d861c6..4265f8d9c1 100644
--- a/src/mainboard/google/gru/chromeos.c
+++ b/src/mainboard/google/gru/chromeos.c
@@ -15,15 +15,22 @@
*/
#include <boot/coreboot_tables.h>
+#include <gpio.h>
#include <vendorcode/google/chromeos/chromeos.h>
+#include "board.h"
+
void fill_lb_gpios(struct lb_gpios *gpios)
{
-}
+ struct lb_gpio chromeos_gpios[] = {
+ {GPIO_WP.raw, ACTIVE_LOW, gpio_get(GPIO_WP), "write protect"},
+ {GPIO_BACKLIGHT.raw, ACTIVE_HIGH, -1, "backlight"},
+ {GPIO_EC_IN_RW.raw, ACTIVE_HIGH, -1, "EC in RW"},
+ {GPIO_EC_IRQ.raw, ACTIVE_LOW, -1, "EC interrupt"},
+ {GPIO_RESET.raw, ACTIVE_HIGH, -1, "reset"},
+ };
-int get_developer_mode_switch(void)
-{
- return 0;
+ lb_add_gpios(gpios, chromeos_gpios, ARRAY_SIZE(chromeos_gpios));
}
int get_recovery_mode_switch(void)
@@ -33,5 +40,12 @@ int get_recovery_mode_switch(void)
int get_write_protect_state(void)
{
- return 0;
+ return !gpio_get(GPIO_WP);
+}
+
+void setup_chromeos_gpios(void)
+{
+ gpio_input(GPIO_WP);
+ gpio_input_pullup(GPIO_EC_IN_RW);
+ gpio_input_pullup(GPIO_EC_IRQ);
}