diff options
author | Duncan Laurie <dlaurie@chromium.org> | 2016-06-29 10:47:22 -0700 |
---|---|---|
committer | Duncan Laurie <dlaurie@chromium.org> | 2016-07-02 01:18:53 +0200 |
commit | 5b6c28c43dee455b643e13d7f0debd79835a5f50 (patch) | |
tree | 03651a1be906565bd9b00457e936f612db4361bf /src/arch | |
parent | d48d5a626b02e28ab6949263dad85abe92f9214c (diff) |
gpio: Add support for translating gpio_t into ACPI pin
Add a function for an SOC to define that will allow it to map the
SOC-specific gpio_t value into an appropriate ACPI pin. The exact
behavior depends on the GPIO implementation in the SOC, but it can
be used to provide a pin number that is relative to the community or
bank that a GPIO resides in.
Change-Id: Icb97ccf7d6a9034877614d49166bc9e4fe659bcf
Signed-off-by: Duncan Laurie <dlaurie@chromium.org>
Reviewed-on: https://review.coreboot.org/15512
Tested-by: build bot (Jenkins)
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Diffstat (limited to 'src/arch')
-rw-r--r-- | src/arch/x86/acpi_device.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/arch/x86/acpi_device.c b/src/arch/x86/acpi_device.c index 69d44f3f33..940d87156d 100644 --- a/src/arch/x86/acpi_device.c +++ b/src/arch/x86/acpi_device.c @@ -314,8 +314,13 @@ void acpi_device_write_gpio(const struct acpi_gpio *gpio) acpi_device_fill_from_len(pin_table_offset, start); /* Pin Table, one word for each pin */ - for (pin = 0; pin < gpio->pin_count; pin++) - acpigen_emit_word(gpio->pins[pin]); + for (pin = 0; pin < gpio->pin_count; pin++) { + uint16_t acpi_pin = gpio->pins[pin]; +#if IS_ENABLED(CONFIG_GENERIC_GPIO_LIB) + acpi_pin = gpio_acpi_pin(acpi_pin); +#endif + acpigen_emit_word(acpi_pin); + } /* Fill in Resource Source Name Offset */ acpi_device_fill_from_len(resource_offset, start); |