diff options
author | Aaron Durbin <adurbin@chromium.org> | 2017-07-14 16:53:49 -0600 |
---|---|---|
committer | Aaron Durbin <adurbin@chromium.org> | 2017-07-17 15:00:07 +0000 |
commit | aa2504a10e1106368cf5ec2e54e0083ee62057fb (patch) | |
tree | 72a5e895fbe62a3d9712cf7595a5db1c2c8d8320 /src/soc/intel | |
parent | 2c628f1652fb0ca28a1fc6c43225475362b50fc7 (diff) |
soc/intel/common/gpio: distingiush single vs multi acpi devices
Sadly, small core and big core are not aligned with the OS driver's
expectation on the number of ACPI devices used for each community.
Big core uses a single device while small cores use one ACPI device
per community. Allow for this distinction within the common gpio
implementation and ensure apollolake is utilizing the new option
to retain the correct behavior.
Change-Id: I7c7535c36221139ad6c9adde2df10b80eb5c596a
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://review.coreboot.org/20588
Reviewed-by: Furquan Shaikh <furquan@google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Subrata Banik <subrata.banik@intel.com>
Diffstat (limited to 'src/soc/intel')
-rw-r--r-- | src/soc/intel/apollolake/Kconfig | 1 | ||||
-rw-r--r-- | src/soc/intel/common/block/gpio/Kconfig | 6 | ||||
-rw-r--r-- | src/soc/intel/common/block/gpio/gpio.c | 7 |
3 files changed, 13 insertions, 1 deletions
diff --git a/src/soc/intel/apollolake/Kconfig b/src/soc/intel/apollolake/Kconfig index 68291e5a28..fdbd6d7622 100644 --- a/src/soc/intel/apollolake/Kconfig +++ b/src/soc/intel/apollolake/Kconfig @@ -58,6 +58,7 @@ config CPU_SPECIFIC_OPTIONS select SOC_INTEL_COMMON_BLOCK_CPU select SOC_INTEL_COMMON_BLOCK_FAST_SPI select SOC_INTEL_COMMON_BLOCK_GPIO + select SOC_INTEL_COMMON_BLOCK_GPIO_MULTI_ACPI_DEVICES select SOC_INTEL_COMMON_BLOCK_GPIO_ITSS_POL_CFG select SOC_INTEL_COMMON_BLOCK_GPIO_IOSTANDBY select SOC_INTEL_COMMON_BLOCK_ITSS 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; } |