diff options
author | Furquan Shaikh <furquan@google.com> | 2020-07-01 01:37:13 -0700 |
---|---|---|
committer | Furquan Shaikh <furquan@google.com> | 2020-07-02 19:12:46 +0000 |
commit | d2d5e44a67f6e7bb80a22822f34397b03426851b (patch) | |
tree | a2e74c878fff29047dd6d06e17160f212610b8d2 /src/drivers/generic | |
parent | 7245100cddbef2626cbc208b79c889f8ac642298 (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/generic')
-rw-r--r-- | src/drivers/generic/gpio_keys/gpio_keys.c | 2 | ||||
-rw-r--r-- | src/drivers/generic/max98357a/max98357a.c | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/src/drivers/generic/gpio_keys/gpio_keys.c b/src/drivers/generic/gpio_keys/gpio_keys.c index f9d71876fa..80ac407904 100644 --- a/src/drivers/generic/gpio_keys/gpio_keys.c +++ b/src/drivers/generic/gpio_keys/gpio_keys.c @@ -43,7 +43,7 @@ static struct acpi_dp *gpio_keys_add_child_node( acpi_dp_add_integer(dsd, "debounce-interval", key->debounce_interval); acpi_dp_add_gpio(dsd, "gpios", parent_path, 0, 0, - config->gpio.polarity); + config->gpio.active_low); return dsd; } diff --git a/src/drivers/generic/max98357a/max98357a.c b/src/drivers/generic/max98357a/max98357a.c index 575548bd27..44f8802490 100644 --- a/src/drivers/generic/max98357a/max98357a.c +++ b/src/drivers/generic/max98357a/max98357a.c @@ -51,7 +51,7 @@ static void max98357a_fill_ssdt(const struct device *dev) path = acpi_device_path(dev); dp = acpi_dp_new_table("_DSD"); acpi_dp_add_gpio(dp, "sdmode-gpio", path, 0, 0, - config->sdmode_gpio.polarity); + config->sdmode_gpio.active_low); acpi_dp_add_integer(dp, "sdmode-delay", config->sdmode_delay); acpi_dp_write(dp); |