.acpi_inject_dsdt() does not need to modify the device structure. Hence, this change makes the struct device * parameter to acpi_inject_dsdt as const. Change-Id: I3b096d9a5a9d649193e32ea686d5de9f78124997 Signed-off-by: Furquan Shaikh <furquan@google.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/40711 Reviewed-by: Aaron Durbin <adurbin@chromium.org> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
42 lines
975 B
C
42 lines
975 B
C
/* SPDX-License-Identifier: GPL-2.0-only */
|
|
/* This file is part of the coreboot project. */
|
|
|
|
#include <arch/acpigen.h>
|
|
#if CONFIG(GENERIC_GPIO_LIB)
|
|
#include <gpio.h>
|
|
#endif
|
|
#include "chromeos.h"
|
|
|
|
void chromeos_acpi_gpio_generate(const struct cros_gpio *gpios, size_t num)
|
|
{
|
|
size_t i;
|
|
int gpio_num;
|
|
|
|
acpigen_write_scope("\\");
|
|
acpigen_write_name("OIPG");
|
|
|
|
acpigen_write_package(num);
|
|
for (i = 0; i < num; i++) {
|
|
acpigen_write_package(4);
|
|
acpigen_write_integer(gpios[i].type);
|
|
acpigen_write_integer(gpios[i].polarity);
|
|
gpio_num = gpios[i].gpio_num;
|
|
#if CONFIG(GENERIC_GPIO_LIB)
|
|
/* Get ACPI pin from GPIO library if available */
|
|
if (gpios[i].gpio_num != CROS_GPIO_VIRTUAL)
|
|
gpio_num = gpio_acpi_pin(gpio_num);
|
|
#endif
|
|
acpigen_write_integer(gpio_num);
|
|
acpigen_write_string(gpios[i].device);
|
|
acpigen_pop_len();
|
|
}
|
|
acpigen_pop_len();
|
|
|
|
acpigen_pop_len();
|
|
}
|
|
|
|
void chromeos_dsdt_generator(const struct device *dev)
|
|
{
|
|
mainboard_chromeos_acpi_generate();
|
|
}
|