diff options
author | Andy Shevchenko <andriy.shevchenko@linux.intel.com> | 2019-04-10 18:39:21 +0300 |
---|---|---|
committer | Linus Walleij <linus.walleij@linaro.org> | 2019-04-23 10:55:28 +0200 |
commit | 2d3b6db122ce9aa0a0460e618516e6bfa8eef329 (patch) | |
tree | fdf43e7e9b6706ff55730496063b5c152bc42713 /drivers/gpio/gpiolib-acpi.c | |
parent | 606be34440ee3e6da3799691fcab7b69e1ad06cd (diff) | |
download | lwn-2d3b6db122ce9aa0a0460e618516e6bfa8eef329.tar.gz lwn-2d3b6db122ce9aa0a0460e618516e6bfa8eef329.zip |
gpiolib: acpi: Respect pin bias setting
For now, we don't take into account the pin bias settings supplied by ACPI.
This change is targeting the mentioned gap.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Acked-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'drivers/gpio/gpiolib-acpi.c')
-rw-r--r-- | drivers/gpio/gpiolib-acpi.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/drivers/gpio/gpiolib-acpi.c b/drivers/gpio/gpiolib-acpi.c index 9c6ebaaa02fe..c9fc9e232aaf 100644 --- a/drivers/gpio/gpiolib-acpi.c +++ b/drivers/gpio/gpiolib-acpi.c @@ -528,6 +528,17 @@ acpi_gpio_update_gpiod_flags(enum gpiod_flags *flags, struct acpi_gpio_info *inf int acpi_gpio_update_gpiod_lookup_flags(unsigned long *lookupflags, struct acpi_gpio_info *info) { + switch (info->pin_config) { + case ACPI_PIN_CONFIG_PULLUP: + *lookupflags |= GPIO_PULL_UP; + break; + case ACPI_PIN_CONFIG_PULLDOWN: + *lookupflags |= GPIO_PULL_DOWN; + break; + default: + break; + } + if (info->polarity == GPIO_ACTIVE_LOW) *lookupflags |= GPIO_ACTIVE_LOW; @@ -567,6 +578,7 @@ static int acpi_populate_gpio_lookup(struct acpi_resource *ares, void *data) lookup->desc = acpi_get_gpiod(agpio->resource_source.string_ptr, agpio->pin_table[pin_index]); + lookup->info.pin_config = agpio->pin_config; lookup->info.gpioint = gpioint; /* |