summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/vendorcode/google/chromeos/acpi.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/vendorcode/google/chromeos/acpi.c b/src/vendorcode/google/chromeos/acpi.c
index 6605809023..8fd47a6a76 100644
--- a/src/vendorcode/google/chromeos/acpi.c
+++ b/src/vendorcode/google/chromeos/acpi.c
@@ -14,11 +14,15 @@
*/
#include <arch/acpigen.h>
+#if IS_ENABLED(CONFIG_GENERIC_GPIO_LIB)
+#include <gpio.h>
+#endif
#include "chromeos.h"
void chromeos_acpi_gpio_generate(const struct cros_gpio *gpios, size_t num)
{
size_t i;
+ int gpio_num;
acpigen_write_scope("\\");
acpigen_write_name("OIPG");
@@ -28,7 +32,13 @@ void chromeos_acpi_gpio_generate(const struct cros_gpio *gpios, size_t num)
acpigen_write_package(4);
acpigen_write_integer(gpios[i].type);
acpigen_write_integer(gpios[i].polarity);
- acpigen_write_integer(gpios[i].gpio_num);
+ gpio_num = gpios[i].gpio_num;
+#if IS_ENABLED(CONFIG_GENERIC_GPIO_LIB)
+ /* Get ACPI pin from GPIO library if available */
+ if (gpios[i].gpio_num != CROS_GPIO_VIRTUAL)
+ gpio_num = gpio_acpi_pin(gpio_num);
+#endif
+ acpigen_write_integer(gpio_num);
acpigen_write_string(gpios[i].device);
acpigen_pop_len();
}