Commit 540bff18 authored by Andy Shevchenko's avatar Andy Shevchenko

pinctrl: lynxpoint: Move ownership check to IRQ chip

There is nothing wrong with requesting pin that owned by ACPI.
The only difference is how interrupt status will be reflected.
It means that in ACPI mode we may not use pin as GPIO-backed IRQ.

Taking above into consideration, move the check from GPIO to IRQ chip
callback.
Reviewed-by: default avatarLinus Walleij <linus.walleij@linaro.org>
Signed-off-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Acked-by: default avatarMika Westerberg <mika.westerberg@linux.intel.com>
parent 095f2a67
......@@ -118,12 +118,6 @@ static int lp_gpio_request(struct gpio_chip *chip, unsigned int offset)
pm_runtime_get(lg->dev); /* should we put if failed */
/* Fail if BIOS reserved pin for ACPI use */
if (lp_gpio_acpi_use(lg, offset)) {
dev_err(lg->dev, "gpio %d reserved for ACPI\n", offset);
return -EBUSY;
}
/*
* Reconfigure pin to GPIO mode if needed and issue a warning,
* since we expect firmware to configure it properly.
......@@ -280,6 +274,12 @@ static int lp_irq_set_type(struct irq_data *d, unsigned int type)
if (hwirq >= lg->chip.ngpio)
return -EINVAL;
/* Fail if BIOS reserved pin for ACPI use */
if (lp_gpio_acpi_use(lg, hwirq)) {
dev_err(lg->dev, "pin %u can't be used as IRQ\n", hwirq);
return -EBUSY;
}
raw_spin_lock_irqsave(&lg->lock, flags);
value = ioread32(reg);
......
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