1 /* SPDX-License-Identifier: GPL-2.0-only */
3 #include <boot/coreboot_tables.h>
5 #include <ec/google/chromeec/ec.h>
6 #include <ec/google/chromeec/ec_commands.h>
10 #include <vendorcode/google/chromeos/chromeos.h>
12 void fill_lb_gpios(struct lb_gpios
*gpios
)
14 struct lb_gpio chromeos_gpios
[] = {
15 /* Lid: active high (LID_GPIO) */
16 {EXYNOS5_GPX3
, ACTIVE_HIGH
, gpio_get_value(GPIO_X34
), "lid"},
18 /* Power: virtual GPIO active low (POWER_GPIO) */
19 {EXYNOS5_GPX1
, ACTIVE_LOW
, gpio_get_value(GPIO_X12
), "power"},
21 lb_add_gpios(gpios
, chromeos_gpios
, ARRAY_SIZE(chromeos_gpios
));
24 int get_recovery_mode_switch(void)
28 /* The GPIO is active low. */
29 if (!gpio_get_value(GPIO_X07
)) // RECMODE_GPIO
32 ec_events
= google_chromeec_get_events_b();
34 EC_HOST_EVENT_MASK(EC_HOST_EVENT_KEYBOARD_RECOVERY
));
37 int get_write_protect_state(void)
39 return !gpio_get_value(GPIO_X30
);
42 int get_ec_is_trusted(void)
44 /* EC is trusted if not in RW. */
45 return !gpio_get_value(GPIO_X23
);