From 4fdd84e716bb052bfbae58366c687be2656a97bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ky=C3=B6sti=20M=C3=A4lkki?= Date: Tue, 2 Nov 2021 10:36:20 +0200 Subject: ChromeOS: Promote variant_cros_gpio() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The only purpose of mainboard_chromeos_acpi_generate() was to pass cros_gpio array for ACPI \\OIPG package generation. Promote variant_cros_gpio() from baseboards to ChromeOS declaration. Change-Id: I5c2ac1dcea35f1f00dea401528404bc6ca0ab53c Signed-off-by: Kyösti Mälkki Reviewed-on: https://review.coreboot.org/c/coreboot/+/58897 Tested-by: build bot (Jenkins) Reviewed-by: Angel Pons Reviewed-by: Tim Wawrzynczak --- src/vendorcode/google/chromeos/acpi.c | 9 +++++++-- src/vendorcode/google/chromeos/chromeos.h | 11 +++-------- src/vendorcode/google/chromeos/gnvs.c | 3 +-- 3 files changed, 11 insertions(+), 12 deletions(-) (limited to 'src/vendorcode') diff --git a/src/vendorcode/google/chromeos/acpi.c b/src/vendorcode/google/chromeos/acpi.c index 5a54d70527..383cd313f3 100644 --- a/src/vendorcode/google/chromeos/acpi.c +++ b/src/vendorcode/google/chromeos/acpi.c @@ -6,11 +6,16 @@ #endif #include "chromeos.h" -void chromeos_acpi_gpio_generate(const struct cros_gpio *gpios, size_t num) +void chromeos_acpi_gpio_generate(void) { - size_t i; + const struct cros_gpio *gpios; + size_t i, num; int gpio_num; + gpios = variant_cros_gpios(&num); + if (!gpios) + return; + acpigen_write_scope("\\"); acpigen_write_name("OIPG"); diff --git a/src/vendorcode/google/chromeos/chromeos.h b/src/vendorcode/google/chromeos/chromeos.h index da25617121..34a9f57a8d 100644 --- a/src/vendorcode/google/chromeos/chromeos.h +++ b/src/vendorcode/google/chromeos/chromeos.h @@ -37,17 +37,10 @@ void chromeos_init_chromeos_acpi(void); */ enum cb_err get_dsm_calibration_from_key(const char *key, uint64_t *value); -/* - * Create the OIPG package containing the Chrome OS gpios described by - * the chromeos_gpio array. - */ -struct cros_gpio; -void chromeos_acpi_gpio_generate(const struct cros_gpio *gpios, size_t num); - /* * Declaration for mainboards to use to generate ACPI-specific Chrome OS needs. */ -void mainboard_chromeos_acpi_generate(void); +void chromeos_acpi_gpio_generate(void); enum { CROS_GPIO_REC = 1, /* Recovery */ @@ -104,4 +97,6 @@ struct cros_gpio { #define CROS_GPIO_PE_AH(num, dev) \ CROS_GPIO_PE_INITIALIZER(CROS_GPIO_ACTIVE_HIGH, num, dev) +const struct cros_gpio *variant_cros_gpios(size_t *num); + #endif /* __CHROMEOS_H__ */ diff --git a/src/vendorcode/google/chromeos/gnvs.c b/src/vendorcode/google/chromeos/gnvs.c index 33389b4ebf..faaa646b43 100644 --- a/src/vendorcode/google/chromeos/gnvs.c +++ b/src/vendorcode/google/chromeos/gnvs.c @@ -98,6 +98,5 @@ void acpi_fill_cnvs(void) acpigen_write_opregion(&cnvs_op); acpigen_pop_len(); - /* Usually this creates OIPG package for GPIOs. */ - mainboard_chromeos_acpi_generate(); + chromeos_acpi_gpio_generate(); } -- cgit v1.2.3