blob: 67107d1b41ac685cab413976e016b8be8902e15d [file] [log] [blame]
Jon Murphy960fb2f2022-02-16 06:45:49 -07001/* SPDX-License-Identifier: GPL-2.0-or-later */
2
3#include <baseboard/gpio.h>
Jon Murphyaf025d62022-02-16 06:44:53 -07004#include <boot/coreboot_tables.h>
5#include <bootmode.h>
6#include <gpio.h>
Jon Murphy960fb2f2022-02-16 06:45:49 -07007#include <vendorcode/google/chromeos/chromeos.h>
8
Jon Murphyaf025d62022-02-16 06:44:53 -07009void fill_lb_gpios(struct lb_gpios *gpios)
10{
11 struct lb_gpio chromeos_gpios[] = {
Jon Murphycbf0f982022-02-16 06:47:46 -070012 {-1, ACTIVE_HIGH, get_lid_switch(), "lid"},
Jon Murphyaf025d62022-02-16 06:44:53 -070013 {-1, ACTIVE_HIGH, 0, "power"},
14 };
15 lb_add_gpios(gpios, chromeos_gpios, ARRAY_SIZE(chromeos_gpios));
16}
17
Jon Murphy960fb2f2022-02-16 06:45:49 -070018static const struct cros_gpio cros_gpios[] = {
19 CROS_GPIO_REC_AL(CROS_GPIO_VIRTUAL, GPIO_DEVICE_NAME),
20 CROS_GPIO_WP_AL(CROS_WP_GPIO, GPIO_DEVICE_NAME),
21};
22
23void mainboard_chromeos_acpi_generate(void)
24{
25 chromeos_acpi_gpio_generate(cros_gpios, ARRAY_SIZE(cros_gpios));
26}