[coreboot-gerrit] New patch to review for coreboot: apollolake: Add handler for finding ACPI path for GPIO

Duncan Laurie (dlaurie@google.com) gerrit at coreboot.org
Tue May 17 00:34:20 CEST 2016


Duncan Laurie (dlaurie at google.com) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/14859

-gerrit

commit f6d310c6606622a506bcb4629388419a6f3b3e43
Author: Duncan Laurie <dlaurie at chromium.org>
Date:   Mon May 16 15:32:30 2016 -0700

    apollolake: Add handler for finding ACPI path for GPIO
    
    Add a handler for the Intel Apollolake SOC 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 at chromium.org>
---
 src/soc/intel/apollolake/gpio.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/src/soc/intel/apollolake/gpio.c b/src/soc/intel/apollolake/gpio.c
index 06db8c9..748896f 100644
--- a/src/soc/intel/apollolake/gpio.c
+++ b/src/soc/intel/apollolake/gpio.c
@@ -114,3 +114,17 @@ 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_name(gpio_t gpio)
+{
+	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;
+}



More information about the coreboot-gerrit mailing list