|
@@ -2231,9 +2231,11 @@ static struct gpio_desc *of_find_gpio(struct device *dev, const char *con_id,
|
|
|
return desc;
|
|
return desc;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-static struct gpio_desc *acpi_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 int idx,
|
|
|
- enum gpio_lookup_flags *flags)
|
|
|
|
|
|
|
+ enum gpiod_flags flags,
|
|
|
|
|
+ enum gpio_lookup_flags *lookupflags)
|
|
|
{
|
|
{
|
|
|
struct acpi_device *adev = ACPI_COMPANION(dev);
|
|
struct acpi_device *adev = ACPI_COMPANION(dev);
|
|
|
struct acpi_gpio_info info;
|
|
struct acpi_gpio_info info;
|
|
@@ -2264,10 +2266,16 @@ static struct gpio_desc *acpi_find_gpio(struct device *dev, const char *con_id,
|
|
|
desc = acpi_get_gpiod_by_index(adev, NULL, idx, &info);
|
|
desc = acpi_get_gpiod_by_index(adev, NULL, idx, &info);
|
|
|
if (IS_ERR(desc))
|
|
if (IS_ERR(desc))
|
|
|
return desc;
|
|
return desc;
|
|
|
|
|
+
|
|
|
|
|
+ if ((flags == GPIOD_OUT_LOW || flags == GPIOD_OUT_HIGH) &&
|
|
|
|
|
+ info.gpioint) {
|
|
|
|
|
+ dev_dbg(dev, "refusing GpioInt() entry when doing GPIOD_OUT_* lookup\n");
|
|
|
|
|
+ return ERR_PTR(-ENOENT);
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
if (info.polarity == GPIO_ACTIVE_LOW)
|
|
if (info.polarity == GPIO_ACTIVE_LOW)
|
|
|
- *flags |= GPIO_ACTIVE_LOW;
|
|
|
|
|
|
|
+ *lookupflags |= GPIO_ACTIVE_LOW;
|
|
|
|
|
|
|
|
return desc;
|
|
return desc;
|
|
|
}
|
|
}
|
|
@@ -2530,7 +2538,7 @@ struct gpio_desc *__must_check gpiod_get_index(struct device *dev,
|
|
|
desc = of_find_gpio(dev, con_id, idx, &lookupflags);
|
|
desc = of_find_gpio(dev, con_id, idx, &lookupflags);
|
|
|
} else if (ACPI_COMPANION(dev)) {
|
|
} else if (ACPI_COMPANION(dev)) {
|
|
|
dev_dbg(dev, "using ACPI for GPIO lookup\n");
|
|
dev_dbg(dev, "using ACPI for GPIO lookup\n");
|
|
|
- desc = acpi_find_gpio(dev, con_id, idx, &lookupflags);
|
|
|
|
|
|
|
+ desc = acpi_find_gpio(dev, con_id, idx, flags, &lookupflags);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|