summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/soc/intel/apollolake/Kconfig1
-rw-r--r--src/soc/intel/apollolake/gpio.c18
2 files changed, 19 insertions, 0 deletions
diff --git a/src/soc/intel/apollolake/Kconfig b/src/soc/intel/apollolake/Kconfig
index cce06ebbfe..364c331734 100644
--- a/src/soc/intel/apollolake/Kconfig
+++ b/src/soc/intel/apollolake/Kconfig
@@ -24,6 +24,7 @@ config CPU_SPECIFIC_OPTIONS
select C_ENVIRONMENT_BOOTBLOCK
select COLLECT_TIMESTAMPS
select COMMON_FADT
+ select GENERIC_GPIO_LIB
select HAVE_INTEL_FIRMWARE
select HAVE_SMI_HANDLER
select MMCONF_SUPPORT
diff --git a/src/soc/intel/apollolake/gpio.c b/src/soc/intel/apollolake/gpio.c
index d0ef6482da..ac0d83b810 100644
--- a/src/soc/intel/apollolake/gpio.c
+++ b/src/soc/intel/apollolake/gpio.c
@@ -132,3 +132,21 @@ const char *gpio_acpi_path(gpio_t gpio_num)
return NULL;
}
+
+uint16_t gpio_acpi_pin(gpio_t gpio_num)
+{
+ const struct pad_community *comm = gpio_get_community(gpio_num);
+
+ switch (comm->port) {
+ case GPIO_NORTH:
+ return PAD_N(gpio_num);
+ case GPIO_NORTHWEST:
+ return PAD_NW(gpio_num);
+ case GPIO_WEST:
+ return PAD_W(gpio_num);
+ case GPIO_SOUTHWEST:
+ return PAD_SW(gpio_num);
+ }
+
+ return gpio_num;
+}