Commit f67a6c11 authored by Andy Shevchenko's avatar Andy Shevchenko Committed by Linus Walleij

gpiolib: acpi: Assign polarity when call acpi_populate_gpio_lookup()

There is no need, since we preserve firmware settings, to override
polarity for GpioInt() resources.

While Documentation/gpio-properties.txt refers to any from GpioIo() /
GpioInt() resources, the active_low flag has been introduced to fill the
gap only for GpioIo() which lacks of that information.

Moreover, in case of GpioInt() existed solution was broken anyway, it
overrides only in one direction, i.e. from 0 to 1, otherwise it would be
still 1 as defined in the resource macro.

So, move the assignment to a right place and forbid to (semi-)override
polarity for GpioInt() type of resources.
Signed-off-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: default avatarMika Westerberg <mika.westerberg@linux.intel.com>
Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
parent 4fbd8d19
...@@ -531,8 +531,8 @@ static int acpi_populate_gpio_lookup(struct acpi_resource *ares, void *data) ...@@ -531,8 +531,8 @@ static int acpi_populate_gpio_lookup(struct acpi_resource *ares, void *data)
lookup->info.triggering = agpio->triggering; lookup->info.triggering = agpio->triggering;
} else { } else {
lookup->info.flags = acpi_gpio_to_gpiod_flags(agpio); lookup->info.flags = acpi_gpio_to_gpiod_flags(agpio);
lookup->info.polarity = lookup->active_low;
} }
} }
return 1; return 1;
...@@ -557,11 +557,8 @@ static int acpi_gpio_resource_lookup(struct acpi_gpio_lookup *lookup, ...@@ -557,11 +557,8 @@ static int acpi_gpio_resource_lookup(struct acpi_gpio_lookup *lookup,
if (!lookup->desc) if (!lookup->desc)
return -ENOENT; return -ENOENT;
if (info) { if (info)
*info = lookup->info; *info = lookup->info;
if (lookup->active_low)
info->polarity = lookup->active_low;
}
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment