summaryrefslogtreecommitdiff
path: root/src/mainboard/google
diff options
context:
space:
mode:
Diffstat (limited to 'src/mainboard/google')
-rw-r--r--src/mainboard/google/butterfly/chromeos.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/src/mainboard/google/butterfly/chromeos.c b/src/mainboard/google/butterfly/chromeos.c
index fd7ef4ec82..c23f827136 100644
--- a/src/mainboard/google/butterfly/chromeos.c
+++ b/src/mainboard/google/butterfly/chromeos.c
@@ -56,7 +56,7 @@ void fill_lb_gpios(struct lb_gpios *gpios)
/* Write Protect: GPIO active Low */
gpios->gpios[0].port = WP_GPIO;
gpios->gpios[0].polarity = ACTIVE_LOW;
- gpios->gpios[0].value = get_pch_gpio(WP_GPIO);
+ gpios->gpios[0].value = !get_write_protect_state();
strncpy((char *)gpios->gpios[0].name,"write protect",
GPIO_MAX_NAME_LENGTH);
@@ -74,10 +74,9 @@ void fill_lb_gpios(struct lb_gpios *gpios)
GPIO_MAX_NAME_LENGTH);
/* lid switch value from EC */
- lidswitch = (ec_mem_read(EC_HW_GPI_STATUS) >> EC_GPI_LID_STAT_BIT) & 1;
gpios->gpios[3].port = -1;
gpios->gpios[3].polarity = ACTIVE_HIGH;
- gpios->gpios[3].value = lidswitch;
+ gpios->gpios[3].value = get_lid_switch();
strncpy((char *)gpios->gpios[3].name,"lid", GPIO_MAX_NAME_LENGTH);
printk(BIOS_DEBUG,"LID SWITCH FROM EC: %x\n", lidswitch);
@@ -126,6 +125,16 @@ int get_pch_gpio(unsigned char gpio_num)
return retval;
}
+int get_write_protect_state(void)
+{
+ return !get_pch_gpio(WP_GPIO);
+}
+
+int get_lid_switch(void)
+{
+ return (ec_mem_read(EC_HW_GPI_STATUS) >> EC_GPI_LID_STAT_BIT) & 1;
+}
+
int get_developer_mode_switch(void)
{
int dev_mode = 0;