be7692a20c
Change-Id: I9e7200d60db4333551e34a615433fa21c3135db6 Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/58921 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Patrick Georgi <pgeorgi@google.com> Reviewed-by: Felix Held <felix-coreboot@felixheld.de> Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org>
32 lines
827 B
C
32 lines
827 B
C
/* SPDX-License-Identifier: GPL-2.0-or-later */
|
|
|
|
#include <baseboard/gpio.h>
|
|
#include <baseboard/variants.h>
|
|
#include <bootmode.h>
|
|
#include <boot/coreboot_tables.h>
|
|
#include <gpio.h>
|
|
#include <vendorcode/google/chromeos/chromeos.h>
|
|
|
|
void fill_lb_gpios(struct lb_gpios *gpios)
|
|
{
|
|
struct lb_gpio chromeos_gpios[] = {
|
|
{-1, ACTIVE_HIGH, get_lid_switch(), "lid"},
|
|
{-1, ACTIVE_HIGH, 0, "power"},
|
|
{-1, ACTIVE_HIGH, gfx_get_init_done(), "oprom"},
|
|
{GPIO_EC_IN_RW, ACTIVE_HIGH, gpio_get(GPIO_EC_IN_RW), "EC in RW"},
|
|
};
|
|
lb_add_gpios(gpios, chromeos_gpios, ARRAY_SIZE(chromeos_gpios));
|
|
}
|
|
|
|
int get_write_protect_state(void)
|
|
{
|
|
return gpio_get(GPIO_PCH_WP);
|
|
}
|
|
|
|
void mainboard_chromeos_acpi_generate(void)
|
|
{
|
|
const struct cros_gpio *gpios;
|
|
size_t num;
|
|
gpios = variant_cros_gpios(&num);
|
|
chromeos_acpi_gpio_generate(gpios, num);
|
|
}
|