summaryrefslogtreecommitdiff
path: root/src/drivers/uart/acpi/acpi.c
diff options
context:
space:
mode:
authorFurquan Shaikh <furquan@google.com>2020-07-01 01:37:13 -0700
committerFurquan Shaikh <furquan@google.com>2020-07-02 19:12:46 +0000
commitd2d5e44a67f6e7bb80a22822f34397b03426851b (patch)
treea2e74c878fff29047dd6d06e17160f212610b8d2 /src/drivers/uart/acpi/acpi.c
parent7245100cddbef2626cbc208b79c889f8ac642298 (diff)
acpi_device: Replace polarity with active_low in acpi_gpio for GpioIo
As per ACPI spec, GpioIo does not have any polarity associated with it. Linux kernel uses `active_low` argument within GPIO _DSD property to allow BIOS to indicate if the corresponding GPIO should be treated as active low. Thus, if GPIO has active high polarity or if it does not have any polarity associated with it, then the `active_low` argument is supposed to be set to 0. Having a `polarity` field in acpi_gpio seems confusing because GPIOs might not always have polarity associated with them. Example, in case of DMIC-select GPIO where 0 means select DMIC0 and 1 means select DMIC1, there is no polarity associated with the GPIO. Thus, it would be clearer for mainboard to use macros without having to specify a particular polarity. In order to enable mainboards to provide GPIO information without polarity for GpioIo usage, this change also adds `ACPI_GPIO_OUTPUT` and `ACPI_GPIO_INPUT` macros. BUG=b:157603026 Change-Id: I39d2a6ac8f149a74afeb915812fece86c9b9ad93 Signed-off-by: Furquan Shaikh <furquan@google.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/42968 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Diffstat (limited to 'src/drivers/uart/acpi/acpi.c')
-rw-r--r--src/drivers/uart/acpi/acpi.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/drivers/uart/acpi/acpi.c b/src/drivers/uart/acpi/acpi.c
index 9b4d1fa7f0..f9d9d8fa19 100644
--- a/src/drivers/uart/acpi/acpi.c
+++ b/src/drivers/uart/acpi/acpi.c
@@ -103,15 +103,15 @@ static void uart_acpi_fill_ssdt(const struct device *dev)
if (irq_gpio_index >= 0)
acpi_dp_add_gpio(dsd, "irq-gpios", path,
irq_gpio_index, 0,
- config->irq_gpio.polarity);
+ config->irq_gpio.active_low);
if (reset_gpio_index >= 0)
acpi_dp_add_gpio(dsd, "reset-gpios", path,
reset_gpio_index, 0,
- config->reset_gpio.polarity);
+ config->reset_gpio.active_low);
if (enable_gpio_index >= 0)
acpi_dp_add_gpio(dsd, "enable-gpios", path,
enable_gpio_index, 0,
- config->enable_gpio.polarity);
+ config->enable_gpio.active_low);
acpi_dp_write(dsd);
}