google/butterfly: Implement functions required by CHROMEOS
BRANCH=none BUG=chromium:513990 TEST=google/butterfly builds Change-Id: Ia678ca4b0778ee4a2e55ba44a5d89ac6dd691b35 Signed-off-by: Patrick Georgi <pgeorgi@google.com> Original-Commit-Id: 0d82ea2090fae9c66f41ee05cc20a9b22d3641c0 Original-Change-Id: I2fea10c17b769ca76b9d0b80978b4c512ed8c680 Original-Signed-off-by: Patrick Georgi <pgeorgi@chromium.org> Original-Reviewed-on: https://chromium-review.googlesource.com/288851 Original-Reviewed-by: Stefan Reinauer <reinauer@chromium.org> Reviewed-on: http://review.coreboot.org/11062 Tested-by: build bot (Jenkins) Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
This commit is contained in:
committed by
Patrick Georgi
parent
7a625da84f
commit
5e0a2e2d33
@@ -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;
|
||||
|
Reference in New Issue
Block a user