summaryrefslogtreecommitdiff
path: root/src/lib/gpio.c
diff options
context:
space:
mode:
authorDuncan Laurie <dlaurie@chromium.org>2016-06-29 10:47:22 -0700
committerDuncan Laurie <dlaurie@chromium.org>2016-07-02 01:18:53 +0200
commit5b6c28c43dee455b643e13d7f0debd79835a5f50 (patch)
tree03651a1be906565bd9b00457e936f612db4361bf /src/lib/gpio.c
parentd48d5a626b02e28ab6949263dad85abe92f9214c (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/lib/gpio.c')
-rw-r--r--src/lib/gpio.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/lib/gpio.c b/src/lib/gpio.c
index b0a5f4dfc3..81d6f6bbad 100644
--- a/src/lib/gpio.c
+++ b/src/lib/gpio.c
@@ -145,3 +145,9 @@ __attribute__((weak)) const char *gpio_acpi_path(gpio_t gpio)
{
return NULL;
}
+
+/* Default handler returns 0 because type of gpio_t is unknown */
+__attribute__((weak)) uint16_t gpio_acpi_pin(gpio_t gpio)
+{
+ return 0;
+}