summaryrefslogtreecommitdiffstats
path: root/src/vendorcode/google
diff options
context:
space:
mode:
Diffstat (limited to 'src/vendorcode/google')
-rw-r--r--src/vendorcode/google/chromeos/acpi.c3
-rw-r--r--src/vendorcode/google/chromeos/chromeos.h19
2 files changed, 20 insertions, 2 deletions
diff --git a/src/vendorcode/google/chromeos/acpi.c b/src/vendorcode/google/chromeos/acpi.c
index 383cd313f3a1..801f33ddf4e7 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 2ab51bebeb4d..cd3b6035070a 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__ */