summaryrefslogtreecommitdiff
path: root/src/soc/intel/common
diff options
context:
space:
mode:
Diffstat (limited to 'src/soc/intel/common')
-rw-r--r--src/soc/intel/common/block/gpio/Kconfig6
-rw-r--r--src/soc/intel/common/block/gpio/gpio.c7
2 files changed, 12 insertions, 1 deletions
diff --git a/src/soc/intel/common/block/gpio/Kconfig b/src/soc/intel/common/block/gpio/Kconfig
index bd2651f637..6d712e9585 100644
--- a/src/soc/intel/common/block/gpio/Kconfig
+++ b/src/soc/intel/common/block/gpio/Kconfig
@@ -34,3 +34,9 @@ config SOC_INTEL_COMMON_BLOCK_GPIO_LEGACY_MACROS
depends on SOC_INTEL_COMMON_BLOCK_GPIO
bool
default n
+
+# Indicate if multiple ACPI devices are used for each gpio community.
+config SOC_INTEL_COMMON_BLOCK_GPIO_MULTI_ACPI_DEVICES
+ depends on SOC_INTEL_COMMON_BLOCK_GPIO
+ bool
+ default n
diff --git a/src/soc/intel/common/block/gpio/gpio.c b/src/soc/intel/common/block/gpio/gpio.c
index 9b4f8f0247..58bc6d9a81 100644
--- a/src/soc/intel/common/block/gpio/gpio.c
+++ b/src/soc/intel/common/block/gpio/gpio.c
@@ -306,7 +306,12 @@ void gpio_set(gpio_t gpio_num, int value)
uint16_t gpio_acpi_pin(gpio_t gpio_num)
{
- const struct pad_community *comm = gpio_get_community(gpio_num);
+ const struct pad_community *comm;
+
+ if (!IS_ENABLED(CONFIG_SOC_INTEL_COMMON_BLOCK_GPIO_MULTI_ACPI_DEVICES))
+ return gpio_num;
+
+ comm = gpio_get_community(gpio_num);
return gpio_num - comm->first_pad;
}