gpiolib / ACPI: allow passing GPIOF_ACTIVE_LOW for GpioInt resources

The ACPI GpioInt resources contain polarity field that is used to specify
whether the interrupt is active high or low. Since gpiolib supports
GPIOF_ACTIVE_LOW we can pass this information in the flags field in
acpi_find_gpio(), analogous to the DeviceTree version.

Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Acked-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Reviewed-by: Alexandre Courbot <acourbot@nvidia.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
This commit is contained in:
Mika Westerberg
2013-10-10 11:01:10 +03:00
committed by Linus Walleij
parent 81f59e9d13
commit e01f440a68
3 changed files with 15 additions and 1 deletions

View File

@@ -2264,7 +2264,17 @@ static struct gpio_desc *of_find_gpio(struct device *dev, const char *con_id,
static struct gpio_desc *acpi_find_gpio(struct device *dev, const char *con_id,
unsigned int idx, unsigned long *flags)
{
return acpi_get_gpiod_by_index(dev, idx, NULL);
struct acpi_gpio_info info;
struct gpio_desc *desc;
desc = acpi_get_gpiod_by_index(dev, idx, &info);
if (IS_ERR(desc))
return desc;
if (info.gpioint && info.active_low)
*flags |= GPIOF_ACTIVE_LOW;
return desc;
}
static struct gpio_desc *gpiod_find(struct device *dev, const char *con_id,