From patchwork Mon Sep 12 11:29:51 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mika Westerberg X-Patchwork-Id: 9326227 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id A7F8260839 for ; Mon, 12 Sep 2016 11:29:57 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9A31728CF9 for ; Mon, 12 Sep 2016 11:29:57 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8E5E128D20; Mon, 12 Sep 2016 11:29:57 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F279628D07 for ; Mon, 12 Sep 2016 11:29:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753728AbcILL34 (ORCPT ); Mon, 12 Sep 2016 07:29:56 -0400 Received: from mga03.intel.com ([134.134.136.65]:27850 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753421AbcILL3z (ORCPT ); Mon, 12 Sep 2016 07:29:55 -0400 Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga103.jf.intel.com with ESMTP; 12 Sep 2016 04:29:54 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.30,322,1470726000"; d="scan'208";a="1028699898" Received: from black.fi.intel.com ([10.237.72.56]) by orsmga001.jf.intel.com with ESMTP; 12 Sep 2016 04:29:52 -0700 Received: by black.fi.intel.com (Postfix, from userid 1001) id 7004C15A; Mon, 12 Sep 2016 14:29:51 +0300 (EEST) From: Mika Westerberg To: Linus Walleij , Alexandre Courbot Cc: "Rafael J. Wysocki" , Mika Westerberg , linux-acpi@vger.kernel.org, linux-gpio@vger.kernel.org Subject: [PATCH] gpiolib: Forbid irqchip default trigger for ACPI enumerated devices Date: Mon, 12 Sep 2016 14:29:51 +0300 Message-Id: <20160912112951.76598-1-mika.westerberg@linux.intel.com> X-Mailer: git-send-email 2.9.3 Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 Signed-off-by: Mika Westerberg --- This is on top of Marc's patch here: https://lkml.org/lkml/2016/9/7/121 drivers/gpio/gpiolib.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c index 5707b5d12b28..0efb67f387ea 100644 --- a/drivers/gpio/gpiolib.c +++ b/drivers/gpio/gpiolib.c @@ -1618,13 +1618,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;