ChromeOS: Add DECLARE_x_CROS_GPIOS()

Change-Id: I88406fa1b54312616e6717af3d924436dc4ff1a6
Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/58899
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org>
This commit is contained in:
Kyösti Mälkki
2021-11-02 13:03:06 +02:00
parent f0be9e3472
commit 4ff218aa71
55 changed files with 73 additions and 290 deletions

View File

@@ -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;

View File

@@ -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__ */