summaryrefslogtreecommitdiff
path: root/src/mainboard/google/drallion/chromeos.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/mainboard/google/drallion/chromeos.c')
-rw-r--r--src/mainboard/google/drallion/chromeos.c29
1 files changed, 7 insertions, 22 deletions
diff --git a/src/mainboard/google/drallion/chromeos.c b/src/mainboard/google/drallion/chromeos.c
index 6122b85a5b..726736a5cf 100644
--- a/src/mainboard/google/drallion/chromeos.c
+++ b/src/mainboard/google/drallion/chromeos.c
@@ -31,24 +31,14 @@ void fill_lb_gpios(struct lb_gpios *gpios)
lb_add_gpios(gpios, chromeos_gpios, ARRAY_SIZE(chromeos_gpios));
}
-static int cros_get_gpio_value(int type)
+int get_write_protect_state(void)
{
- const struct cros_gpio *cros_gpios;
- size_t i, num_gpios = 0;
-
- cros_gpios = variant_cros_gpios(&num_gpios);
+ return gpio_get(GPP_E15);
+}
- for (i = 0; i < num_gpios; i++) {
- const struct cros_gpio *gpio = &cros_gpios[i];
- if (gpio->type == type) {
- int state = gpio_get(gpio->gpio_num);
- if (gpio->polarity == CROS_GPIO_ACTIVE_LOW)
- return !state;
- else
- return state;
- }
- }
- return 0;
+static bool raw_get_recovery_mode_switch(void)
+{
+ return !gpio_get(GPP_E8);
}
void mainboard_chromeos_acpi_generate(void)
@@ -61,11 +51,6 @@ void mainboard_chromeos_acpi_generate(void)
chromeos_acpi_gpio_generate(cros_gpios, num_gpios);
}
-int get_write_protect_state(void)
-{
- return cros_get_gpio_value(CROS_GPIO_WP);
-}
-
int get_recovery_mode_switch(void)
{
static enum rec_mode_state saved_rec_mode = REC_MODE_UNINITIALIZED;
@@ -91,7 +76,7 @@ int get_recovery_mode_switch(void)
state = REC_MODE_REQUESTED;
/* Read state from the GPIO controlled by servo. */
- if (cros_get_gpio_value(CROS_GPIO_REC))
+ if (raw_get_recovery_mode_switch())
state = REC_MODE_REQUESTED;
/* Store the state in case this is called again in verstage. */