Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp4745838yba; Wed, 10 Apr 2019 04:09:54 -0700 (PDT) X-Google-Smtp-Source: APXvYqyJkEYMEGoV5aR5wxjWBVaBxtDdUMPe7d/Sv8ITb3WRYlfrqMBrCAN3ugXwyPBy/mvYC9GQ X-Received: by 2002:a17:902:6bc5:: with SMTP id m5mr43069409plt.180.1554894594106; Wed, 10 Apr 2019 04:09:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554894594; cv=none; d=google.com; s=arc-20160816; b=q3nwcNDnZiOL01Mh0TCYwYwknDQDesIdjh5Au+3SdGzNzHpwdkv3jkEvDn+x5srMLl 5lYE5QV0uBxy+Ic4JdXp6Z5bjHnKShK+bvRl1q8WAYONgrziz7+sMG+Cs9hlAdpgZpJh ItLE67nbeGP5iK4rJYeJwnO9ZVtbsrV1yrY54IjuLUdXnDS1q6Aqp0T/0PXbACzH+A6v p1bVNuu8AS9m3NSfCdgxMKC1QQGogZxDo+7+eaftQxS0Gm/OAENCVQRdnUpZII5m0MHl bJc1eGS6P+LZFL/yOqnetv7R69kRSb0UGbx/e5+aytkQR22bDSNoOVza+g/g1epszAaf X6tQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=GVILE8R8DAjFk+mtZD+lfMffupnUYKvNjQR8NU7wMPQ=; b=UfgQziB+K+L6WxRFfS6QeUfMLLn8C/NI8fqdUouAmDMM9GyMcAX0dpSiNl74MEhVjA XR1GMknImTUPghj5E0Y9Nwnlr6VOrqFoauL5ocMR6CAMyUxQAkZkuf4AMrKXZgkx0j3R 1fdD1IxOCeJrKjEqTsrQuFJettMNoh9M5sLVONI5c9hLvXFLPzjt26HmwVItmrNbLiO5 NhYL0llLWtPVls/GE9x2qZuqpSOc2C4Mu4WL3cKpy/btPPjeRJATCmyR9lKct4ZxQKar dMmYaCCmM7K3A4Cl1YIis37siBiDywQQCwHtuWX5tTn6sv7fMOuKmBKk8VlpZD0iD4xR gTKw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 140si31262271pga.460.2019.04.10.04.09.38; Wed, 10 Apr 2019 04:09:54 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730665AbfDJKjw (ORCPT + 99 others); Wed, 10 Apr 2019 06:39:52 -0400 Received: from relay7-d.mail.gandi.net ([217.70.183.200]:46691 "EHLO relay7-d.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727943AbfDJKjw (ORCPT ); Wed, 10 Apr 2019 06:39:52 -0400 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 Cc: Vladimir Zapolskiy , devicetree@vger.kernel.org, linux-gpio@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Alexandre Belloni 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 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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, -- 2.20.1