summaryrefslogtreecommitdiff
path: root/drivers/pinctrl/intel
diff options
context:
space:
mode:
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>2019-11-25 20:28:14 +0300
committerAndy Shevchenko <andriy.shevchenko@linux.intel.com>2019-12-13 17:48:48 +0300
commit540bff18daf4aa3d67004e8bb02a0ea5b3818451 (patch)
tree7b64a9205a3ad792c31741b96f7405f541d7af3a /drivers/pinctrl/intel
parent095f2a67cdaf0aba6868504e963dda2e4d09a3f8 (diff)
downloadlinux-540bff18daf4aa3d67004e8bb02a0ea5b3818451.tar.xz
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: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Acked-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Diffstat (limited to 'drivers/pinctrl/intel')
-rw-r--r--drivers/pinctrl/intel/pinctrl-lynxpoint.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/pinctrl/intel/pinctrl-lynxpoint.c b/drivers/pinctrl/intel/pinctrl-lynxpoint.c
index 19e8f8f1f7aa..ddb201e5d78f 100644
--- a/drivers/pinctrl/intel/pinctrl-lynxpoint.c
+++ b/drivers/pinctrl/intel/pinctrl-lynxpoint.c
@@ -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);