diff options
Diffstat (limited to 'src/vendorcode')
-rw-r--r-- | src/vendorcode/google/chromeos/acpi.c | 3 | ||||
-rw-r--r-- | src/vendorcode/google/chromeos/chromeos.h | 19 |
2 files changed, 20 insertions, 2 deletions
diff --git a/src/vendorcode/google/chromeos/acpi.c b/src/vendorcode/google/chromeos/acpi.c index 383cd313f3..801f33ddf4 100644 --- a/src/vendorcode/google/chromeos/acpi.c +++ b/src/vendorcode/google/chromeos/acpi.c @@ -12,7 +12,8 @@ void chromeos_acpi_gpio_generate(void) size_t i, num; int gpio_num; - gpios = variant_cros_gpios(&num); + num = variant_cros_gpio.count; + gpios = variant_cros_gpio.gpios; if (!gpios) return; diff --git a/src/vendorcode/google/chromeos/chromeos.h b/src/vendorcode/google/chromeos/chromeos.h index 2ab51bebeb..cd3b603507 100644 --- a/src/vendorcode/google/chromeos/chromeos.h +++ b/src/vendorcode/google/chromeos/chromeos.h @@ -98,6 +98,23 @@ 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); +struct cros_gpio_pack { + int count; + const struct cros_gpio *gpios; +}; + +extern const struct cros_gpio_pack variant_cros_gpio; + +#define DECLARE_NO_CROS_GPIOS() \ + const struct cros_gpio_pack variant_cros_gpio = \ + { .count = 0, .gpios = NULL } + +#define DECLARE_CROS_GPIOS(x) \ + const struct cros_gpio_pack variant_cros_gpio = \ + { .count = ARRAY_SIZE(x), .gpios = x } + +#define DECLARE_WEAK_CROS_GPIOS(x) \ + const struct cros_gpio_pack __weak variant_cros_gpio = \ + { .count = ARRAY_SIZE(x), .gpios = x } #endif /* __CHROMEOS_H__ */ |