From patchwork Mon Dec 28 15:00:52 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nikita Shubin X-Patchwork-Id: 352841 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id BD675C433E0 for ; Mon, 28 Dec 2020 15:11:48 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 81635223E8 for ; Mon, 28 Dec 2020 15:11:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2441045AbgL1PLr (ORCPT ); Mon, 28 Dec 2020 10:11:47 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40178 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2408243AbgL1PLO (ORCPT ); Mon, 28 Dec 2020 10:11:14 -0500 X-Greylist: delayed 448 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Mon, 28 Dec 2020 07:10:25 PST Received: from forward104j.mail.yandex.net (forward104j.mail.yandex.net [IPv6:2a02:6b8:0:801:2::107]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 603B2C06179C; Mon, 28 Dec 2020 07:10:25 -0800 (PST) Received: from myt4-e3ad475e0976.qloud-c.yandex.net (myt4-e3ad475e0976.qloud-c.yandex.net [IPv6:2a02:6b8:c12:240b:0:640:e3ad:475e]) by forward104j.mail.yandex.net (Yandex) with ESMTP id 29E934A1251; Mon, 28 Dec 2020 18:02:10 +0300 (MSK) Received: from myt5-ca5ec8faf378.qloud-c.yandex.net (myt5-ca5ec8faf378.qloud-c.yandex.net [2a02:6b8:c12:2514:0:640:ca5e:c8fa]) by myt4-e3ad475e0976.qloud-c.yandex.net (mxback/Yandex) with ESMTP id JEUUKoOEkX-2AHaDoXU; Mon, 28 Dec 2020 18:02:10 +0300 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=maquefel.me; s=mail; t=1609167730; bh=8rF2MWGAOEsWs06S9iHqzALnLEi1PQMJ8OPtBzR9Nqs=; h=Date:Subject:To:From:Message-Id:Cc; b=B6fKFPSvKV6fwY6lhdpbE2UvTRig+gCaW1QNNAJIgwjz/s2lRVw9kXSfO+ijUnSPE pqMK1SxqvVhqYzBEWrrxyPBuXdg/tFgC+FqYxwBBNcRA5sPcwlQnCHlFWSkaa/Hxct geFarzIYTgG2s/AUS90cDwPM8lUMXGvm06FCjFzw= Authentication-Results: myt4-e3ad475e0976.qloud-c.yandex.net; dkim=pass header.i=@maquefel.me Received: by myt5-ca5ec8faf378.qloud-c.yandex.net (smtp/Yandex) with ESMTPSA id ZBhtlKloNv-29JGqOcW; Mon, 28 Dec 2020 18:02:09 +0300 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client certificate not present) From: Nikita Shubin Cc: Nikita Shubin , Linus Walleij , Bartosz Golaszewski , Grygorii Strashko , Thierry Reding , linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] gpiolib: warning on gpiochip->to_irq defined Date: Mon, 28 Dec 2020 18:00:52 +0300 Message-Id: <20201228150052.2633-1-nikita.shubin@maquefel.me> X-Mailer: git-send-email 2.29.2 MIME-Version: 1.0 To: unlisted-recipients:; (no To-header on input) Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org gpiochip->to_irq method is redefined in gpiochip_add_irqchip. A lot of gpiod driver's still define ->to_irq method, let's give a gentle warning that they can no longer rely on it, so they can remove it on ocassion. Fixes: e0d8972898139 ("gpio: Implement tighter IRQ chip integration") Signed-off-by: Nikita Shubin Reviewed-by: Alexander Sverdlin Reviewed-by: Alexander Sverdlin Acked-by: Alexander Sverdlin Reviewed-by: Linus Walleij Reviewed-by: Linus Walleij --- drivers/gpio/gpiolib.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c index 5ce0c14c637b..44538d1a771a 100644 --- a/drivers/gpio/gpiolib.c +++ b/drivers/gpio/gpiolib.c @@ -1489,6 +1489,9 @@ static int gpiochip_add_irqchip(struct gpio_chip *gc, type = IRQ_TYPE_NONE; } + if (gc->to_irq) + chip_err(gc, "to_irq is redefined in %s and you shouldn't rely on it\n", __func__); + gc->to_irq = gpiochip_to_irq; gc->irq.default_type = type; gc->irq.lock_key = lock_key; From patchwork Wed Jan 27 10:46:11 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nikita Shubin X-Patchwork-Id: 371896 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 33202C433E0 for ; Wed, 27 Jan 2021 10:56:49 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id EE3A820780 for ; Wed, 27 Jan 2021 10:56:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236053AbhA0K4q (ORCPT ); Wed, 27 Jan 2021 05:56:46 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53166 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236217AbhA0Ks1 (ORCPT ); Wed, 27 Jan 2021 05:48:27 -0500 Received: from forward104j.mail.yandex.net (forward104j.mail.yandex.net [IPv6:2a02:6b8:0:801:2::107]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9E886C06174A; Wed, 27 Jan 2021 02:48:12 -0800 (PST) Received: from iva6-c549df431312.qloud-c.yandex.net (iva6-c549df431312.qloud-c.yandex.net [IPv6:2a02:6b8:c0c:611f:0:640:c549:df43]) by forward104j.mail.yandex.net (Yandex) with ESMTP id 7B0E04A343A; Wed, 27 Jan 2021 13:46:30 +0300 (MSK) Received: from iva6-2d18925256a6.qloud-c.yandex.net (iva6-2d18925256a6.qloud-c.yandex.net [2a02:6b8:c0c:7594:0:640:2d18:9252]) by iva6-c549df431312.qloud-c.yandex.net (mxback/Yandex) with ESMTP id bBxsaB1Qxs-kUGGk9Ff; Wed, 27 Jan 2021 13:46:30 +0300 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=maquefel.me; s=mail; t=1611744390; bh=j90hgJ/glY5iXUpLlIe5dqmuAis8qn4vOWe+6aan5l4=; h=In-Reply-To:References:Date:Subject:To:From:Message-Id:Cc; b=bP/dZ1oJ1XQd8tecCOstElH3GUsRTIttLLitkQxhIK7H7Y6+gsCMO++51Vj0O1aE7 h5uAkX3QevOoQ4JvSvYkZVZVu61MkkZfWLD9JgfOFNYeHgFjtAZSOMj+Iz34fzLFan uG+ym5IQ5kTkmNJAzSBrC0IXHjdVzx8ldn8x128E= Authentication-Results: iva6-c549df431312.qloud-c.yandex.net; dkim=pass header.i=@maquefel.me Received: by iva6-2d18925256a6.qloud-c.yandex.net (smtp/Yandex) with ESMTPSA id AUuDuROonk-kTm8GXSQ; Wed, 27 Jan 2021 13:46:29 +0300 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client certificate not present) From: Nikita Shubin Cc: Andy Shevchenko , Nikita Shubin , Linus Walleij , Bartosz Golaszewski , Alexander Sverdlin , linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 3/9] gpio: ep93xx: Fix wrong irq numbers in port F Date: Wed, 27 Jan 2021 13:46:11 +0300 Message-Id: <20210127104617.1173-4-nikita.shubin@maquefel.me> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210127104617.1173-1-nikita.shubin@maquefel.me> References: <20201228150052.2633-1-nikita.shubin@maquefel.me> <20210127104617.1173-1-nikita.shubin@maquefel.me> MIME-Version: 1.0 To: unlisted-recipients:; (no To-header on input) Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org Port F irq's should be statically mapped to EP93XX_GPIO_F_IRQ_BASE. So we need to specify girq->first otherwise: "If device tree is used, then first_irq will be 0 and irqs get mapped dynamically on the fly" And that's not the thing we want. Signed-off-by: Nikita Shubin Acked-by: Alexander Sverdlin --- drivers/gpio/gpio-ep93xx.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/gpio/gpio-ep93xx.c b/drivers/gpio/gpio-ep93xx.c index 2eea02c906e0..9c3d049e5af7 100644 --- a/drivers/gpio/gpio-ep93xx.c +++ b/drivers/gpio/gpio-ep93xx.c @@ -430,6 +430,7 @@ static int ep93xx_gpio_add_bank(struct gpio_chip *gc, girq->default_type = IRQ_TYPE_NONE; girq->handler = handle_level_irq; gc->to_irq = ep93xx_gpio_f_to_irq; + girq->first = EP93XX_GPIO_F_IRQ_BASE; } return devm_gpiochip_add_data(dev, gc, epg); From patchwork Wed Jan 27 10:46:12 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nikita Shubin X-Patchwork-Id: 371895 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B7468C433E0 for ; Wed, 27 Jan 2021 11:17:01 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 7542320729 for ; Wed, 27 Jan 2021 11:17:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236437AbhA0LQ7 (ORCPT ); Wed, 27 Jan 2021 06:16:59 -0500 Received: from forward105p.mail.yandex.net ([77.88.28.108]:46567 "EHLO forward105p.mail.yandex.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235819AbhA0KsL (ORCPT ); Wed, 27 Jan 2021 05:48:11 -0500 Received: from iva4-f37646ae0ac9.qloud-c.yandex.net (iva4-f37646ae0ac9.qloud-c.yandex.net [IPv6:2a02:6b8:c0c:129b:0:640:f376:46ae]) by forward105p.mail.yandex.net (Yandex) with ESMTP id 69BD94D40536; Wed, 27 Jan 2021 13:46:31 +0300 (MSK) Received: from iva6-2d18925256a6.qloud-c.yandex.net (iva6-2d18925256a6.qloud-c.yandex.net [2a02:6b8:c0c:7594:0:640:2d18:9252]) by iva4-f37646ae0ac9.qloud-c.yandex.net (mxback/Yandex) with ESMTP id xs0kKcIVQu-kVGSt2VN; Wed, 27 Jan 2021 13:46:31 +0300 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=maquefel.me; s=mail; t=1611744391; bh=BYLI0uaOO2NhX0FCc/Twqb9p7Ic5Pl5n2ndNJuC6t8o=; h=In-Reply-To:References:Date:Subject:To:From:Message-Id:Cc; b=k6h5YjVlVLfSCY2172+sWmMJSCYvTO3Fqo7mWw02iHI74PcUeCciRUgBKrx+z+UdB PQ2vZypJnUDr9cGZ84xUn2XseqWLFfB07SdM04vl84nKBT942bpZ0QZh/LE6WiIiiC n+5kzNPnpkQEPQB8lZ5mfGsQgIYz9zlJE4gIWQQk= Authentication-Results: iva4-f37646ae0ac9.qloud-c.yandex.net; dkim=pass header.i=@maquefel.me Received: by iva6-2d18925256a6.qloud-c.yandex.net (smtp/Yandex) with ESMTPSA id AUuDuROonk-kUm8BALV; Wed, 27 Jan 2021 13:46:30 +0300 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client certificate not present) From: Nikita Shubin Cc: Andy Shevchenko , Nikita Shubin , Linus Walleij , Bartosz Golaszewski , Alexander Sverdlin , linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 4/9] gpio: ep93xx: drop to_irq binding Date: Wed, 27 Jan 2021 13:46:12 +0300 Message-Id: <20210127104617.1173-5-nikita.shubin@maquefel.me> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210127104617.1173-1-nikita.shubin@maquefel.me> References: <20201228150052.2633-1-nikita.shubin@maquefel.me> <20210127104617.1173-1-nikita.shubin@maquefel.me> MIME-Version: 1.0 To: unlisted-recipients:; (no To-header on input) Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org As ->to_irq is redefined in gpiochip_add_irqchip, having it defined in driver is useless, so let's drop it. Signed-off-by: Nikita Shubin Reviewed-by: Alexander Sverdlin --- drivers/gpio/gpio-ep93xx.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/drivers/gpio/gpio-ep93xx.c b/drivers/gpio/gpio-ep93xx.c index 9c3d049e5af7..dee19372ebbd 100644 --- a/drivers/gpio/gpio-ep93xx.c +++ b/drivers/gpio/gpio-ep93xx.c @@ -337,11 +337,6 @@ static int ep93xx_gpio_set_config(struct gpio_chip *gc, unsigned offset, return 0; } -static int ep93xx_gpio_f_to_irq(struct gpio_chip *gc, unsigned offset) -{ - return EP93XX_GPIO_F_IRQ_BASE + offset; -} - static void ep93xx_init_irq_chips(struct ep93xx_gpio *epg) { int i; @@ -429,7 +424,6 @@ static int ep93xx_gpio_add_bank(struct gpio_chip *gc, } girq->default_type = IRQ_TYPE_NONE; girq->handler = handle_level_irq; - gc->to_irq = ep93xx_gpio_f_to_irq; girq->first = EP93XX_GPIO_F_IRQ_BASE; }