summaryrefslogtreecommitdiff
path: root/src/vendorcode
diff options
context:
space:
mode:
authorKyösti Mälkki <kyosti.malkki@gmail.com>2021-11-02 10:36:20 +0200
committerFelix Held <felix-coreboot@felixheld.de>2022-04-06 17:40:50 +0000
commit4fdd84e716bb052bfbae58366c687be2656a97bb (patch)
tree1bdd3c1bed7b16f61ce971a0a552400257e58f88 /src/vendorcode
parentafe5562ca39b26cc42ca04da55b68f73a7b70654 (diff)
ChromeOS: Promote variant_cros_gpio()
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 <kyosti.malkki@gmail.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/58897 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Angel Pons <th3fanbus@gmail.com> Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org>
Diffstat (limited to 'src/vendorcode')
-rw-r--r--src/vendorcode/google/chromeos/acpi.c9
-rw-r--r--src/vendorcode/google/chromeos/chromeos.h11
-rw-r--r--src/vendorcode/google/chromeos/gnvs.c3
3 files changed, 11 insertions, 12 deletions
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
@@ -38,16 +38,9 @@ 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();
}