summaryrefslogtreecommitdiffstats
path: root/drivers/gpio/gpiolib.c
diff options
context:
space:
mode:
authorMika Westerberg <mika.westerberg@linux.intel.com>2016-09-12 14:29:51 +0300
committerLinus Walleij <linus.walleij@linaro.org>2016-09-13 10:45:59 +0200
commit0a1e005374910180c30247386992565b05109eac (patch)
tree9e1d8996a33f992fccf1ff83e2a522c6a588e3a2 /drivers/gpio/gpiolib.c
parente35b5ab0a706f3794d35652b557a5e6a4dde5391 (diff)
downloadop-kernel-dev-0a1e005374910180c30247386992565b05109eac.zip
op-kernel-dev-0a1e005374910180c30247386992565b05109eac.tar.gz
gpiolib: Forbid irqchip default trigger for ACPI enumerated devices
Follow DT and forbid default trigger if the GPIO irqchip device is enumerated from ACPI. Triggering for these devices will be configured automatically from ACPI interrupt resources provided by the BIOS. Suggested-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'drivers/gpio/gpiolib.c')
-rw-r--r--drivers/gpio/gpiolib.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c
index e183ee2..043128d 100644
--- a/drivers/gpio/gpiolib.c
+++ b/drivers/gpio/gpiolib.c
@@ -1614,13 +1614,18 @@ int _gpiochip_irqchip_add(struct gpio_chip *gpiochip,
of_node = gpiochip->of_node;
#endif
/*
- * Specifying a default trigger is a terrible idea if DT is
+ * Specifying a default trigger is a terrible idea if DT or ACPI is
* used to configure the interrupts, as you may end-up with
* conflicting triggers. Tell the user, and reset to NONE.
*/
if (WARN(of_node && type != IRQ_TYPE_NONE,
"%s: Ignoring %d default trigger\n", of_node->full_name, type))
type = IRQ_TYPE_NONE;
+ if (has_acpi_companion(gpiochip->parent) && type != IRQ_TYPE_NONE) {
+ acpi_handle_warn(ACPI_HANDLE(gpiochip->parent),
+ "Ignoring %d default trigger\n", type);
+ type = IRQ_TYPE_NONE;
+ }
gpiochip->irqchip = irqchip;
gpiochip->irq_handler = handler;
OpenPOWER on IntegriCloud