From patchwork Wed Apr 10 10:39:24 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexandre Belloni X-Patchwork-Id: 10893593 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id DC33D13B5 for ; Wed, 10 Apr 2019 10:39:59 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C21F328691 for ; Wed, 10 Apr 2019 10:39:59 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B634F286D4; Wed, 10 Apr 2019 10:39:59 +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=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 6B2F328691 for ; Wed, 10 Apr 2019 10:39:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=1alsXZxhW7gnkI4LCcxOsKW1SqeeNbQYS4PQUy8yCdc=; b=EZj4GLbJZWLjJM wi0ZDBykdTLztpZlB8kdPoVvLZ/ghBmFTVZnmsBP4gmjS94PT4XPNLFuphoL8ZOd1Jjrdk6cEb1YA ERKPjQBNVsVnf5JHYKWSrRaejSznlXBz74O5zUtFKokVTztSXxiqCocjD0knci0ry40jAORwYtDA0 gZMrQGZvG6jd1sajK4pzt4SXu7nUSxi7nCHNfyAdQ5+4+CMj6nWfOgQQ7AesJ/R3Rl5vdsYNaZELW Gl1FE7wewSHUmoyvCKP+W0ITJPF6c3atMcWA1upr5HCuDrdYAiJ6s6t4jA7c0r2JSh3G14IiDQrqn yRxJ15nvkDm0UGlWkRHQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1hEAe5-0005AX-7Z; Wed, 10 Apr 2019 10:39:57 +0000 Received: from relay11.mail.gandi.net ([217.70.178.231]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1hEAdv-00053F-WA for linux-arm-kernel@lists.infradead.org; Wed, 10 Apr 2019 10:39:49 +0000 Received: from localhost (alyon-652-1-42-177.w109-213.abo.wanadoo.fr [109.213.33.177]) (Authenticated sender: alexandre.belloni@bootlin.com) by relay11.mail.gandi.net (Postfix) with ESMTPSA id 725D3100008; Wed, 10 Apr 2019 10:39:41 +0000 (UTC) From: Alexandre Belloni To: Linus Walleij , Bartosz Golaszewski Subject: [PATCH 1/3] dt-bindings: gpio: lpc32xx: document interrupt bindings Date: Wed, 10 Apr 2019 12:39:24 +0200 Message-Id: <20190410103926.8781-2-alexandre.belloni@bootlin.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190410103926.8781-1-alexandre.belloni@bootlin.com> References: <20190410103926.8781-1-alexandre.belloni@bootlin.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190410_033948_180613_3BBC0F90 X-CRM114-Status: UNSURE ( 7.25 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, Alexandre Belloni , linux-kernel@vger.kernel.org, Vladimir Zapolskiy , linux-gpio@vger.kernel.org, Rob Herring , linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Some of the LPC32xx gpios are wired directly to one of the interrupt controllers while port 0 and port 1 share the same interrupt for their interrupt capable gpios. Cc: Rob Herring Signed-off-by: Alexandre Belloni --- Documentation/devicetree/bindings/gpio/gpio_lpc32xx.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Documentation/devicetree/bindings/gpio/gpio_lpc32xx.txt b/Documentation/devicetree/bindings/gpio/gpio_lpc32xx.txt index 49819367a011..e7957a17e4db 100644 --- a/Documentation/devicetree/bindings/gpio/gpio_lpc32xx.txt +++ b/Documentation/devicetree/bindings/gpio/gpio_lpc32xx.txt @@ -16,6 +16,10 @@ Required properties: 3) optional parameters: - bit 0 specifies polarity (0 for normal, 1 for inverted) - reg: Index of the GPIO group +- interrupts: Should be the interrupt shared by port 0 and port 1 and the + interrupts for individual pins from port 3. +- interrupt-names : Should be the names of irq resources. The shared port + interrupt is named "p01", the other use the pin names. Example: From patchwork Wed Apr 10 10:39:25 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexandre Belloni X-Patchwork-Id: 10893597 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C9E341515 for ; Wed, 10 Apr 2019 10:40:22 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AF14F289E5 for ; Wed, 10 Apr 2019 10:40:22 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A38AD289F6; Wed, 10 Apr 2019 10:40:22 +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=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 52996289E5 for ; Wed, 10 Apr 2019 10:40:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=JZF190vxq+nFjm7bYju/leXlDl2qHTrGrWC99lBCZE8=; b=IDv91kcGDXCIew Kb1XTYWoetx5deuvZwSrE76p/o3QAYrW3PNgxnGf6b7iKwD5fFiObbE99BdlKGDTCdzCl0g4I5W9x jbbocB3oxT8xKoNUjc3MlHEbxRgFxHOYPnsFfw3Sd/aEjCPn69OUxG+y2t/7hT6GN5DE/oMLEFSvt Omq78Fqd2mY6LQYsexAqSwcIpTmFq2r9x66FjQFuBofB9B/D3eYiMcGQuJaCANDC9iY84o++YYcc7 HQ0nHSg3RkUw2p9iUEiIT/cIwf+9v8cuFTnCCg2gGnyxQMQEBddksa+ED6VDXTXaL+u3rM4HmwvhD lHXtYvDin3CsPZFZXJuw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1hEAeS-0006pI-Gq; Wed, 10 Apr 2019 10:40:20 +0000 Received: from relay7-d.mail.gandi.net ([217.70.183.200]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1hEAe5-0005AD-5h for linux-arm-kernel@lists.infradead.org; Wed, 10 Apr 2019 10:40:09 +0000 X-Originating-IP: 109.213.33.177 Received: from localhost (alyon-652-1-42-177.w109-213.abo.wanadoo.fr [109.213.33.177]) (Authenticated sender: alexandre.belloni@bootlin.com) by relay7-d.mail.gandi.net (Postfix) with ESMTPSA id 836392000E; Wed, 10 Apr 2019 10:39:46 +0000 (UTC) From: Alexandre Belloni To: Linus Walleij , Bartosz Golaszewski Subject: [PATCH 2/3] gpio: lpc32xx: enable interrupt lookup for port 3 Date: Wed, 10 Apr 2019 12:39:25 +0200 Message-Id: <20190410103926.8781-3-alexandre.belloni@bootlin.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190410103926.8781-1-alexandre.belloni@bootlin.com> References: <20190410103926.8781-1-alexandre.belloni@bootlin.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190410_033957_884820_A29918C2 X-CRM114-Status: GOOD ( 11.53 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, Alexandre Belloni , linux-kernel@vger.kernel.org, Vladimir Zapolskiy , linux-gpio@vger.kernel.org, linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Interrupt support was disabled "temporarily" in commit 320a6480ef24 ("gpio: lpc32xx: disable broken to_irq support"). Reenable to_irq for port 3 as they are directly connected to an interrupt controller and a simple lookup is working. Signed-off-by: Alexandre Belloni --- drivers/gpio/gpio-lpc32xx.c | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/drivers/gpio/gpio-lpc32xx.c b/drivers/gpio/gpio-lpc32xx.c index aa74cc4d8b14..24f09b08e319 100644 --- a/drivers/gpio/gpio-lpc32xx.c +++ b/drivers/gpio/gpio-lpc32xx.c @@ -22,6 +22,7 @@ #include #include #include +#include #include #include @@ -385,14 +386,9 @@ static int lpc32xx_gpio_to_irq_p01(struct gpio_chip *chip, unsigned offset) return -ENXIO; } -static int lpc32xx_gpio_to_irq_gpio_p3(struct gpio_chip *chip, unsigned offset) +static int lpc32xx_gpio_to_irq_p3(struct gpio_chip *chip, unsigned int offset) { - return -ENXIO; -} - -static int lpc32xx_gpio_to_irq_gpi_p3(struct gpio_chip *chip, unsigned offset) -{ - return -ENXIO; + return of_irq_get_byname(chip->of_node, chip->names[offset]); } static struct lpc32xx_gpio_chip lpc32xx_gpiochip[] = { @@ -451,7 +447,7 @@ static struct lpc32xx_gpio_chip lpc32xx_gpiochip[] = { .direction_output = lpc32xx_gpio_dir_output_p3, .set = lpc32xx_gpio_set_value_p3, .request = lpc32xx_gpio_request, - .to_irq = lpc32xx_gpio_to_irq_gpio_p3, + .to_irq = lpc32xx_gpio_to_irq_p3, .base = LPC32XX_GPIO_P3_GRP, .ngpio = LPC32XX_GPIO_P3_MAX, .names = gpio_p3_names, @@ -465,7 +461,7 @@ static struct lpc32xx_gpio_chip lpc32xx_gpiochip[] = { .direction_input = lpc32xx_gpio_dir_in_always, .get = lpc32xx_gpi_get_value, .request = lpc32xx_gpio_request, - .to_irq = lpc32xx_gpio_to_irq_gpi_p3, + .to_irq = lpc32xx_gpio_to_irq_p3, .base = LPC32XX_GPI_P3_GRP, .ngpio = LPC32XX_GPI_P3_MAX, .names = gpi_p3_names, From patchwork Wed Apr 10 10:39:26 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexandre Belloni X-Patchwork-Id: 10893599 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 1803413B5 for ; Wed, 10 Apr 2019 10:40:38 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F13D1289DD for ; Wed, 10 Apr 2019 10:40:37 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E59C3289E8; Wed, 10 Apr 2019 10:40:37 +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=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id A6ED1289DD for ; Wed, 10 Apr 2019 10:40:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=9ZRVoVn7q/6CuuUgHCIYqgYS6BwRc1kcttIldBgk1+k=; b=O3G75sNaSJMZH1 6ol9sIYtwJFCoURZVreew6IrwEvCW33IYoDLjeDL2xz6SwKGnL8hIsyVLEjhHsK1WOGASbjQeRAga wJCu7wSQFTsJog2ZIR4dOsHlNFoaxNoHq6A0S+1N75GlFciWfJkcNCc+5mxiioVp6ENPwm4N3DJ8I a3Gcnr0qC3N20tHxbNLi0Q1lOmgVBmug4xH1QCwWAIOlGfwsBwZBf7QBGtZ4XRvvc44/6EGKLSoge 2cYAolEeqw8AbKh6tBUY2hyNIJILxMbu7GeUwg7JE1H21oxvVKhvls/fyJqUAP6S7A1CNIunoUZws gMIbI1xsSJNfjYauNQaw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1hEAec-0006y8-2l; Wed, 10 Apr 2019 10:40:30 +0000 Received: from relay7-d.mail.gandi.net ([217.70.183.200]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1hEAe6-0005E7-Fi for linux-arm-kernel@lists.infradead.org; Wed, 10 Apr 2019 10:40:09 +0000 X-Originating-IP: 109.213.33.177 Received: from localhost (alyon-652-1-42-177.w109-213.abo.wanadoo.fr [109.213.33.177]) (Authenticated sender: alexandre.belloni@bootlin.com) by relay7-d.mail.gandi.net (Postfix) with ESMTPSA id 41D7020010; Wed, 10 Apr 2019 10:39:54 +0000 (UTC) From: Alexandre Belloni To: Linus Walleij , Bartosz Golaszewski Subject: [PATCH 3/3] ARM: dts: lpc32xx: add GPIO interrupts Date: Wed, 10 Apr 2019 12:39:26 +0200 Message-Id: <20190410103926.8781-4-alexandre.belloni@bootlin.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190410103926.8781-1-alexandre.belloni@bootlin.com> References: <20190410103926.8781-1-alexandre.belloni@bootlin.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190410_033959_413458_B966B56B X-CRM114-Status: UNSURE ( 8.71 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, Alexandre Belloni , linux-kernel@vger.kernel.org, Vladimir Zapolskiy , linux-gpio@vger.kernel.org, linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Add the interrupts for the GPIO controller. Signed-off-by: Alexandre Belloni --- arch/arm/boot/dts/lpc32xx.dtsi | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/arch/arm/boot/dts/lpc32xx.dtsi b/arch/arm/boot/dts/lpc32xx.dtsi index 20b38f4ade37..9c61b1856291 100644 --- a/arch/arm/boot/dts/lpc32xx.dtsi +++ b/arch/arm/boot/dts/lpc32xx.dtsi @@ -392,6 +392,31 @@ reg = <0x40028000 0x1000>; gpio-controller; #gpio-cells = <3>; /* bank, pin, flags */ + interrupts-extended = <&sic2 8 IRQ_TYPE_NONE>, + <&sic2 22 IRQ_TYPE_NONE>, + <&sic2 23 IRQ_TYPE_NONE>, + <&sic2 24 IRQ_TYPE_NONE>, + <&sic2 25 IRQ_TYPE_NONE>, + <&sic2 26 IRQ_TYPE_NONE>, + <&sic2 27 IRQ_TYPE_NONE>, + <&sic2 28 IRQ_TYPE_NONE>, + <&sic2 15 IRQ_TYPE_NONE>, + <&sic2 9 IRQ_TYPE_NONE>, + <&sic2 10 IRQ_TYPE_NONE>, + <&sic1 4 IRQ_TYPE_NONE>, + <&sic2 0 IRQ_TYPE_NONE>, + <&sic2 1 IRQ_TYPE_NONE>, + <&sic2 2 IRQ_TYPE_NONE>, + <&sic2 3 IRQ_TYPE_NONE>, + <&sic2 4 IRQ_TYPE_NONE>, + <&sic2 5 IRQ_TYPE_NONE>; + interrupt-names = "p01", + "gpi00", "gpi01", "gpi02", + "gpi03", "gpi04", "gpi05", + "gpi06", "gpi07", "gpi08", + "gpi09", "gpi19", "gpi28", + "gpio00", "gpio01", "gpio02", + "gpio03", "gpio04", "gpio05"; }; timer4: timer@4002c000 {