summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDuncan Laurie <dlaurie@chromium.org>2016-05-16 15:32:30 -0700
committerDuncan Laurie <dlaurie@google.com>2016-05-21 06:03:22 +0200
commit2e63c2a566a143b31777fb2ead6a2c8d5b76ebeb (patch)
tree7ce787d227fe09f9ef2504ad54cb885cc0b87b0f
parent66bd65d0f7b11bbb8dd4db73bfa95f0c51addddc (diff)
downloadcoreboot-2e63c2a566a143b31777fb2ead6a2c8d5b76ebeb.tar.xz
apollolake: Add handler for finding ACPI path for GPIO
Add a handler for soc/intel/apollolake to return the ACPI path for GPIOs. There are 4 GPIO "communities" on apollolake that each have a different ACPI device so return the appropriate name for the different communities. Change-Id: I596c178b7813ac6aaeb4f2685bb916f5b78e049b Signed-off-by: Duncan Laurie <dlaurie@chromium.org> Reviewed-on: https://review.coreboot.org/14859 Tested-by: build bot (Jenkins) Reviewed-by: Aaron Durbin <adurbin@chromium.org>
-rw-r--r--src/soc/intel/apollolake/gpio.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/soc/intel/apollolake/gpio.c b/src/soc/intel/apollolake/gpio.c
index 06db8c965a..d0ef6482da 100644
--- a/src/soc/intel/apollolake/gpio.c
+++ b/src/soc/intel/apollolake/gpio.c
@@ -114,3 +114,21 @@ void gpio_set(gpio_t gpio_num, int value)
reg |= !!value & PAD_CFG0_TX_STATE;
iosf_write(comm->port, config_offset, reg);
}
+
+const char *gpio_acpi_path(gpio_t gpio_num)
+{
+ const struct pad_community *comm = gpio_get_community(gpio_num);
+
+ switch (comm->port) {
+ case GPIO_NORTH:
+ return "\\_SB.GPO0";
+ case GPIO_NORTHWEST:
+ return "\\_SB.GPO1";
+ case GPIO_WEST:
+ return "\\_SB.GPO2";
+ case GPIO_SOUTHWEST:
+ return "\\_SB.GPO3";
+ }
+
+ return NULL;
+}