From patchwork Wed Feb 8 17:33:26 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 13133406 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3DD35C74A5B for ; Wed, 8 Feb 2023 17:34:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231953AbjBHReI (ORCPT ); Wed, 8 Feb 2023 12:34:08 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39668 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231791AbjBHReC (ORCPT ); Wed, 8 Feb 2023 12:34:02 -0500 Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8C9043EFD7; Wed, 8 Feb 2023 09:33:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1675877639; x=1707413639; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=jEiPyYdsZVsJV2pdec9rr5rbdBbMyx922ioXFsE3FmA=; b=GgPQWj61joidJSlNP80475DZ9KMe9zfLScnJh9f0uKMywqb/afYb1UJ1 MgFjVkQkHuIqRmXmwsmJPLISal9lm/fcLCSDxgXMfgQW9KwLey48xkTTX sBLM+YR0fYHS3V0/lAPVFHrQ2fmBO0BDQdbdbbgkubtF/vPuiTqu91MGh bMOcw7xjLMaaa9Pjm8nLXoOyqdm2H/lHoMq54PDxc48WtO3P+IIrjttji jToxr+fGai8UaAYga6zaNLnxZaG6csxCzEOF0BvP9W+HmL7MYvb+CMad8 mW+Wt5D574ifql4IJecu0x3Gu/QEkNWHVAj/lWmkX+ml9QLYpGzOgn6If Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10615"; a="310225189" X-IronPort-AV: E=Sophos;i="5.97,281,1669104000"; d="scan'208";a="310225189" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Feb 2023 09:33:14 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10615"; a="697722954" X-IronPort-AV: E=Sophos;i="5.97,281,1669104000"; d="scan'208";a="697722954" Received: from black.fi.intel.com ([10.237.72.28]) by orsmga008.jf.intel.com with ESMTP; 08 Feb 2023 09:33:08 -0800 Received: by black.fi.intel.com (Postfix, from userid 1003) id 76D751C5; Wed, 8 Feb 2023 19:33:47 +0200 (EET) From: Andy Shevchenko To: Andy Shevchenko , Arnd Bergmann , Linus Walleij , Bartosz Golaszewski , Tony Lindgren , Thomas Gleixner , Krzysztof Kozlowski , Geert Uytterhoeven , Michael Ellerman , Christophe Leroy , Vincenzo Palazzo , Devarsh Thakkar , Michael Walle , Dmitry Torokhov , Dipen Patel , Thierry Reding , Stefan Schmidt , Miquel Raynal , Lee Jones , linux-gpio@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-doc-tw-discuss@lists.sourceforge.net, linux-arm-kernel@lists.infradead.org, linux-omap@vger.kernel.org, linux-samsung-soc@vger.kernel.org, linux-m68k@lists.linux-m68k.org, linuxppc-dev@lists.ozlabs.org, linux-sh@vger.kernel.org, linux-acpi@vger.kernel.org, linux-tegra@vger.kernel.org, linux-input@vger.kernel.org, linux-media@vger.kernel.org, linux-wpan@vger.kernel.org, netdev@vger.kernel.org, linux-wireless@vger.kernel.org, brcm80211-dev-list.pdl@broadcom.com, SHA-cyfmac-dev-list@infineon.com, linux-arch@vger.kernel.org, devicetree@vger.kernel.org Cc: Bartosz Golaszewski , Jonathan Corbet , Alex Shi , Yanteng Si , Hu Haowen , Russell King , Aaro Koskinen , Janusz Krzysztofik , Andrew Lunn , Sebastian Hesselbarth , Gregory Clement , Alim Akhtar , Nicholas Piggin , Yoshinori Sato , Rich Felker , Mun Yew Tham , Keerthy , Mika Westerberg , Thierry Reding , Jonathan Hunter , Mauro Carvalho Chehab , Alexander Aring , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Arend van Spriel , Franky Lin , Hante Meuleman , Kalle Valo , Qiang Zhao , Li Yang , Rob Herring , Frank Rowand Subject: [PATCH v4 01/18] ARM: orion/gpio: Use the right include Date: Wed, 8 Feb 2023 19:33:26 +0200 Message-Id: <20230208173343.37582-2-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230208173343.37582-1-andriy.shevchenko@linux.intel.com> References: <20230208173343.37582-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org From: Linus Walleij This is a GPIO driver so include and not the legacy header. Switch a single call to the legacy API and use as well. Signed-off-by: Linus Walleij Signed-off-by: Andy Shevchenko --- arch/arm/plat-orion/gpio.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/arch/arm/plat-orion/gpio.c b/arch/arm/plat-orion/gpio.c index 3ef9ecdd6343..595e9cb33c1d 100644 --- a/arch/arm/plat-orion/gpio.c +++ b/arch/arm/plat-orion/gpio.c @@ -18,7 +18,8 @@ #include #include #include -#include +#include +#include #include #include #include @@ -312,7 +313,7 @@ int orion_gpio_led_blink_set(struct gpio_desc *desc, int state, case GPIO_LED_NO_BLINK_LOW: case GPIO_LED_NO_BLINK_HIGH: orion_gpio_set_blink(gpio, 0); - gpio_set_value(gpio, state); + gpiod_set_raw_value(desc, state); break; case GPIO_LED_BLINK: orion_gpio_set_blink(gpio, 1); From patchwork Wed Feb 8 17:33:27 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 13133408 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 75837C6FA9D for ; Wed, 8 Feb 2023 17:34:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231991AbjBHReM (ORCPT ); Wed, 8 Feb 2023 12:34:12 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39754 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231913AbjBHReF (ORCPT ); Wed, 8 Feb 2023 12:34:05 -0500 Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 96ADF3251B; Wed, 8 Feb 2023 09:34:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1675877641; x=1707413641; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=bloKEk7wdB/KAamzH2f498CjQ4BYd7MQyp/8x7HupR0=; b=ndMqj0wLWnynraZ4MaSqQjmWUqDE9EKatFTzXOej52AbdsLmzrSeNx20 aUbcIyl9ImbCOVXwlKr2v9maSlZ95f1685hEjERnKz90rTozgd7IZ3LA2 VBdx6PMyPjpmzMtZNJW4hoZRsmMt2iJg888nMlvb/M6Q2Le50JGJpTduM ejGAQTgVythJgG/WxpPKsY6CDVUXa6EluO/z36jEVP5qZBhgMoIpZjisu zhQQOt0Z7AnpH9csGO6juefQ0XASW7A0/OMx6p3ENt4OhxoDwmqBOeJd2 hmf/tQW0BlcBluExU+R79G9TnunPJrvN06XyRrkA6Fg0HHj6RRcU4dXgf g==; X-IronPort-AV: E=McAfee;i="6500,9779,10615"; a="310225283" X-IronPort-AV: E=Sophos;i="5.97,281,1669104000"; d="scan'208";a="310225283" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Feb 2023 09:33:21 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10615"; a="697722976" X-IronPort-AV: E=Sophos;i="5.97,281,1669104000"; d="scan'208";a="697722976" Received: from black.fi.intel.com ([10.237.72.28]) by orsmga008.jf.intel.com with ESMTP; 08 Feb 2023 09:33:15 -0800 Received: by black.fi.intel.com (Postfix, from userid 1003) id 8B16F1F8; Wed, 8 Feb 2023 19:33:47 +0200 (EET) From: Andy Shevchenko To: Andy Shevchenko , Arnd Bergmann , Linus Walleij , Bartosz Golaszewski , Tony Lindgren , Thomas Gleixner , Krzysztof Kozlowski , Geert Uytterhoeven , Michael Ellerman , Christophe Leroy , Vincenzo Palazzo , Devarsh Thakkar , Michael Walle , Dmitry Torokhov , Dipen Patel , Thierry Reding , Stefan Schmidt , Miquel Raynal , Lee Jones , linux-gpio@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-doc-tw-discuss@lists.sourceforge.net, linux-arm-kernel@lists.infradead.org, linux-omap@vger.kernel.org, linux-samsung-soc@vger.kernel.org, linux-m68k@lists.linux-m68k.org, linuxppc-dev@lists.ozlabs.org, linux-sh@vger.kernel.org, linux-acpi@vger.kernel.org, linux-tegra@vger.kernel.org, linux-input@vger.kernel.org, linux-media@vger.kernel.org, linux-wpan@vger.kernel.org, netdev@vger.kernel.org, linux-wireless@vger.kernel.org, brcm80211-dev-list.pdl@broadcom.com, SHA-cyfmac-dev-list@infineon.com, linux-arch@vger.kernel.org, devicetree@vger.kernel.org Cc: Bartosz Golaszewski , Jonathan Corbet , Alex Shi , Yanteng Si , Hu Haowen , Russell King , Aaro Koskinen , Janusz Krzysztofik , Andrew Lunn , Sebastian Hesselbarth , Gregory Clement , Alim Akhtar , Nicholas Piggin , Yoshinori Sato , Rich Felker , Mun Yew Tham , Keerthy , Mika Westerberg , Thierry Reding , Jonathan Hunter , Mauro Carvalho Chehab , Alexander Aring , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Arend van Spriel , Franky Lin , Hante Meuleman , Kalle Valo , Qiang Zhao , Li Yang , Rob Herring , Frank Rowand Subject: [PATCH v4 02/18] ARM: s3c24xx: Use the right include Date: Wed, 8 Feb 2023 19:33:27 +0200 Message-Id: <20230208173343.37582-3-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230208173343.37582-1-andriy.shevchenko@linux.intel.com> References: <20230208173343.37582-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org From: Linus Walleij The file s3c64xx.c is including despite using no symbols from the file, however it needs it to implicitly bring in of_have_populated_dt() so include explicitly instead. Signed-off-by: Linus Walleij Signed-off-by: Andy Shevchenko Acked-by: Krzysztof Kozlowski --- arch/arm/mach-s3c/s3c64xx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm/mach-s3c/s3c64xx.c b/arch/arm/mach-s3c/s3c64xx.c index e97bd59083a8..9f9717874d67 100644 --- a/arch/arm/mach-s3c/s3c64xx.c +++ b/arch/arm/mach-s3c/s3c64xx.c @@ -21,13 +21,13 @@ #include #include #include +#include #include #include #include #include #include #include -#include #include #include From patchwork Wed Feb 8 17:33:28 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 13133409 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 58413C6FD1A for ; Wed, 8 Feb 2023 17:34:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232006AbjBHReO (ORCPT ); Wed, 8 Feb 2023 12:34:14 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39762 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231912AbjBHReF (ORCPT ); Wed, 8 Feb 2023 12:34:05 -0500 Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4E26F485B7; Wed, 8 Feb 2023 09:34:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1675877642; x=1707413642; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=4IQLDrOahYJ8lFlzrwNEYRM9qJTE1X0tQcaYGhsJEHc=; b=G2Ko6LLEX419EYXpdWaN8RhlyDnSogCqqhneGWnR2JAwN2RFyqDNHUDI rN1ajcGYE5yfWTt6trWdCVWJm28p3xUt1m0UBsEjsElQw3NJfoDXbaTpT w0zI3lhnm2+j6yUlWucFcTZ345Hh6o1MJpOzb1WXVDPb0gQPgsrncN6j6 GlzouI9RtGDe+qv280oaHs/fRMoI9HLhgnuA6D+aK5IOfYVKq7boyu4Zz by00KfscW3lKUEvpUVH7SOfU9HzS168qOVBtfWT/RPqVLlNHNCHpImf7I AQR2TlKJvvFWDFLulGgORzUDErVCruG+g+ORPef1JRE9RcJNtyrf5jhhD g==; X-IronPort-AV: E=McAfee;i="6500,9779,10615"; a="310225303" X-IronPort-AV: E=Sophos;i="5.97,281,1669104000"; d="scan'208";a="310225303" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Feb 2023 09:33:21 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10615"; a="697722979" X-IronPort-AV: E=Sophos;i="5.97,281,1669104000"; d="scan'208";a="697722979" Received: from black.fi.intel.com ([10.237.72.28]) by orsmga008.jf.intel.com with ESMTP; 08 Feb 2023 09:33:15 -0800 Received: by black.fi.intel.com (Postfix, from userid 1003) id 9FC47210; Wed, 8 Feb 2023 19:33:47 +0200 (EET) From: Andy Shevchenko To: Andy Shevchenko , Arnd Bergmann , Linus Walleij , Bartosz Golaszewski , Tony Lindgren , Thomas Gleixner , Krzysztof Kozlowski , Geert Uytterhoeven , Michael Ellerman , Christophe Leroy , Vincenzo Palazzo , Devarsh Thakkar , Michael Walle , Dmitry Torokhov , Dipen Patel , Thierry Reding , Stefan Schmidt , Miquel Raynal , Lee Jones , linux-gpio@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-doc-tw-discuss@lists.sourceforge.net, linux-arm-kernel@lists.infradead.org, linux-omap@vger.kernel.org, linux-samsung-soc@vger.kernel.org, linux-m68k@lists.linux-m68k.org, linuxppc-dev@lists.ozlabs.org, linux-sh@vger.kernel.org, linux-acpi@vger.kernel.org, linux-tegra@vger.kernel.org, linux-input@vger.kernel.org, linux-media@vger.kernel.org, linux-wpan@vger.kernel.org, netdev@vger.kernel.org, linux-wireless@vger.kernel.org, brcm80211-dev-list.pdl@broadcom.com, SHA-cyfmac-dev-list@infineon.com, linux-arch@vger.kernel.org, devicetree@vger.kernel.org Cc: Bartosz Golaszewski , Jonathan Corbet , Alex Shi , Yanteng Si , Hu Haowen , Russell King , Aaro Koskinen , Janusz Krzysztofik , Andrew Lunn , Sebastian Hesselbarth , Gregory Clement , Alim Akhtar , Nicholas Piggin , Yoshinori Sato , Rich Felker , Mun Yew Tham , Keerthy , Mika Westerberg , Thierry Reding , Jonathan Hunter , Mauro Carvalho Chehab , Alexander Aring , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Arend van Spriel , Franky Lin , Hante Meuleman , Kalle Valo , Qiang Zhao , Li Yang , Rob Herring , Frank Rowand Subject: [PATCH v4 03/18] hte: tegra-194: Use proper includes Date: Wed, 8 Feb 2023 19:33:28 +0200 Message-Id: <20230208173343.37582-4-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230208173343.37582-1-andriy.shevchenko@linux.intel.com> References: <20230208173343.37582-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org From: Linus Walleij The test driver uses the gpiod consumer API so include the right header. This may cause a problem with struct of_device_id being implcitly pulled in by the legacy header so include explicitly as well. While at it, drop explicit moduleparam.h (it's included with module.h) and sort the headers. Signed-off-by: Linus Walleij Signed-off-by: Andy Shevchenko Acked-by: Dipen Patel --- drivers/hte/hte-tegra194-test.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/hte/hte-tegra194-test.c b/drivers/hte/hte-tegra194-test.c index 5d776a185bd6..358d4a10c6a1 100644 --- a/drivers/hte/hte-tegra194-test.c +++ b/drivers/hte/hte-tegra194-test.c @@ -6,14 +6,14 @@ */ #include -#include -#include +#include +#include #include -#include -#include +#include +#include #include +#include #include -#include /* * This sample HTE GPIO test driver demonstrates HTE API usage by enabling From patchwork Wed Feb 8 17:33:29 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 13133410 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A51A9C6FD1D for ; Wed, 8 Feb 2023 17:34:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232020AbjBHReQ (ORCPT ); Wed, 8 Feb 2023 12:34:16 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39854 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231941AbjBHReH (ORCPT ); Wed, 8 Feb 2023 12:34:07 -0500 Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6183A4FAE6; Wed, 8 Feb 2023 09:34:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1675877645; x=1707413645; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=5X9ZOcG0DiAszti6VyRB72jA0fVrIX+W6b07WZOwIv4=; b=jdOArBm/4aGFroOoS7y2IZI3LRrZ19IkRuwyHrN/7PARDEVmqMV/4iB2 ACJd9SLhDva7Aew7kLSGRLJh97/RT0lmqy24Xvdo4oyRhv6aW7Ty9l7a5 iWc6+vZLqQgfZisPFIP6/FqosnoASnYViyaR/O+djpvRYNnLd9Y28VZpm r8m6PR17zKwbv/fbMyRNpw6WpLgyAts1n4eoq61KyvlMgeoYpZbQkHRUe k2t3KFDvEfzQOhX9uVL/J6IO+KNgQB+ogP0dS3pm/SwFxrHYOti2Ph8vm bcwnbnJDsxlARxzs0WCTd/fl2PNpE0FU4UUJheG38qbeqxf4yV/H9orM0 g==; X-IronPort-AV: E=McAfee;i="6500,9779,10615"; a="310225334" X-IronPort-AV: E=Sophos;i="5.97,281,1669104000"; d="scan'208";a="310225334" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Feb 2023 09:33:26 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10615"; a="660703921" X-IronPort-AV: E=Sophos;i="5.97,281,1669104000"; d="scan'208";a="660703921" Received: from black.fi.intel.com ([10.237.72.28]) by orsmga007.jf.intel.com with ESMTP; 08 Feb 2023 09:33:20 -0800 Received: by black.fi.intel.com (Postfix, from userid 1003) id B005F252; Wed, 8 Feb 2023 19:33:47 +0200 (EET) From: Andy Shevchenko To: Andy Shevchenko , Arnd Bergmann , Linus Walleij , Bartosz Golaszewski , Tony Lindgren , Thomas Gleixner , Krzysztof Kozlowski , Geert Uytterhoeven , Michael Ellerman , Christophe Leroy , Vincenzo Palazzo , Devarsh Thakkar , Michael Walle , Dmitry Torokhov , Dipen Patel , Thierry Reding , Stefan Schmidt , Miquel Raynal , Lee Jones , linux-gpio@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-doc-tw-discuss@lists.sourceforge.net, linux-arm-kernel@lists.infradead.org, linux-omap@vger.kernel.org, linux-samsung-soc@vger.kernel.org, linux-m68k@lists.linux-m68k.org, linuxppc-dev@lists.ozlabs.org, linux-sh@vger.kernel.org, linux-acpi@vger.kernel.org, linux-tegra@vger.kernel.org, linux-input@vger.kernel.org, linux-media@vger.kernel.org, linux-wpan@vger.kernel.org, netdev@vger.kernel.org, linux-wireless@vger.kernel.org, brcm80211-dev-list.pdl@broadcom.com, SHA-cyfmac-dev-list@infineon.com, linux-arch@vger.kernel.org, devicetree@vger.kernel.org Cc: Bartosz Golaszewski , Jonathan Corbet , Alex Shi , Yanteng Si , Hu Haowen , Russell King , Aaro Koskinen , Janusz Krzysztofik , Andrew Lunn , Sebastian Hesselbarth , Gregory Clement , Alim Akhtar , Nicholas Piggin , Yoshinori Sato , Rich Felker , Mun Yew Tham , Keerthy , Mika Westerberg , Thierry Reding , Jonathan Hunter , Mauro Carvalho Chehab , Alexander Aring , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Arend van Spriel , Franky Lin , Hante Meuleman , Kalle Valo , Qiang Zhao , Li Yang , Rob Herring , Frank Rowand Subject: [PATCH v4 04/18] gpiolib: Make the legacy consumer-only Date: Wed, 8 Feb 2023 19:33:29 +0200 Message-Id: <20230208173343.37582-5-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230208173343.37582-1-andriy.shevchenko@linux.intel.com> References: <20230208173343.37582-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org From: Linus Walleij The legacy header was an all-inclusive header used by drivers and consumers alike. After eliminating the last users of the driver defines, we can drop the inclusion of the header. Signed-off-by: Linus Walleij Signed-off-by: Andy Shevchenko --- include/asm-generic/gpio.h | 1 - 1 file changed, 1 deletion(-) diff --git a/include/asm-generic/gpio.h b/include/asm-generic/gpio.h index 22cb8c9efc1d..1c910d124423 100644 --- a/include/asm-generic/gpio.h +++ b/include/asm-generic/gpio.h @@ -8,7 +8,6 @@ #ifdef CONFIG_GPIOLIB #include -#include #include /* From patchwork Wed Feb 8 17:33:30 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 13133411 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id D3740C64EC7 for ; Wed, 8 Feb 2023 17:34:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232037AbjBHReS (ORCPT ); Wed, 8 Feb 2023 12:34:18 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40082 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231992AbjBHReM (ORCPT ); Wed, 8 Feb 2023 12:34:12 -0500 Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 296094FCD7; Wed, 8 Feb 2023 09:34:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1675877646; x=1707413646; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=t/VM8/VvZGy84HjkdGTixpmW6D3tM4wtEJkqNOFR1p8=; b=WRercOgWRkNUokbpc6Cb00vhkMPLkwssPuQqaPcNjeKT7cX5BGg96mid CtZOKStgsanUebZHk6SWrLw52me6XyuwDrVlZnjDrmNk9e5f4k3/sK77r kN35keTyDQJOqxC9ulfToDk12Q6O5XMzNS+eQp0+UbKot1dQZ1YHePDAo /Ow64xdTX10A4YE3MOUq3PeMB9kTkMl1Y88sxBBtKAg+ev1w+kuy2uNV2 Cppx4ixZmXQWBgrJQbwGNLuFwzP8G/0JMMOsPjlnq4iCpTZqV+bBfioHh fzZMQix5pTcPfGXbXFwhzUC72Uy3xaNg7UX/e+DJQ132U5oi3qwJud60e A==; X-IronPort-AV: E=McAfee;i="6500,9779,10615"; a="310225373" X-IronPort-AV: E=Sophos;i="5.97,281,1669104000"; d="scan'208";a="310225373" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Feb 2023 09:33:27 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10615"; a="660703925" X-IronPort-AV: E=Sophos;i="5.97,281,1669104000"; d="scan'208";a="660703925" Received: from black.fi.intel.com ([10.237.72.28]) by orsmga007.jf.intel.com with ESMTP; 08 Feb 2023 09:33:21 -0800 Received: by black.fi.intel.com (Postfix, from userid 1003) id BFF94269; Wed, 8 Feb 2023 19:33:47 +0200 (EET) From: Andy Shevchenko To: Andy Shevchenko , Arnd Bergmann , Linus Walleij , Bartosz Golaszewski , Tony Lindgren , Thomas Gleixner , Krzysztof Kozlowski , Geert Uytterhoeven , Michael Ellerman , Christophe Leroy , Vincenzo Palazzo , Devarsh Thakkar , Michael Walle , Dmitry Torokhov , Dipen Patel , Thierry Reding , Stefan Schmidt , Miquel Raynal , Lee Jones , linux-gpio@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-doc-tw-discuss@lists.sourceforge.net, linux-arm-kernel@lists.infradead.org, linux-omap@vger.kernel.org, linux-samsung-soc@vger.kernel.org, linux-m68k@lists.linux-m68k.org, linuxppc-dev@lists.ozlabs.org, linux-sh@vger.kernel.org, linux-acpi@vger.kernel.org, linux-tegra@vger.kernel.org, linux-input@vger.kernel.org, linux-media@vger.kernel.org, linux-wpan@vger.kernel.org, netdev@vger.kernel.org, linux-wireless@vger.kernel.org, brcm80211-dev-list.pdl@broadcom.com, SHA-cyfmac-dev-list@infineon.com, linux-arch@vger.kernel.org, devicetree@vger.kernel.org Cc: Bartosz Golaszewski , Jonathan Corbet , Alex Shi , Yanteng Si , Hu Haowen , Russell King , Aaro Koskinen , Janusz Krzysztofik , Andrew Lunn , Sebastian Hesselbarth , Gregory Clement , Alim Akhtar , Nicholas Piggin , Yoshinori Sato , Rich Felker , Mun Yew Tham , Keerthy , Mika Westerberg , Thierry Reding , Jonathan Hunter , Mauro Carvalho Chehab , Alexander Aring , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Arend van Spriel , Franky Lin , Hante Meuleman , Kalle Valo , Qiang Zhao , Li Yang , Rob Herring , Frank Rowand , Geert Uytterhoeven Subject: [PATCH v4 05/18] gpiolib: remove empty asm/gpio.h files Date: Wed, 8 Feb 2023 19:33:30 +0200 Message-Id: <20230208173343.37582-6-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230208173343.37582-1-andriy.shevchenko@linux.intel.com> References: <20230208173343.37582-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org From: Arnd Bergmann The arm and sh versions of this file are identical to the generic versions and can just be removed. The drivers that actually use the sh3 specific version also include cpu/gpio.h directly, with the exception of magicpanelr2, which is easily fixed. This leaves coldfire as the only gpio driver that needs something custom for gpiolib. Reviewed-by: Geert Uytterhoeven Reviewed-by: Andy Shevchenko Acked-by: Bartosz Golaszewski Signed-off-by: Arnd Bergmann Reviewed-by: Linus Walleij Signed-off-by: Andy Shevchenko Reviewed-by: Vincenzo Palazzo --- arch/arm/Kconfig | 1 - arch/arm/include/asm/gpio.h | 21 -------------- arch/sh/Kconfig | 1 - arch/sh/boards/board-magicpanelr2.c | 1 + arch/sh/include/asm/gpio.h | 45 ----------------------------- 5 files changed, 1 insertion(+), 68 deletions(-) delete mode 100644 arch/arm/include/asm/gpio.h delete mode 100644 arch/sh/include/asm/gpio.h diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index e24a9820e12f..1d1a603d964d 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig @@ -24,7 +24,6 @@ config ARM select ARCH_HAS_SYNC_DMA_FOR_CPU select ARCH_HAS_TEARDOWN_DMA_OPS if MMU select ARCH_HAS_TICK_BROADCAST if GENERIC_CLOCKEVENTS_BROADCAST - select ARCH_HAVE_CUSTOM_GPIO_H select ARCH_HAVE_NMI_SAFE_CMPXCHG if CPU_V7 || CPU_V7M || CPU_V6K select ARCH_HAS_GCOV_PROFILE_ALL select ARCH_KEEP_MEMBLOCK diff --git a/arch/arm/include/asm/gpio.h b/arch/arm/include/asm/gpio.h deleted file mode 100644 index 4ebbb58f06ea..000000000000 --- a/arch/arm/include/asm/gpio.h +++ /dev/null @@ -1,21 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 */ -#ifndef _ARCH_ARM_GPIO_H -#define _ARCH_ARM_GPIO_H - -#include - -/* The trivial gpiolib dispatchers */ -#define gpio_get_value __gpio_get_value -#define gpio_set_value __gpio_set_value -#define gpio_cansleep __gpio_cansleep - -/* - * Provide a default gpio_to_irq() which should satisfy every case. - * However, some platforms want to do this differently, so allow them - * to override it. - */ -#ifndef gpio_to_irq -#define gpio_to_irq __gpio_to_irq -#endif - -#endif /* _ARCH_ARM_GPIO_H */ diff --git a/arch/sh/Kconfig b/arch/sh/Kconfig index 0665ac0add0b..ccb866750a88 100644 --- a/arch/sh/Kconfig +++ b/arch/sh/Kconfig @@ -4,7 +4,6 @@ config SUPERH select ARCH_32BIT_OFF_T select ARCH_ENABLE_MEMORY_HOTPLUG if SPARSEMEM && MMU select ARCH_ENABLE_MEMORY_HOTREMOVE if SPARSEMEM && MMU - select ARCH_HAVE_CUSTOM_GPIO_H select ARCH_HAVE_NMI_SAFE_CMPXCHG if (GUSA_RB || CPU_SH4A) select ARCH_HAS_BINFMT_FLAT if !MMU select ARCH_HAS_CURRENT_STACK_POINTER diff --git a/arch/sh/boards/board-magicpanelr2.c b/arch/sh/boards/board-magicpanelr2.c index 56bd386ff3b0..75de893152af 100644 --- a/arch/sh/boards/board-magicpanelr2.c +++ b/arch/sh/boards/board-magicpanelr2.c @@ -21,6 +21,7 @@ #include #include #include +#include #include /* Dummy supplies, where voltage doesn't matter */ diff --git a/arch/sh/include/asm/gpio.h b/arch/sh/include/asm/gpio.h deleted file mode 100644 index 588c1380e4cb..000000000000 --- a/arch/sh/include/asm/gpio.h +++ /dev/null @@ -1,45 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 - * - * include/asm-sh/gpio.h - * - * Generic GPIO API and pinmux table support for SuperH. - * - * Copyright (c) 2008 Magnus Damm - */ -#ifndef __ASM_SH_GPIO_H -#define __ASM_SH_GPIO_H - -#include -#include - -#if defined(CONFIG_CPU_SH3) -#include -#endif - -#include - -#ifdef CONFIG_GPIOLIB - -static inline int gpio_get_value(unsigned gpio) -{ - return __gpio_get_value(gpio); -} - -static inline void gpio_set_value(unsigned gpio, int value) -{ - __gpio_set_value(gpio, value); -} - -static inline int gpio_cansleep(unsigned gpio) -{ - return __gpio_cansleep(gpio); -} - -static inline int gpio_to_irq(unsigned gpio) -{ - return __gpio_to_irq(gpio); -} - -#endif /* CONFIG_GPIOLIB */ - -#endif /* __ASM_SH_GPIO_H */ From patchwork Wed Feb 8 17:33:31 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 13133414 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9C65DC64EC4 for ; Wed, 8 Feb 2023 17:35:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232003AbjBHRff (ORCPT ); Wed, 8 Feb 2023 12:35:35 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40038 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231987AbjBHReM (ORCPT ); Wed, 8 Feb 2023 12:34:12 -0500 Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 203674DBD8; Wed, 8 Feb 2023 09:34:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1675877646; x=1707413646; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=9Dq4mU58s7wFVOS4xMQ0zOI9I/hT6Ikw0b7RarExmhA=; b=HTNfkqNiJbCYkdOGF+aE2P2JBIpkEreU0kTfJrOzxHXLsHlRxG+VmLBP 0hlASogr6CNwoKDT3l97XNgwVcwoRthusV0XxG5tJ/Jn+2GSnDPF4vC/x 0okwcaqwRjdELi3vimK5VDq2PaEyc0iffmsFYc3VncJwsrUvUamA7ZyaM wjYR5zXPDch+1rMRNnrdeZmmkmv3FE/9GarvXiLYgqmyNO4XBXqvAtC+o R1WXlVzgXZVXYdbbnd+3MVUGs/uWLU7L3xI+iZl7KyhC0JoPdnolKA8iM NKo9GJMinQ+YW0FZb3WKIfGgXd5/1E1byh5P6gp2tLh4kXAxq8uA0mW/P Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10615"; a="310225377" X-IronPort-AV: E=Sophos;i="5.97,281,1669104000"; d="scan'208";a="310225377" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Feb 2023 09:33:27 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10615"; a="660703926" X-IronPort-AV: E=Sophos;i="5.97,281,1669104000"; d="scan'208";a="660703926" Received: from black.fi.intel.com ([10.237.72.28]) by orsmga007.jf.intel.com with ESMTP; 08 Feb 2023 09:33:21 -0800 Received: by black.fi.intel.com (Postfix, from userid 1003) id CF9FB299; Wed, 8 Feb 2023 19:33:47 +0200 (EET) From: Andy Shevchenko To: Andy Shevchenko , Arnd Bergmann , Linus Walleij , Bartosz Golaszewski , Tony Lindgren , Thomas Gleixner , Krzysztof Kozlowski , Geert Uytterhoeven , Michael Ellerman , Christophe Leroy , Vincenzo Palazzo , Devarsh Thakkar , Michael Walle , Dmitry Torokhov , Dipen Patel , Thierry Reding , Stefan Schmidt , Miquel Raynal , Lee Jones , linux-gpio@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-doc-tw-discuss@lists.sourceforge.net, linux-arm-kernel@lists.infradead.org, linux-omap@vger.kernel.org, linux-samsung-soc@vger.kernel.org, linux-m68k@lists.linux-m68k.org, linuxppc-dev@lists.ozlabs.org, linux-sh@vger.kernel.org, linux-acpi@vger.kernel.org, linux-tegra@vger.kernel.org, linux-input@vger.kernel.org, linux-media@vger.kernel.org, linux-wpan@vger.kernel.org, netdev@vger.kernel.org, linux-wireless@vger.kernel.org, brcm80211-dev-list.pdl@broadcom.com, SHA-cyfmac-dev-list@infineon.com, linux-arch@vger.kernel.org, devicetree@vger.kernel.org Cc: Bartosz Golaszewski , Jonathan Corbet , Alex Shi , Yanteng Si , Hu Haowen , Russell King , Aaro Koskinen , Janusz Krzysztofik , Andrew Lunn , Sebastian Hesselbarth , Gregory Clement , Alim Akhtar , Nicholas Piggin , Yoshinori Sato , Rich Felker , Mun Yew Tham , Keerthy , Mika Westerberg , Thierry Reding , Jonathan Hunter , Mauro Carvalho Chehab , Alexander Aring , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Arend van Spriel , Franky Lin , Hante Meuleman , Kalle Valo , Qiang Zhao , Li Yang , Rob Herring , Frank Rowand Subject: [PATCH v4 06/18] gpiolib: coldfire: remove custom asm/gpio.h Date: Wed, 8 Feb 2023 19:33:31 +0200 Message-Id: <20230208173343.37582-7-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230208173343.37582-1-andriy.shevchenko@linux.intel.com> References: <20230208173343.37582-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org From: Arnd Bergmann Now that coldfire is the only user of a custom asm/gpio.h, it seems better to remove this as well, and have the same interface everywhere. For the gpio_get_value()/gpio_set_value()/gpio_to_irq(), gpio_cansleep() functions, the custom version is only a micro-optimization to inline the function for constant GPIO numbers. However, in the coldfire defconfigs, I was unable to find a single instance where this micro-optimization was even used, and according to Geert the only user appears to be the QSPI chip that is disabled everywhere. The custom gpio_request_one() function is even less useful, as it is guarded by an #ifdef that is never true. Reviewed-by: Geert Uytterhoeven Reviewed-by: Andy Shevchenko Acked-by: Bartosz Golaszewski Signed-off-by: Arnd Bergmann Reviewed-by: Linus Walleij Signed-off-by: Andy Shevchenko --- arch/m68k/Kconfig.cpu | 1 - arch/m68k/include/asm/gpio.h | 95 ------------------------------------ drivers/gpio/Kconfig | 8 --- include/linux/gpio.h | 7 --- 4 files changed, 111 deletions(-) delete mode 100644 arch/m68k/include/asm/gpio.h diff --git a/arch/m68k/Kconfig.cpu b/arch/m68k/Kconfig.cpu index 9380f6e3bb66..96a0fb4f1af5 100644 --- a/arch/m68k/Kconfig.cpu +++ b/arch/m68k/Kconfig.cpu @@ -24,7 +24,6 @@ config M68KCLASSIC config COLDFIRE bool "Coldfire CPU family support" - select ARCH_HAVE_CUSTOM_GPIO_H select CPU_HAS_NO_BITFIELDS select CPU_HAS_NO_CAS select CPU_HAS_NO_MULDIV64 diff --git a/arch/m68k/include/asm/gpio.h b/arch/m68k/include/asm/gpio.h deleted file mode 100644 index 5cfc0996ba94..000000000000 --- a/arch/m68k/include/asm/gpio.h +++ /dev/null @@ -1,95 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0-only */ -/* - * Coldfire generic GPIO support - * - * (C) Copyright 2009, Steven King -*/ - -#ifndef coldfire_gpio_h -#define coldfire_gpio_h - -#include -#include -#include -#include -/* - * The Generic GPIO functions - * - * If the gpio is a compile time constant and is one of the Coldfire gpios, - * use the inline version, otherwise dispatch thru gpiolib. - */ - -static inline int gpio_get_value(unsigned gpio) -{ - if (__builtin_constant_p(gpio) && gpio < MCFGPIO_PIN_MAX) - return mcfgpio_read(__mcfgpio_ppdr(gpio)) & mcfgpio_bit(gpio); - else - return __gpio_get_value(gpio); -} - -static inline void gpio_set_value(unsigned gpio, int value) -{ - if (__builtin_constant_p(gpio) && gpio < MCFGPIO_PIN_MAX) { - if (gpio < MCFGPIO_SCR_START) { - unsigned long flags; - MCFGPIO_PORTTYPE data; - - local_irq_save(flags); - data = mcfgpio_read(__mcfgpio_podr(gpio)); - if (value) - data |= mcfgpio_bit(gpio); - else - data &= ~mcfgpio_bit(gpio); - mcfgpio_write(data, __mcfgpio_podr(gpio)); - local_irq_restore(flags); - } else { - if (value) - mcfgpio_write(mcfgpio_bit(gpio), - MCFGPIO_SETR_PORT(gpio)); - else - mcfgpio_write(~mcfgpio_bit(gpio), - MCFGPIO_CLRR_PORT(gpio)); - } - } else - __gpio_set_value(gpio, value); -} - -static inline int gpio_to_irq(unsigned gpio) -{ -#if defined(MCFGPIO_IRQ_MIN) - if ((gpio >= MCFGPIO_IRQ_MIN) && (gpio < MCFGPIO_IRQ_MAX)) -#else - if (gpio < MCFGPIO_IRQ_MAX) -#endif - return gpio + MCFGPIO_IRQ_VECBASE; - else - return __gpio_to_irq(gpio); -} - -static inline int gpio_cansleep(unsigned gpio) -{ - return gpio < MCFGPIO_PIN_MAX ? 0 : __gpio_cansleep(gpio); -} - -#ifndef CONFIG_GPIOLIB -static inline int gpio_request_one(unsigned gpio, unsigned long flags, const char *label) -{ - int err; - - err = gpio_request(gpio, label); - if (err) - return err; - - if (flags & GPIOF_DIR_IN) - err = gpio_direction_input(gpio); - else - err = gpio_direction_output(gpio, - (flags & GPIOF_INIT_HIGH) ? 1 : 0); - - if (err) - gpio_free(gpio); - - return err; -} -#endif /* !CONFIG_GPIOLIB */ -#endif diff --git a/drivers/gpio/Kconfig b/drivers/gpio/Kconfig index 218d7e4c27ff..06a268d56800 100644 --- a/drivers/gpio/Kconfig +++ b/drivers/gpio/Kconfig @@ -3,14 +3,6 @@ # GPIO infrastructure and drivers # -config ARCH_HAVE_CUSTOM_GPIO_H - bool - help - Selecting this config option from the architecture Kconfig allows - the architecture to provide a custom asm/gpio.h implementation - overriding the default implementations. New uses of this are - strongly discouraged. - menuconfig GPIOLIB bool "GPIO Support" help diff --git a/include/linux/gpio.h b/include/linux/gpio.h index 85beb236c925..2b75017b3aad 100644 --- a/include/linux/gpio.h +++ b/include/linux/gpio.h @@ -54,11 +54,6 @@ struct gpio { }; #ifdef CONFIG_GPIOLIB - -#ifdef CONFIG_ARCH_HAVE_CUSTOM_GPIO_H -#include -#else - #include static inline int gpio_get_value(unsigned int gpio) @@ -81,8 +76,6 @@ static inline int gpio_to_irq(unsigned int gpio) return __gpio_to_irq(gpio); } -#endif /* ! CONFIG_ARCH_HAVE_CUSTOM_GPIO_H */ - /* CONFIG_GPIOLIB: bindings for managed devices that want to request gpios */ struct device; From patchwork Wed Feb 8 17:33:32 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 13133415 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C2D2BC6FD1D for ; Wed, 8 Feb 2023 17:35:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232048AbjBHRfh (ORCPT ); Wed, 8 Feb 2023 12:35:37 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41054 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231425AbjBHRee (ORCPT ); Wed, 8 Feb 2023 12:34:34 -0500 Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 77ECA518F9; Wed, 8 Feb 2023 09:34:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1675877652; x=1707413652; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=APWUZYQ1vDYlUkV8BjfBfVaZaanhCPV3rpw0l2u2Gfs=; b=i9muyLfZapQNmUFamDGR6jbF2OerUF7yG8O7QLnmO9Juy/SvQr/f6LUz 5AGIgPj2b8JF/kw6tZU0QsnegiH4Eaj5vRG5K3LYFU8ehq9swfj6WPYj1 v5yHm8fjVKnyFxZwYYO1YG1iZ7dNUdRBxqp2JuVv86ZRY6a6nF9ClVSRL AayrD8zP4tavXts9/vEwxw+Iy5BsqZUgW/Nj71Wf5CZBo5UeyTsSP1xxT pAyJebx2PShQWmHKlzeBv5XPlOBwjh75zztKfawG78CA3g/W9taFnMsId FaOaMj6oHUvAvtXHqcetc+NhvqAmiXwNOQYNeNk1Ywt2RII2giRnyGqUm A==; X-IronPort-AV: E=McAfee;i="6500,9779,10615"; a="310225395" X-IronPort-AV: E=Sophos;i="5.97,281,1669104000"; d="scan'208";a="310225395" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Feb 2023 09:33:28 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10615"; a="697723011" X-IronPort-AV: E=Sophos;i="5.97,281,1669104000"; d="scan'208";a="697723011" Received: from black.fi.intel.com ([10.237.72.28]) by orsmga008.jf.intel.com with ESMTP; 08 Feb 2023 09:33:22 -0800 Received: by black.fi.intel.com (Postfix, from userid 1003) id DFAD434D; Wed, 8 Feb 2023 19:33:47 +0200 (EET) From: Andy Shevchenko To: Andy Shevchenko , Arnd Bergmann , Linus Walleij , Bartosz Golaszewski , Tony Lindgren , Thomas Gleixner , Krzysztof Kozlowski , Geert Uytterhoeven , Michael Ellerman , Christophe Leroy , Vincenzo Palazzo , Devarsh Thakkar , Michael Walle , Dmitry Torokhov , Dipen Patel , Thierry Reding , Stefan Schmidt , Miquel Raynal , Lee Jones , linux-gpio@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-doc-tw-discuss@lists.sourceforge.net, linux-arm-kernel@lists.infradead.org, linux-omap@vger.kernel.org, linux-samsung-soc@vger.kernel.org, linux-m68k@lists.linux-m68k.org, linuxppc-dev@lists.ozlabs.org, linux-sh@vger.kernel.org, linux-acpi@vger.kernel.org, linux-tegra@vger.kernel.org, linux-input@vger.kernel.org, linux-media@vger.kernel.org, linux-wpan@vger.kernel.org, netdev@vger.kernel.org, linux-wireless@vger.kernel.org, brcm80211-dev-list.pdl@broadcom.com, SHA-cyfmac-dev-list@infineon.com, linux-arch@vger.kernel.org, devicetree@vger.kernel.org Cc: Bartosz Golaszewski , Jonathan Corbet , Alex Shi , Yanteng Si , Hu Haowen , Russell King , Aaro Koskinen , Janusz Krzysztofik , Andrew Lunn , Sebastian Hesselbarth , Gregory Clement , Alim Akhtar , Nicholas Piggin , Yoshinori Sato , Rich Felker , Mun Yew Tham , Keerthy , Mika Westerberg , Thierry Reding , Jonathan Hunter , Mauro Carvalho Chehab , Alexander Aring , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Arend van Spriel , Franky Lin , Hante Meuleman , Kalle Valo , Qiang Zhao , Li Yang , Rob Herring , Frank Rowand Subject: [PATCH v4 07/18] gpiolib: remove asm-generic/gpio.h Date: Wed, 8 Feb 2023 19:33:32 +0200 Message-Id: <20230208173343.37582-8-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230208173343.37582-1-andriy.shevchenko@linux.intel.com> References: <20230208173343.37582-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org From: Arnd Bergmann The asm-generic/gpio.h file is now always included when using gpiolib, so just move its contents into linux/gpio.h with a few minor simplifications. Signed-off-by: Arnd Bergmann Reviewed-by: Linus Walleij Reviewed-by: Andy Shevchenko Signed-off-by: Andy Shevchenko --- MAINTAINERS | 1 - arch/m68k/include/asm/mcfgpio.h | 2 +- drivers/gpio/gpio-davinci.c | 2 - drivers/pinctrl/core.c | 1 - include/asm-generic/gpio.h | 146 -------------------------------- include/linux/gpio.h | 94 +++++++++++++++++--- 6 files changed, 85 insertions(+), 161 deletions(-) delete mode 100644 include/asm-generic/gpio.h diff --git a/MAINTAINERS b/MAINTAINERS index 94971603568b..955a513ac504 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -8730,7 +8730,6 @@ F: Documentation/admin-guide/gpio/ F: Documentation/devicetree/bindings/gpio/ F: Documentation/driver-api/gpio/ F: drivers/gpio/ -F: include/asm-generic/gpio.h F: include/dt-bindings/gpio/ F: include/linux/gpio.h F: include/linux/gpio/ diff --git a/arch/m68k/include/asm/mcfgpio.h b/arch/m68k/include/asm/mcfgpio.h index 27f32cc81da6..2cefe8445980 100644 --- a/arch/m68k/include/asm/mcfgpio.h +++ b/arch/m68k/include/asm/mcfgpio.h @@ -9,7 +9,7 @@ #define mcfgpio_h #ifdef CONFIG_GPIOLIB -#include +#include #else int __mcfgpio_get_value(unsigned gpio); diff --git a/drivers/gpio/gpio-davinci.c b/drivers/gpio/gpio-davinci.c index 26b1f7465e09..7fc83057990a 100644 --- a/drivers/gpio/gpio-davinci.c +++ b/drivers/gpio/gpio-davinci.c @@ -24,8 +24,6 @@ #include #include -#include - #define MAX_REGS_BANKS 5 #define MAX_INT_PER_BANK 32 diff --git a/drivers/pinctrl/core.c b/drivers/pinctrl/core.c index d6e6c751255f..401886c81344 100644 --- a/drivers/pinctrl/core.c +++ b/drivers/pinctrl/core.c @@ -30,7 +30,6 @@ #ifdef CONFIG_GPIOLIB #include "../gpio/gpiolib.h" -#include #endif #include "core.h" diff --git a/include/asm-generic/gpio.h b/include/asm-generic/gpio.h deleted file mode 100644 index 1c910d124423..000000000000 --- a/include/asm-generic/gpio.h +++ /dev/null @@ -1,146 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 */ -#ifndef _ASM_GENERIC_GPIO_H -#define _ASM_GENERIC_GPIO_H - -#include -#include - -#ifdef CONFIG_GPIOLIB - -#include -#include - -/* - * Platforms may implement their GPIO interface with library code, - * at a small performance cost for non-inlined operations and some - * extra memory (for code and for per-GPIO table entries). - */ - -/* - * At the end we want all GPIOs to be dynamically allocated from 0. - * However, some legacy drivers still perform fixed allocation. - * Until they are all fixed, leave 0-512 space for them. - */ -#define GPIO_DYNAMIC_BASE 512 - -struct device; -struct gpio; -struct seq_file; -struct module; -struct device_node; -struct gpio_desc; - -/* Always use the library code for GPIO management calls, - * or when sleeping may be involved. - */ -extern int gpio_request(unsigned gpio, const char *label); -extern void gpio_free(unsigned gpio); - -static inline int gpio_direction_input(unsigned gpio) -{ - return gpiod_direction_input(gpio_to_desc(gpio)); -} -static inline int gpio_direction_output(unsigned gpio, int value) -{ - return gpiod_direction_output_raw(gpio_to_desc(gpio), value); -} - -static inline int gpio_set_debounce(unsigned gpio, unsigned debounce) -{ - return gpiod_set_debounce(gpio_to_desc(gpio), debounce); -} - -static inline int gpio_get_value_cansleep(unsigned gpio) -{ - return gpiod_get_raw_value_cansleep(gpio_to_desc(gpio)); -} -static inline void gpio_set_value_cansleep(unsigned gpio, int value) -{ - return gpiod_set_raw_value_cansleep(gpio_to_desc(gpio), value); -} - - -/* A platform's code may want to inline the I/O calls when - * the GPIO is constant and refers to some always-present controller, - * giving direct access to chip registers and tight bitbanging loops. - */ -static inline int __gpio_get_value(unsigned gpio) -{ - return gpiod_get_raw_value(gpio_to_desc(gpio)); -} -static inline void __gpio_set_value(unsigned gpio, int value) -{ - return gpiod_set_raw_value(gpio_to_desc(gpio), value); -} - -static inline int __gpio_cansleep(unsigned gpio) -{ - return gpiod_cansleep(gpio_to_desc(gpio)); -} - -static inline int __gpio_to_irq(unsigned gpio) -{ - return gpiod_to_irq(gpio_to_desc(gpio)); -} - -extern int gpio_request_one(unsigned gpio, unsigned long flags, const char *label); -extern int gpio_request_array(const struct gpio *array, size_t num); -extern void gpio_free_array(const struct gpio *array, size_t num); - -/* - * A sysfs interface can be exported by individual drivers if they want, - * but more typically is configured entirely from userspace. - */ -static inline int gpio_export(unsigned gpio, bool direction_may_change) -{ - return gpiod_export(gpio_to_desc(gpio), direction_may_change); -} - -static inline void gpio_unexport(unsigned gpio) -{ - gpiod_unexport(gpio_to_desc(gpio)); -} - -#else /* !CONFIG_GPIOLIB */ - -#include - -/* platforms that don't directly support access to GPIOs through I2C, SPI, - * or other blocking infrastructure can use these wrappers. - */ - -static inline int gpio_cansleep(unsigned gpio) -{ - return 0; -} - -static inline int gpio_get_value_cansleep(unsigned gpio) -{ - might_sleep(); - return __gpio_get_value(gpio); -} - -static inline void gpio_set_value_cansleep(unsigned gpio, int value) -{ - might_sleep(); - __gpio_set_value(gpio, value); -} - -#endif /* !CONFIG_GPIOLIB */ - -/* - * "valid" GPIO numbers are nonnegative and may be passed to - * setup routines like gpio_request(). only some valid numbers - * can successfully be requested and used. - * - * Invalid GPIO numbers are useful for indicating no-such-GPIO in - * platform data and other tables. - */ - -static inline bool gpio_is_valid(int number) -{ - /* only non-negative numbers are valid */ - return number >= 0; -} - -#endif /* _ASM_GENERIC_GPIO_H */ diff --git a/include/linux/gpio.h b/include/linux/gpio.h index 2b75017b3aad..d5ce78e2bdd9 100644 --- a/include/linux/gpio.h +++ b/include/linux/gpio.h @@ -13,6 +13,7 @@ #define __LINUX_GPIO_H #include +#include /* see Documentation/driver-api/gpio/legacy.rst */ @@ -54,26 +55,100 @@ struct gpio { }; #ifdef CONFIG_GPIOLIB -#include -static inline int gpio_get_value(unsigned int gpio) +#include + +/* + * "valid" GPIO numbers are nonnegative and may be passed to + * setup routines like gpio_request(). Only some valid numbers + * can successfully be requested and used. + * + * Invalid GPIO numbers are useful for indicating no-such-GPIO in + * platform data and other tables. + */ +static inline bool gpio_is_valid(int number) +{ + /* only non-negative numbers are valid */ + return number >= 0; +} + +/* + * Platforms may implement their GPIO interface with library code, + * at a small performance cost for non-inlined operations and some + * extra memory (for code and for per-GPIO table entries). + */ + +/* + * At the end we want all GPIOs to be dynamically allocated from 0. + * However, some legacy drivers still perform fixed allocation. + * Until they are all fixed, leave 0-512 space for them. + */ +#define GPIO_DYNAMIC_BASE 512 + +/* Always use the library code for GPIO management calls, + * or when sleeping may be involved. + */ +int gpio_request(unsigned gpio, const char *label); +void gpio_free(unsigned gpio); + +static inline int gpio_direction_input(unsigned gpio) +{ + return gpiod_direction_input(gpio_to_desc(gpio)); +} +static inline int gpio_direction_output(unsigned gpio, int value) +{ + return gpiod_direction_output_raw(gpio_to_desc(gpio), value); +} + +static inline int gpio_set_debounce(unsigned gpio, unsigned debounce) +{ + return gpiod_set_debounce(gpio_to_desc(gpio), debounce); +} + +static inline int gpio_get_value_cansleep(unsigned gpio) +{ + return gpiod_get_raw_value_cansleep(gpio_to_desc(gpio)); +} +static inline void gpio_set_value_cansleep(unsigned gpio, int value) { - return __gpio_get_value(gpio); + return gpiod_set_raw_value_cansleep(gpio_to_desc(gpio), value); } -static inline void gpio_set_value(unsigned int gpio, int value) +static inline int gpio_get_value(unsigned gpio) +{ + return gpiod_get_raw_value(gpio_to_desc(gpio)); +} +static inline void gpio_set_value(unsigned gpio, int value) { - __gpio_set_value(gpio, value); + return gpiod_set_raw_value(gpio_to_desc(gpio), value); } -static inline int gpio_cansleep(unsigned int gpio) +static inline int gpio_cansleep(unsigned gpio) { - return __gpio_cansleep(gpio); + return gpiod_cansleep(gpio_to_desc(gpio)); } -static inline int gpio_to_irq(unsigned int gpio) +static inline int gpio_to_irq(unsigned gpio) { - return __gpio_to_irq(gpio); + return gpiod_to_irq(gpio_to_desc(gpio)); +} + +int gpio_request_one(unsigned gpio, unsigned long flags, const char *label); +int gpio_request_array(const struct gpio *array, size_t num); +void gpio_free_array(const struct gpio *array, size_t num); + +/* + * A sysfs interface can be exported by individual drivers if they want, + * but more typically is configured entirely from userspace. + */ +static inline int gpio_export(unsigned gpio, bool direction_may_change) +{ + return gpiod_export(gpio_to_desc(gpio), direction_may_change); +} + +static inline void gpio_unexport(unsigned gpio) +{ + gpiod_unexport(gpio_to_desc(gpio)); } /* CONFIG_GPIOLIB: bindings for managed devices that want to request gpios */ @@ -88,7 +163,6 @@ int devm_gpio_request_one(struct device *dev, unsigned gpio, #include #include -#include struct device; struct gpio_chip; From patchwork Wed Feb 8 17:33:33 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 13133416 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 06C06C64ED6 for ; Wed, 8 Feb 2023 17:35:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232058AbjBHRfi (ORCPT ); Wed, 8 Feb 2023 12:35:38 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40284 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232063AbjBHReV (ORCPT ); Wed, 8 Feb 2023 12:34:21 -0500 Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 12AC6518C6; Wed, 8 Feb 2023 09:34:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1675877648; x=1707413648; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=8Loz5frdfBtc0l4PlP9rbgkvfnulxYbRlKr/4QRrkgw=; b=eFi8ChfT7++4L/EX4oeubArrcxrVDFm+apkv0gcgMX3ZzQBTdTgRBm3+ WcmmR8N5WOvyymDDzrXnCB7ZiwW+ebAQNX7uMvMtKtKINcZISmmJm/pg8 6fBMSvCW5nZqNn3It7FZrVu/4jN8/c5JnKoJUGuvh3Akxm7VRrmEXxhDk BCzdzYxAathBeU7G4q8rUlDEAnVjLJw0q9Cl63pUuNdi5/COlISrvh2q8 F9iXs+iH+G9wJmX3LShCfSsoC7QZKv2/fOqfTDQxeW9K+uLxrQ1S3+eTt RUXNG21KG3IsjaeSVxqWH/j1nKDXuURNOknXZm6rV1JCVWlX7pEOz7NQT g==; X-IronPort-AV: E=McAfee;i="6500,9779,10615"; a="310225405" X-IronPort-AV: E=Sophos;i="5.97,281,1669104000"; d="scan'208";a="310225405" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Feb 2023 09:33:28 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10615"; a="660703928" X-IronPort-AV: E=Sophos;i="5.97,281,1669104000"; d="scan'208";a="660703928" Received: from black.fi.intel.com ([10.237.72.28]) by orsmga007.jf.intel.com with ESMTP; 08 Feb 2023 09:33:22 -0800 Received: by black.fi.intel.com (Postfix, from userid 1003) id F316D37D; Wed, 8 Feb 2023 19:33:47 +0200 (EET) From: Andy Shevchenko To: Andy Shevchenko , Arnd Bergmann , Linus Walleij , Bartosz Golaszewski , Tony Lindgren , Thomas Gleixner , Krzysztof Kozlowski , Geert Uytterhoeven , Michael Ellerman , Christophe Leroy , Vincenzo Palazzo , Devarsh Thakkar , Michael Walle , Dmitry Torokhov , Dipen Patel , Thierry Reding , Stefan Schmidt , Miquel Raynal , Lee Jones , linux-gpio@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-doc-tw-discuss@lists.sourceforge.net, linux-arm-kernel@lists.infradead.org, linux-omap@vger.kernel.org, linux-samsung-soc@vger.kernel.org, linux-m68k@lists.linux-m68k.org, linuxppc-dev@lists.ozlabs.org, linux-sh@vger.kernel.org, linux-acpi@vger.kernel.org, linux-tegra@vger.kernel.org, linux-input@vger.kernel.org, linux-media@vger.kernel.org, linux-wpan@vger.kernel.org, netdev@vger.kernel.org, linux-wireless@vger.kernel.org, brcm80211-dev-list.pdl@broadcom.com, SHA-cyfmac-dev-list@infineon.com, linux-arch@vger.kernel.org, devicetree@vger.kernel.org Cc: Bartosz Golaszewski , Jonathan Corbet , Alex Shi , Yanteng Si , Hu Haowen , Russell King , Aaro Koskinen , Janusz Krzysztofik , Andrew Lunn , Sebastian Hesselbarth , Gregory Clement , Alim Akhtar , Nicholas Piggin , Yoshinori Sato , Rich Felker , Mun Yew Tham , Keerthy , Mika Westerberg , Thierry Reding , Jonathan Hunter , Mauro Carvalho Chehab , Alexander Aring , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Arend van Spriel , Franky Lin , Hante Meuleman , Kalle Valo , Qiang Zhao , Li Yang , Rob Herring , Frank Rowand Subject: [PATCH v4 08/18] gpiolib: remove gpio_set_debounce() Date: Wed, 8 Feb 2023 19:33:33 +0200 Message-Id: <20230208173343.37582-9-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230208173343.37582-1-andriy.shevchenko@linux.intel.com> References: <20230208173343.37582-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org From: Arnd Bergmann gpio_set_debounce() only has a single user, which is trivially converted to gpiod_set_debounce(). Signed-off-by: Arnd Bergmann Reviewed-by: Linus Walleij Reviewed-by: Andy Shevchenko Signed-off-by: Andy Shevchenko Acked-by: Dmitry Torokhov --- Documentation/driver-api/gpio/legacy.rst | 2 -- .../translations/zh_CN/driver-api/gpio/legacy.rst | 1 - Documentation/translations/zh_TW/gpio.txt | 1 - drivers/input/touchscreen/ads7846.c | 5 +++-- include/linux/gpio.h | 10 ---------- 5 files changed, 3 insertions(+), 16 deletions(-) diff --git a/Documentation/driver-api/gpio/legacy.rst b/Documentation/driver-api/gpio/legacy.rst index a0559d93efd1..e0306e78e34b 100644 --- a/Documentation/driver-api/gpio/legacy.rst +++ b/Documentation/driver-api/gpio/legacy.rst @@ -238,8 +238,6 @@ setup or driver probe/teardown code, so this is an easy constraint.):: ## gpio_free_array() gpio_free() - gpio_set_debounce() - Claiming and Releasing GPIOs diff --git a/Documentation/translations/zh_CN/driver-api/gpio/legacy.rst b/Documentation/translations/zh_CN/driver-api/gpio/legacy.rst index 74fa473bb504..dee2a0517c1c 100644 --- a/Documentation/translations/zh_CN/driver-api/gpio/legacy.rst +++ b/Documentation/translations/zh_CN/driver-api/gpio/legacy.rst @@ -219,7 +219,6 @@ GPIO 值的命令需要等待其信息排到队首才发送命令,再获得其 ## gpio_free_array() gpio_free() - gpio_set_debounce() diff --git a/Documentation/translations/zh_TW/gpio.txt b/Documentation/translations/zh_TW/gpio.txt index 1b986bbb0909..dc608358d90a 100644 --- a/Documentation/translations/zh_TW/gpio.txt +++ b/Documentation/translations/zh_TW/gpio.txt @@ -226,7 +226,6 @@ GPIO 值的命令需要等待其信息排到隊首才發送命令,再獲得其 ## gpio_free_array() gpio_free() - gpio_set_debounce() diff --git a/drivers/input/touchscreen/ads7846.c b/drivers/input/touchscreen/ads7846.c index 17f11bce8113..bb1058b1e7fd 100644 --- a/drivers/input/touchscreen/ads7846.c +++ b/drivers/input/touchscreen/ads7846.c @@ -27,6 +27,7 @@ #include #include #include +#include #include #include #include @@ -1012,8 +1013,8 @@ static int ads7846_setup_pendown(struct spi_device *spi, ts->gpio_pendown = pdata->gpio_pendown; if (pdata->gpio_pendown_debounce) - gpio_set_debounce(pdata->gpio_pendown, - pdata->gpio_pendown_debounce); + gpiod_set_debounce(gpio_to_desc(ts->gpio_pendown), + pdata->gpio_pendown_debounce); } else { dev_err(&spi->dev, "no get_pendown_state nor gpio_pendown?\n"); return -EINVAL; diff --git a/include/linux/gpio.h b/include/linux/gpio.h index d5ce78e2bdd9..fc56733e8514 100644 --- a/include/linux/gpio.h +++ b/include/linux/gpio.h @@ -100,11 +100,6 @@ static inline int gpio_direction_output(unsigned gpio, int value) return gpiod_direction_output_raw(gpio_to_desc(gpio), value); } -static inline int gpio_set_debounce(unsigned gpio, unsigned debounce) -{ - return gpiod_set_debounce(gpio_to_desc(gpio), debounce); -} - static inline int gpio_get_value_cansleep(unsigned gpio) { return gpiod_get_raw_value_cansleep(gpio_to_desc(gpio)); @@ -214,11 +209,6 @@ static inline int gpio_direction_output(unsigned gpio, int value) return -ENOSYS; } -static inline int gpio_set_debounce(unsigned gpio, unsigned debounce) -{ - return -ENOSYS; -} - static inline int gpio_get_value(unsigned gpio) { /* GPIO can never have been requested or set as {in,out}put */ From patchwork Wed Feb 8 17:33:34 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 13133413 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id EFF15C64ED9 for ; Wed, 8 Feb 2023 17:35:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231971AbjBHReK (ORCPT ); Wed, 8 Feb 2023 12:34:10 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39632 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231650AbjBHRd7 (ORCPT ); Wed, 8 Feb 2023 12:33:59 -0500 Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B58393251B; Wed, 8 Feb 2023 09:33:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1675877635; x=1707413635; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=O8wgtjnDDH6goWjAVZmuil9qOihxRC2fM6d0IEYsaVE=; b=aWfLANu8ZRVdMHEUwbT1v02po+ZbSlWksBg6tmsLW7mj63pJymfVGW4o Pi70loo/yzMQ2KiIjqFEQD45Gtc9DDbgvjbKAUvz+cwF54iyY0ozDG9yv IRwvVu0OPJVYuACHMS57hOOkdtCvHfiWKBqu9gPXIwZ9EMneRWRwc8eOM BQIEJ/O0ci342PJ5ZeCgjOojx6G8lwTUCR4SCwErgaXJGG1qjIssjZCYa AsQSWNIB9/Q6p4Cdg7nY4HQyGFlKdBvJd3VVmHwtjqNqRP4C3CRHlu1vI FWfRlvq0wNOn0qHWxi7e2INbcNuDK8qFYYwoqiOZuGspMm7WZ8oT8XrgW w==; X-IronPort-AV: E=McAfee;i="6500,9779,10615"; a="331153826" X-IronPort-AV: E=Sophos;i="5.97,281,1669104000"; d="scan'208";a="331153826" Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Feb 2023 09:33:33 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10615"; a="669265866" X-IronPort-AV: E=Sophos;i="5.97,281,1669104000"; d="scan'208";a="669265866" Received: from black.fi.intel.com ([10.237.72.28]) by fmsmga007.fm.intel.com with ESMTP; 08 Feb 2023 09:33:26 -0800 Received: by black.fi.intel.com (Postfix, from userid 1003) id 0F0D3380; Wed, 8 Feb 2023 19:33:48 +0200 (EET) From: Andy Shevchenko To: Andy Shevchenko , Arnd Bergmann , Linus Walleij , Bartosz Golaszewski , Tony Lindgren , Thomas Gleixner , Krzysztof Kozlowski , Geert Uytterhoeven , Michael Ellerman , Christophe Leroy , Vincenzo Palazzo , Devarsh Thakkar , Michael Walle , Dmitry Torokhov , Dipen Patel , Thierry Reding , Stefan Schmidt , Miquel Raynal , Lee Jones , linux-gpio@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-doc-tw-discuss@lists.sourceforge.net, linux-arm-kernel@lists.infradead.org, linux-omap@vger.kernel.org, linux-samsung-soc@vger.kernel.org, linux-m68k@lists.linux-m68k.org, linuxppc-dev@lists.ozlabs.org, linux-sh@vger.kernel.org, linux-acpi@vger.kernel.org, linux-tegra@vger.kernel.org, linux-input@vger.kernel.org, linux-media@vger.kernel.org, linux-wpan@vger.kernel.org, netdev@vger.kernel.org, linux-wireless@vger.kernel.org, brcm80211-dev-list.pdl@broadcom.com, SHA-cyfmac-dev-list@infineon.com, linux-arch@vger.kernel.org, devicetree@vger.kernel.org Cc: Bartosz Golaszewski , Jonathan Corbet , Alex Shi , Yanteng Si , Hu Haowen , Russell King , Aaro Koskinen , Janusz Krzysztofik , Andrew Lunn , Sebastian Hesselbarth , Gregory Clement , Alim Akhtar , Nicholas Piggin , Yoshinori Sato , Rich Felker , Mun Yew Tham , Keerthy , Mika Westerberg , Thierry Reding , Jonathan Hunter , Mauro Carvalho Chehab , Alexander Aring , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Arend van Spriel , Franky Lin , Hante Meuleman , Kalle Valo , Qiang Zhao , Li Yang , Rob Herring , Frank Rowand Subject: [PATCH v4 09/18] gpiolib: remove legacy gpio_export() Date: Wed, 8 Feb 2023 19:33:34 +0200 Message-Id: <20230208173343.37582-10-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230208173343.37582-1-andriy.shevchenko@linux.intel.com> References: <20230208173343.37582-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org From: Arnd Bergmann There are only a handful of users of gpio_export() and related functions. As these are just wrappers around the modern gpiod_export() helper, remove the wrappers and open-code the gpio_to_desc in all callers to shrink the legacy API. Reviewed-by: Andy Shevchenko Signed-off-by: Arnd Bergmann Reviewed-by: Linus Walleij Signed-off-by: Andy Shevchenko --- Documentation/admin-guide/gpio/sysfs.rst | 2 +- Documentation/driver-api/gpio/legacy.rst | 21 --------------- .../zh_CN/driver-api/gpio/legacy.rst | 19 ------------- Documentation/translations/zh_TW/gpio.txt | 18 ------------- arch/arm/mach-omap2/pdata-quirks.c | 9 ++++--- arch/sh/boards/mach-ap325rxa/setup.c | 7 ++--- drivers/gpio/gpiolib-sysfs.c | 4 +-- drivers/media/pci/sta2x11/sta2x11_vip.c | 10 ++++--- drivers/net/ieee802154/ca8210.c | 3 ++- include/linux/gpio.h | 27 ------------------- 10 files changed, 21 insertions(+), 99 deletions(-) diff --git a/Documentation/admin-guide/gpio/sysfs.rst b/Documentation/admin-guide/gpio/sysfs.rst index ec09ffd983e7..35171d15f78d 100644 --- a/Documentation/admin-guide/gpio/sysfs.rst +++ b/Documentation/admin-guide/gpio/sysfs.rst @@ -145,7 +145,7 @@ requested using gpio_request():: /* export the GPIO to userspace */ int gpiod_export(struct gpio_desc *desc, bool direction_may_change); - /* reverse gpio_export() */ + /* reverse gpiod_export() */ void gpiod_unexport(struct gpio_desc *desc); /* create a sysfs link to an exported GPIO node */ diff --git a/Documentation/driver-api/gpio/legacy.rst b/Documentation/driver-api/gpio/legacy.rst index e0306e78e34b..78372853c6d4 100644 --- a/Documentation/driver-api/gpio/legacy.rst +++ b/Documentation/driver-api/gpio/legacy.rst @@ -714,27 +714,6 @@ gpiochip nodes (possibly in conjunction with schematics) to determine the correct GPIO number to use for a given signal. -Exporting from Kernel code --------------------------- -Kernel code can explicitly manage exports of GPIOs which have already been -requested using gpio_request():: - - /* export the GPIO to userspace */ - int gpio_export(unsigned gpio, bool direction_may_change); - - /* reverse gpio_export() */ - void gpio_unexport(); - -After a kernel driver requests a GPIO, it may only be made available in -the sysfs interface by gpio_export(). The driver can control whether the -signal direction may change. This helps drivers prevent userspace code -from accidentally clobbering important system state. - -This explicit exporting can help with debugging (by making some kinds -of experiments easier), or can provide an always-there interface that's -suitable for documenting as part of a board support package. - - API Reference ============= diff --git a/Documentation/translations/zh_CN/driver-api/gpio/legacy.rst b/Documentation/translations/zh_CN/driver-api/gpio/legacy.rst index dee2a0517c1c..84ce2322fdba 100644 --- a/Documentation/translations/zh_CN/driver-api/gpio/legacy.rst +++ b/Documentation/translations/zh_CN/driver-api/gpio/legacy.rst @@ -653,25 +653,6 @@ GPIO 控制器的路径类似 /sys/class/gpio/gpiochip42/ (对于从#42 GPIO 确定给定信号所用的 GPIO 编号。 -从内核代码中导出 ----------------- - -内核代码可以明确地管理那些已通过 gpio_request()申请的 GPIO 的导出:: - - /* 导出 GPIO 到用户空间 */ - int gpio_export(unsigned gpio, bool direction_may_change); - - /* gpio_export()的逆操作 */ - void gpio_unexport(); - -在一个内核驱动申请一个 GPIO 之后,它可以通过 gpio_export()使其在 sysfs -接口中可见。该驱动可以控制信号方向是否可修改。这有助于防止用户空间代码无意间 -破坏重要的系统状态。 - -这个明确的导出有助于(通过使某些实验更容易来)调试,也可以提供一个始终存在的接口, -与文档配合作为板级支持包的一部分。 - - API参考 ======= diff --git a/Documentation/translations/zh_TW/gpio.txt b/Documentation/translations/zh_TW/gpio.txt index dc608358d90a..62e560ffe628 100644 --- a/Documentation/translations/zh_TW/gpio.txt +++ b/Documentation/translations/zh_TW/gpio.txt @@ -614,21 +614,3 @@ GPIO 控制器的路徑類似 /sys/class/gpio/gpiochip42/ (對於從#42 GPIO 固定的,例如在擴展卡上的 GPIO會根據所使用的主板或所在堆疊架構中其他的板子而 有所不同。在這種情況下,你可能需要使用 gpiochip 節點(儘可能地結合電路圖)來 確定給定信號所用的 GPIO 編號。 - - -從內核代碼中導出 -------------- -內核代碼可以明確地管理那些已通過 gpio_request()申請的 GPIO 的導出: - - /* 導出 GPIO 到用戶空間 */ - int gpio_export(unsigned gpio, bool direction_may_change); - - /* gpio_export()的逆操作 */ - void gpio_unexport(); - -在一個內核驅動申請一個 GPIO 之後,它可以通過 gpio_export()使其在 sysfs -接口中可見。該驅動可以控制信號方向是否可修改。這有助於防止用戶空間代碼無意間 -破壞重要的系統狀態。 - -這個明確的導出有助於(通過使某些實驗更容易來)調試,也可以提供一個始終存在的接口, -與文檔配合作爲板級支持包的一部分。 diff --git a/arch/arm/mach-omap2/pdata-quirks.c b/arch/arm/mach-omap2/pdata-quirks.c index baba73fd6f11..04208cc52784 100644 --- a/arch/arm/mach-omap2/pdata-quirks.c +++ b/arch/arm/mach-omap2/pdata-quirks.c @@ -6,6 +6,7 @@ */ #include #include +#include #include #include #include @@ -108,7 +109,7 @@ static int omap3_sbc_t3730_twl_callback(struct device *dev, if (res) return res; - gpio_export(gpio, 0); + gpiod_export(gpio_to_desc(gpio), 0); return 0; } @@ -123,7 +124,7 @@ static void __init omap3_sbc_t3x_usb_hub_init(int gpio, char *hub_name) return; } - gpio_export(gpio, 0); + gpiod_export(gpio_to_desc(gpio), 0); udelay(10); gpio_set_value(gpio, 1); @@ -200,8 +201,8 @@ static void __init omap3_sbc_t3517_wifi_init(void) return; } - gpio_export(cm_t3517_wlan_gpios[0].gpio, 0); - gpio_export(cm_t3517_wlan_gpios[1].gpio, 0); + gpiod_export(gpio_to_desc(cm_t3517_wlan_gpios[0].gpio), 0); + gpiod_export(gpio_to_desc(cm_t3517_wlan_gpios[1].gpio), 0); msleep(100); gpio_set_value(cm_t3517_wlan_gpios[1].gpio, 0); diff --git a/arch/sh/boards/mach-ap325rxa/setup.c b/arch/sh/boards/mach-ap325rxa/setup.c index c77b5f00a66a..151792162152 100644 --- a/arch/sh/boards/mach-ap325rxa/setup.c +++ b/arch/sh/boards/mach-ap325rxa/setup.c @@ -18,6 +18,7 @@ #include #include #include +#include #include #include #include @@ -411,16 +412,16 @@ static int __init ap325rxa_devices_setup(void) /* LD3 and LD4 LEDs */ gpio_request(GPIO_PTX5, NULL); /* RUN */ gpio_direction_output(GPIO_PTX5, 1); - gpio_export(GPIO_PTX5, 0); + gpiod_export(gpio_to_desc(GPIO_PTX5), 0); gpio_request(GPIO_PTX4, NULL); /* INDICATOR */ gpio_direction_output(GPIO_PTX4, 0); - gpio_export(GPIO_PTX4, 0); + gpiod_export(gpio_to_desc(GPIO_PTX4), 0); /* SW1 input */ gpio_request(GPIO_PTF7, NULL); /* MODE */ gpio_direction_input(GPIO_PTF7); - gpio_export(GPIO_PTF7, 0); + gpiod_export(gpio_to_desc(GPIO_PTF7), 0); /* LCDC */ gpio_request(GPIO_FN_LCDD15, NULL); diff --git a/drivers/gpio/gpiolib-sysfs.c b/drivers/gpio/gpiolib-sysfs.c index cd27bf173dec..6e4267944f80 100644 --- a/drivers/gpio/gpiolib-sysfs.c +++ b/drivers/gpio/gpiolib-sysfs.c @@ -491,7 +491,7 @@ static ssize_t unexport_store(struct class *class, goto done; desc = gpio_to_desc(gpio); - /* reject bogus commands (gpio_unexport ignores them) */ + /* reject bogus commands (gpiod_unexport() ignores them) */ if (!desc) { pr_warn("%s: invalid GPIO %ld\n", __func__, gpio); return -EINVAL; @@ -790,7 +790,7 @@ static int __init gpiolib_sysfs_init(void) * early (e.g. before the class_register above was called). * * We run before arch_initcall() so chip->dev nodes can have - * registered, and so arch_initcall() can always gpio_export(). + * registered, and so arch_initcall() can always gpiod_export(). */ spin_lock_irqsave(&gpio_lock, flags); list_for_each_entry(gdev, &gpio_devices, list) { diff --git a/drivers/media/pci/sta2x11/sta2x11_vip.c b/drivers/media/pci/sta2x11/sta2x11_vip.c index 8535e49a4c4f..e4cf9d63e926 100644 --- a/drivers/media/pci/sta2x11/sta2x11_vip.c +++ b/drivers/media/pci/sta2x11/sta2x11_vip.c @@ -18,6 +18,7 @@ #include #include #include +#include #include #include #include @@ -889,6 +890,7 @@ static int sta2x11_vip_init_controls(struct sta2x11_vip *vip) static int vip_gpio_reserve(struct device *dev, int pin, int dir, const char *name) { + struct gpio_desc *desc = gpio_to_desc(pin); int ret = -ENODEV; if (!gpio_is_valid(pin)) @@ -900,7 +902,7 @@ static int vip_gpio_reserve(struct device *dev, int pin, int dir, return ret; } - ret = gpio_direction_output(pin, dir); + ret = gpiod_direction_output(desc, dir); if (ret) { dev_err(dev, "Failed to set direction for pin %d (%s)\n", pin, name); @@ -908,7 +910,7 @@ static int vip_gpio_reserve(struct device *dev, int pin, int dir, return ret; } - ret = gpio_export(pin, false); + ret = gpiod_export(desc, false); if (ret) { dev_err(dev, "Failed to export pin %d (%s)\n", pin, name); gpio_free(pin); @@ -928,8 +930,10 @@ static int vip_gpio_reserve(struct device *dev, int pin, int dir, static void vip_gpio_release(struct device *dev, int pin, const char *name) { if (gpio_is_valid(pin)) { + struct gpio_desc *desc = gpio_to_desc(pin); + dev_dbg(dev, "releasing pin %d (%s)\n", pin, name); - gpio_unexport(pin); + gpiod_unexport(desc); gpio_free(pin); } } diff --git a/drivers/net/ieee802154/ca8210.c b/drivers/net/ieee802154/ca8210.c index e1a569b99e4a..5c0be6a3ec5e 100644 --- a/drivers/net/ieee802154/ca8210.c +++ b/drivers/net/ieee802154/ca8210.c @@ -51,6 +51,7 @@ #include #include #include +#include #include #include #include @@ -2853,7 +2854,7 @@ static int ca8210_interrupt_init(struct spi_device *spi) ); if (ret) { dev_crit(&spi->dev, "request_irq %d failed\n", pdata->irq_id); - gpio_unexport(pdata->gpio_irq); + gpiod_unexport(gpio_to_desc(pdata->gpio_irq)); gpio_free(pdata->gpio_irq); } diff --git a/include/linux/gpio.h b/include/linux/gpio.h index fc56733e8514..a86953696e47 100644 --- a/include/linux/gpio.h +++ b/include/linux/gpio.h @@ -132,20 +132,6 @@ int gpio_request_one(unsigned gpio, unsigned long flags, const char *label); int gpio_request_array(const struct gpio *array, size_t num); void gpio_free_array(const struct gpio *array, size_t num); -/* - * A sysfs interface can be exported by individual drivers if they want, - * but more typically is configured entirely from userspace. - */ -static inline int gpio_export(unsigned gpio, bool direction_may_change) -{ - return gpiod_export(gpio_to_desc(gpio), direction_may_change); -} - -static inline void gpio_unexport(unsigned gpio) -{ - gpiod_unexport(gpio_to_desc(gpio)); -} - /* CONFIG_GPIOLIB: bindings for managed devices that want to request gpios */ struct device; @@ -242,19 +228,6 @@ static inline void gpio_set_value_cansleep(unsigned gpio, int value) WARN_ON(1); } -static inline int gpio_export(unsigned gpio, bool direction_may_change) -{ - /* GPIO can never have been requested or set as {in,out}put */ - WARN_ON(1); - return -EINVAL; -} - -static inline void gpio_unexport(unsigned gpio) -{ - /* GPIO can never have been exported */ - WARN_ON(1); -} - static inline int gpio_to_irq(unsigned gpio) { /* GPIO can never have been requested or set as input */ From patchwork Wed Feb 8 17:33:35 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 13133405 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 69FC2C64EC4 for ; Wed, 8 Feb 2023 17:34:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231938AbjBHReH (ORCPT ); Wed, 8 Feb 2023 12:34:07 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39582 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231636AbjBHRdz (ORCPT ); Wed, 8 Feb 2023 12:33:55 -0500 Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 43B9E34312; Wed, 8 Feb 2023 09:33:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1675877633; x=1707413633; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=NhIi3obsHF0CJ3XpiIKm/sUF6vE8x1aZjthOZQd64ls=; b=DebHyUE3yt6Nycw/GuIeXf73wCOwo5kVCo/mxnNPzm8pYC9gcFm4LmrM CRmJIOnad0aufIhBUavx9vYTNRrl2ZxASWnbPs5QVcEz4mwltDlWmf3d5 veMRswTCRIZuW1dXMRE5Ricqv86YCaF+VKVnieCMsKVX5/7flYL6cTLqP ermNxUba37gWVeLId3/lAdlgggoYxSEKPpsjlqcYAZ1uHS1icDJZh67rH Rj/GTDR/n5u68bV/BnnhpWYjuj4wcL0YHEn/YWO/TAwAd1keyOCaWWjHA oKVJBFtJD9lhTl7wm5wLbO5zuYhiIO6yLrG94TtWsxT6paMV3jx7P16+U g==; X-IronPort-AV: E=McAfee;i="6500,9779,10615"; a="327564176" X-IronPort-AV: E=Sophos;i="5.97,281,1669104000"; d="scan'208";a="327564176" Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Feb 2023 09:33:38 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10615"; a="644938980" X-IronPort-AV: E=Sophos;i="5.97,281,1669104000"; d="scan'208";a="644938980" Received: from black.fi.intel.com ([10.237.72.28]) by orsmga006.jf.intel.com with ESMTP; 08 Feb 2023 09:33:27 -0800 Received: by black.fi.intel.com (Postfix, from userid 1003) id 1E8DC3F1; Wed, 8 Feb 2023 19:33:48 +0200 (EET) From: Andy Shevchenko To: Andy Shevchenko , Arnd Bergmann , Linus Walleij , Bartosz Golaszewski , Tony Lindgren , Thomas Gleixner , Krzysztof Kozlowski , Geert Uytterhoeven , Michael Ellerman , Christophe Leroy , Vincenzo Palazzo , Devarsh Thakkar , Michael Walle , Dmitry Torokhov , Dipen Patel , Thierry Reding , Stefan Schmidt , Miquel Raynal , Lee Jones , linux-gpio@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-doc-tw-discuss@lists.sourceforge.net, linux-arm-kernel@lists.infradead.org, linux-omap@vger.kernel.org, linux-samsung-soc@vger.kernel.org, linux-m68k@lists.linux-m68k.org, linuxppc-dev@lists.ozlabs.org, linux-sh@vger.kernel.org, linux-acpi@vger.kernel.org, linux-tegra@vger.kernel.org, linux-input@vger.kernel.org, linux-media@vger.kernel.org, linux-wpan@vger.kernel.org, netdev@vger.kernel.org, linux-wireless@vger.kernel.org, brcm80211-dev-list.pdl@broadcom.com, SHA-cyfmac-dev-list@infineon.com, linux-arch@vger.kernel.org, devicetree@vger.kernel.org Cc: Bartosz Golaszewski , Jonathan Corbet , Alex Shi , Yanteng Si , Hu Haowen , Russell King , Aaro Koskinen , Janusz Krzysztofik , Andrew Lunn , Sebastian Hesselbarth , Gregory Clement , Alim Akhtar , Nicholas Piggin , Yoshinori Sato , Rich Felker , Mun Yew Tham , Keerthy , Mika Westerberg , Thierry Reding , Jonathan Hunter , Mauro Carvalho Chehab , Alexander Aring , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Arend van Spriel , Franky Lin , Hante Meuleman , Kalle Valo , Qiang Zhao , Li Yang , Rob Herring , Frank Rowand Subject: [PATCH v4 10/18] gpiolib: split linux/gpio/driver.h out of linux/gpio.h Date: Wed, 8 Feb 2023 19:33:35 +0200 Message-Id: <20230208173343.37582-11-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230208173343.37582-1-andriy.shevchenko@linux.intel.com> References: <20230208173343.37582-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org From: Arnd Bergmann Almost all gpio drivers include linux/gpio/driver.h, and other files should not rely on includes from this header. Remove the indirect include from here and include the correct headers directly from where they are used. Reviewed-by: Andy Shevchenko Signed-off-by: Arnd Bergmann Reviewed-by: Linus Walleij Signed-off-by: Andy Shevchenko Acked-by: Lee Jones --- arch/arm/mach-omap1/irq.c | 1 + arch/arm/mach-orion5x/board-rd88f5182.c | 1 + arch/arm/mach-sa1100/assabet.c | 1 + drivers/net/wireless/broadcom/brcm80211/brcmsmac/led.c | 1 + include/linux/mfd/ucb1x00.h | 1 + 5 files changed, 5 insertions(+) diff --git a/arch/arm/mach-omap1/irq.c b/arch/arm/mach-omap1/irq.c index 9ccc784fd614..bfc7ab010ae2 100644 --- a/arch/arm/mach-omap1/irq.c +++ b/arch/arm/mach-omap1/irq.c @@ -41,6 +41,7 @@ #include #include #include +#include #include #include diff --git a/arch/arm/mach-orion5x/board-rd88f5182.c b/arch/arm/mach-orion5x/board-rd88f5182.c index 596601367989..1c14e49a90a6 100644 --- a/arch/arm/mach-orion5x/board-rd88f5182.c +++ b/arch/arm/mach-orion5x/board-rd88f5182.c @@ -9,6 +9,7 @@ #include #include #include +#include #include #include #include diff --git a/arch/arm/mach-sa1100/assabet.c b/arch/arm/mach-sa1100/assabet.c index 2eba112f2ad8..d000c678b439 100644 --- a/arch/arm/mach-sa1100/assabet.c +++ b/arch/arm/mach-sa1100/assabet.c @@ -10,6 +10,7 @@ #include #include #include +#include #include #include #include diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmsmac/led.c b/drivers/net/wireless/broadcom/brcm80211/brcmsmac/led.c index 9540a05247c2..89c8829528c2 100644 --- a/drivers/net/wireless/broadcom/brcm80211/brcmsmac/led.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmsmac/led.c @@ -1,6 +1,7 @@ // SPDX-License-Identifier: GPL-2.0 #include #include +#include #include #include #include diff --git a/include/linux/mfd/ucb1x00.h b/include/linux/mfd/ucb1x00.h index 43bcf35afe27..ede237384723 100644 --- a/include/linux/mfd/ucb1x00.h +++ b/include/linux/mfd/ucb1x00.h @@ -10,6 +10,7 @@ #include #include #include +#include #include #define UCB_IO_DATA 0x00 From patchwork Wed Feb 8 17:33:36 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 13133417 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 543F5C678D5 for ; Wed, 8 Feb 2023 17:35:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230482AbjBHRfj (ORCPT ); Wed, 8 Feb 2023 12:35:39 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41080 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232253AbjBHRer (ORCPT ); Wed, 8 Feb 2023 12:34:47 -0500 Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 46E9051C55; Wed, 8 Feb 2023 09:34:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1675877655; x=1707413655; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=kEzy7E5g++11ZfX8PhOrp7wyzba5U4Amo9sCg/uj/Rc=; b=XpqCxstEoa/bxk4v4nJWDuUgkGkUv6dqmciS+5Lfn2SEJnN5InzbIhDX Gpi5tdY5PLQ0tZcN8eDbdfvx4OIuwwwu6QJA5JC1XfM8Vstzw7/DOhAHc cSWoxx5q2g12nu18S8xMtLBZZ5mL4HFdUyIrdJ2yAQLBX+yLYimMUaTYT ptGMVDgrRRaMbh52wy3GKOkUpl+fBdgyNkGNqkVY8bj16/PIfGRFMYiAm HyuwHf3OG3inVZiKL05rF+SUUK2A5HfX1Lsod64nobG/74o+YjQneoAEV 5XLg/nELrVwbRG0gg5OvYQKutsARDneOHPCdSJB+7dPYL2upPa4qa9aXj Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10615"; a="310225490" X-IronPort-AV: E=Sophos;i="5.97,281,1669104000"; d="scan'208";a="310225490" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Feb 2023 09:33:34 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10615"; a="697723037" X-IronPort-AV: E=Sophos;i="5.97,281,1669104000"; d="scan'208";a="697723037" Received: from black.fi.intel.com ([10.237.72.28]) by orsmga008.jf.intel.com with ESMTP; 08 Feb 2023 09:33:27 -0800 Received: by black.fi.intel.com (Postfix, from userid 1003) id 2D9F9413; Wed, 8 Feb 2023 19:33:48 +0200 (EET) From: Andy Shevchenko To: Andy Shevchenko , Arnd Bergmann , Linus Walleij , Bartosz Golaszewski , Tony Lindgren , Thomas Gleixner , Krzysztof Kozlowski , Geert Uytterhoeven , Michael Ellerman , Christophe Leroy , Vincenzo Palazzo , Devarsh Thakkar , Michael Walle , Dmitry Torokhov , Dipen Patel , Thierry Reding , Stefan Schmidt , Miquel Raynal , Lee Jones , linux-gpio@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-doc-tw-discuss@lists.sourceforge.net, linux-arm-kernel@lists.infradead.org, linux-omap@vger.kernel.org, linux-samsung-soc@vger.kernel.org, linux-m68k@lists.linux-m68k.org, linuxppc-dev@lists.ozlabs.org, linux-sh@vger.kernel.org, linux-acpi@vger.kernel.org, linux-tegra@vger.kernel.org, linux-input@vger.kernel.org, linux-media@vger.kernel.org, linux-wpan@vger.kernel.org, netdev@vger.kernel.org, linux-wireless@vger.kernel.org, brcm80211-dev-list.pdl@broadcom.com, SHA-cyfmac-dev-list@infineon.com, linux-arch@vger.kernel.org, devicetree@vger.kernel.org Cc: Bartosz Golaszewski , Jonathan Corbet , Alex Shi , Yanteng Si , Hu Haowen , Russell King , Aaro Koskinen , Janusz Krzysztofik , Andrew Lunn , Sebastian Hesselbarth , Gregory Clement , Alim Akhtar , Nicholas Piggin , Yoshinori Sato , Rich Felker , Mun Yew Tham , Keerthy , Mika Westerberg , Thierry Reding , Jonathan Hunter , Mauro Carvalho Chehab , Alexander Aring , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Arend van Spriel , Franky Lin , Hante Meuleman , Kalle Valo , Qiang Zhao , Li Yang , Rob Herring , Frank Rowand Subject: [PATCH v4 11/18] gpiolib: split of_mm_gpio_chip out of linux/of_gpio.h Date: Wed, 8 Feb 2023 19:33:36 +0200 Message-Id: <20230208173343.37582-12-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230208173343.37582-1-andriy.shevchenko@linux.intel.com> References: <20230208173343.37582-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org From: Arnd Bergmann This is a rarely used feature that has nothing to do with the client-side of_gpio.h. Split it out with a separate header file and Kconfig option so it can be removed on its own timeline aside from removing the of_gpio consumer interfaces. Reviewed-by: Andy Shevchenko Signed-off-by: Arnd Bergmann Reviewed-by: Linus Walleij Signed-off-by: Andy Shevchenko --- arch/powerpc/platforms/44x/Kconfig | 1 + arch/powerpc/platforms/4xx/gpio.c | 2 +- arch/powerpc/platforms/8xx/Kconfig | 1 + arch/powerpc/platforms/8xx/cpm1.c | 2 +- arch/powerpc/platforms/Kconfig | 2 ++ arch/powerpc/sysdev/cpm_common.c | 2 +- drivers/gpio/Kconfig | 11 +++++++ drivers/gpio/TODO | 15 ++++++--- drivers/gpio/gpio-altera.c | 2 +- drivers/gpio/gpio-mm-lantiq.c | 2 +- drivers/gpio/gpio-mpc5200.c | 2 +- drivers/gpio/gpiolib-of.c | 3 ++ drivers/soc/fsl/qe/gpio.c | 2 +- .../legacy-of-mm-gpiochip.h} | 33 +++---------------- include/linux/of_gpio.h | 21 ------------ 15 files changed, 40 insertions(+), 61 deletions(-) copy include/linux/{of_gpio.h => gpio/legacy-of-mm-gpiochip.h} (50%) diff --git a/arch/powerpc/platforms/44x/Kconfig b/arch/powerpc/platforms/44x/Kconfig index 25b80cd558f8..1624ebf95497 100644 --- a/arch/powerpc/platforms/44x/Kconfig +++ b/arch/powerpc/platforms/44x/Kconfig @@ -230,6 +230,7 @@ config PPC4xx_GPIO bool "PPC4xx GPIO support" depends on 44x select GPIOLIB + select OF_GPIO_MM_GPIOCHIP help Enable gpiolib support for ppc440 based boards diff --git a/arch/powerpc/platforms/4xx/gpio.c b/arch/powerpc/platforms/4xx/gpio.c index 49ee8d365852..e5f2319e5cbe 100644 --- a/arch/powerpc/platforms/4xx/gpio.c +++ b/arch/powerpc/platforms/4xx/gpio.c @@ -14,7 +14,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/arch/powerpc/platforms/8xx/Kconfig b/arch/powerpc/platforms/8xx/Kconfig index 60cc5b537a98..a14d9d8997a4 100644 --- a/arch/powerpc/platforms/8xx/Kconfig +++ b/arch/powerpc/platforms/8xx/Kconfig @@ -101,6 +101,7 @@ comment "Generic MPC8xx Options" config 8xx_GPIO bool "GPIO API Support" select GPIOLIB + select OF_GPIO_MM_GPIOCHIP help Saying Y here will cause the ports on an MPC8xx processor to be used with the GPIO API. If you say N here, the kernel needs less memory. diff --git a/arch/powerpc/platforms/8xx/cpm1.c b/arch/powerpc/platforms/8xx/cpm1.c index bb38c8d8f8de..56ca14f77543 100644 --- a/arch/powerpc/platforms/8xx/cpm1.c +++ b/arch/powerpc/platforms/8xx/cpm1.c @@ -44,7 +44,7 @@ #include #ifdef CONFIG_8xx_GPIO -#include +#include #endif #define CPM_MAP_SIZE (0x4000) diff --git a/arch/powerpc/platforms/Kconfig b/arch/powerpc/platforms/Kconfig index d41dad227de8..8e4bbd19dec5 100644 --- a/arch/powerpc/platforms/Kconfig +++ b/arch/powerpc/platforms/Kconfig @@ -244,6 +244,7 @@ config QE_GPIO bool "QE GPIO support" depends on QUICC_ENGINE select GPIOLIB + select OF_GPIO_MM_GPIOCHIP help Say Y here if you're going to use hardware that connects to the QE GPIOs. @@ -254,6 +255,7 @@ config CPM2 select CPM select HAVE_PCI select GPIOLIB + select OF_GPIO_MM_GPIOCHIP help The CPM2 (Communications Processor Module) is a coprocessor on embedded CPUs made by Freescale. Selecting this option means that diff --git a/arch/powerpc/sysdev/cpm_common.c b/arch/powerpc/sysdev/cpm_common.c index 7dc1960f8bdb..8234013a8772 100644 --- a/arch/powerpc/sysdev/cpm_common.c +++ b/arch/powerpc/sysdev/cpm_common.c @@ -31,7 +31,7 @@ #include #if defined(CONFIG_CPM2) || defined(CONFIG_8xx_GPIO) -#include +#include #endif static int __init cpm_init(void) diff --git a/drivers/gpio/Kconfig b/drivers/gpio/Kconfig index 06a268d56800..178025ca3b34 100644 --- a/drivers/gpio/Kconfig +++ b/drivers/gpio/Kconfig @@ -39,6 +39,14 @@ config GPIOLIB_IRQCHIP select IRQ_DOMAIN bool +config OF_GPIO_MM_GPIOCHIP + bool + help + This adds support for the legacy 'struct of_mm_gpio_chip' interface + from PowerPC. Existing drivers using this interface need to select + this symbol, but new drivers should use the generic gpio-regmap + infrastructure instead. + config DEBUG_GPIO bool "Debug GPIO calls" depends on DEBUG_KERNEL @@ -131,6 +139,7 @@ config GPIO_ALTERA tristate "Altera GPIO" depends on OF_GPIO select GPIOLIB_IRQCHIP + select OF_GPIO_MM_GPIOCHIP help Say Y or M here to build support for the Altera PIO device. @@ -403,6 +412,7 @@ config GPIO_MENZ127 config GPIO_MM_LANTIQ bool "Lantiq Memory mapped GPIOs" depends on LANTIQ && SOC_XWAY + select OF_GPIO_MM_GPIOCHIP help This enables support for memory mapped GPIOs on the External Bus Unit (EBU) found on Lantiq SoCs. The GPIOs are output only as they are @@ -411,6 +421,7 @@ config GPIO_MM_LANTIQ config GPIO_MPC5200 def_bool y depends on PPC_MPC52xx + select OF_GPIO_MM_GPIOCHIP config GPIO_MPC8XXX bool "MPC512x/MPC8xxx/QorIQ GPIO support" diff --git a/drivers/gpio/TODO b/drivers/gpio/TODO index 68ada1066941..189c3abe7e79 100644 --- a/drivers/gpio/TODO +++ b/drivers/gpio/TODO @@ -59,11 +59,6 @@ the device tree back-end. It is legacy and should not be used in new code. Work items: -- Get rid of struct of_mm_gpio_chip altogether: use the generic MMIO - GPIO for all current users (see below). Delete struct of_mm_gpio_chip, - to_of_mm_gpio_chip(), of_mm_gpiochip_add_data(), of_mm_gpiochip_remove() - from the kernel. - - Change all consumer drivers that #include to #include and stop doing custom parsing of the GPIO lines from the device tree. This can be tricky and often ivolves @@ -81,6 +76,16 @@ Work items: uses or instead. +Get rid of + +Work items: + +- Get rid of struct of_mm_gpio_chip altogether: use the generic MMIO + GPIO for all current users (see below). Delete struct of_mm_gpio_chip, + to_of_mm_gpio_chip(), of_mm_gpiochip_add_data(), of_mm_gpiochip_remove(), + CONFIG_OF_GPIO_MM_GPIOCHIP from the kernel. + + Get rid of This legacy header is a one stop shop for anything GPIO is closely tied diff --git a/drivers/gpio/gpio-altera.c b/drivers/gpio/gpio-altera.c index b59fae993626..99e137f8097e 100644 --- a/drivers/gpio/gpio-altera.c +++ b/drivers/gpio/gpio-altera.c @@ -7,7 +7,7 @@ #include #include #include -#include /* For of_mm_gpio_chip */ +#include #include #define ALTERA_GPIO_MAX_NGPIO 32 diff --git a/drivers/gpio/gpio-mm-lantiq.c b/drivers/gpio/gpio-mm-lantiq.c index 538e31fe8903..27ff84c5d162 100644 --- a/drivers/gpio/gpio-mm-lantiq.c +++ b/drivers/gpio/gpio-mm-lantiq.c @@ -10,8 +10,8 @@ #include #include #include +#include #include -#include #include #include diff --git a/drivers/gpio/gpio-mpc5200.c b/drivers/gpio/gpio-mpc5200.c index 000494e0c533..3b0bfff8c778 100644 --- a/drivers/gpio/gpio-mpc5200.c +++ b/drivers/gpio/gpio-mpc5200.c @@ -8,7 +8,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/drivers/gpio/gpiolib-of.c b/drivers/gpio/gpiolib-of.c index 266352b1a966..0f699af438b0 100644 --- a/drivers/gpio/gpiolib-of.c +++ b/drivers/gpio/gpiolib-of.c @@ -892,6 +892,8 @@ static int of_gpio_simple_xlate(struct gpio_chip *gc, return gpiospec->args[0]; } +#if IS_ENABLED(CONFIG_OF_GPIO_MM_GPIOCHIP) +#include /** * of_mm_gpiochip_add_data - Add memory mapped GPIO chip (bank) * @np: device node of the GPIO chip @@ -964,6 +966,7 @@ void of_mm_gpiochip_remove(struct of_mm_gpio_chip *mm_gc) kfree(gc->label); } EXPORT_SYMBOL_GPL(of_mm_gpiochip_remove); +#endif #ifdef CONFIG_PINCTRL static int of_gpiochip_add_pin_range(struct gpio_chip *chip) diff --git a/drivers/soc/fsl/qe/gpio.c b/drivers/soc/fsl/qe/gpio.c index 1c41eb49d5a7..3ef24ba0245b 100644 --- a/drivers/soc/fsl/qe/gpio.c +++ b/drivers/soc/fsl/qe/gpio.c @@ -13,7 +13,7 @@ #include #include #include -#include /* for of_mm_gpio_chip */ +#include #include #include #include diff --git a/include/linux/of_gpio.h b/include/linux/gpio/legacy-of-mm-gpiochip.h similarity index 50% copy from include/linux/of_gpio.h copy to include/linux/gpio/legacy-of-mm-gpiochip.h index 5d58b3b0a97e..2e2bd3b19cc3 100644 --- a/include/linux/of_gpio.h +++ b/include/linux/gpio/legacy-of-mm-gpiochip.h @@ -1,26 +1,19 @@ /* SPDX-License-Identifier: GPL-2.0+ */ /* - * OF helpers for the GPIO API + * OF helpers for the old of_mm_gpio_chip, used on ppc32 and nios2, + * do not use in new code. * * Copyright (c) 2007-2008 MontaVista Software, Inc. * * Author: Anton Vorontsov */ -#ifndef __LINUX_OF_GPIO_H -#define __LINUX_OF_GPIO_H +#ifndef __LINUX_GPIO_LEGACY_OF_MM_GPIO_CHIP_H +#define __LINUX_GPIO_LEGACY_OF_MM_GPIO_CHIP_H -#include #include -#include /* FIXME: Shouldn't be here */ #include -struct device_node; - -#ifdef CONFIG_OF_GPIO - -#include - /* * OF GPIO chip for memory mapped banks */ @@ -35,25 +28,9 @@ static inline struct of_mm_gpio_chip *to_of_mm_gpio_chip(struct gpio_chip *gc) return container_of(gc, struct of_mm_gpio_chip, gc); } -extern int of_get_named_gpio(const struct device_node *np, - const char *list_name, int index); - extern int of_mm_gpiochip_add_data(struct device_node *np, struct of_mm_gpio_chip *mm_gc, void *data); extern void of_mm_gpiochip_remove(struct of_mm_gpio_chip *mm_gc); -#else /* CONFIG_OF_GPIO */ - -#include - -/* Drivers may not strictly depend on the GPIO support, so let them link. */ -static inline int of_get_named_gpio(const struct device_node *np, - const char *propname, int index) -{ - return -ENOSYS; -} - -#endif /* CONFIG_OF_GPIO */ - -#endif /* __LINUX_OF_GPIO_H */ +#endif /* __LINUX_GPIO_LEGACY_OF_MM_GPIO_CHIP_H */ diff --git a/include/linux/of_gpio.h b/include/linux/of_gpio.h index 5d58b3b0a97e..d0f66a5e1b2a 100644 --- a/include/linux/of_gpio.h +++ b/include/linux/of_gpio.h @@ -19,30 +19,9 @@ struct device_node; #ifdef CONFIG_OF_GPIO -#include - -/* - * OF GPIO chip for memory mapped banks - */ -struct of_mm_gpio_chip { - struct gpio_chip gc; - void (*save_regs)(struct of_mm_gpio_chip *mm_gc); - void __iomem *regs; -}; - -static inline struct of_mm_gpio_chip *to_of_mm_gpio_chip(struct gpio_chip *gc) -{ - return container_of(gc, struct of_mm_gpio_chip, gc); -} - extern int of_get_named_gpio(const struct device_node *np, const char *list_name, int index); -extern int of_mm_gpiochip_add_data(struct device_node *np, - struct of_mm_gpio_chip *mm_gc, - void *data); -extern void of_mm_gpiochip_remove(struct of_mm_gpio_chip *mm_gc); - #else /* CONFIG_OF_GPIO */ #include From patchwork Wed Feb 8 17:33:37 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 13133418 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 723D3C64ED8 for ; Wed, 8 Feb 2023 17:37:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232306AbjBHRhV (ORCPT ); Wed, 8 Feb 2023 12:37:21 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41166 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232347AbjBHRfR (ORCPT ); Wed, 8 Feb 2023 12:35:17 -0500 Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E2426521C5; Wed, 8 Feb 2023 09:34:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1675877661; x=1707413661; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=n2JggXg7c02DPXLMJdm8s8NdvcTFU3e1l9o8DD11R0M=; b=X7f85Vxx/Hn3PnDto19T+XrM/QOOPDVWCTLm3J1fG7AVSbRrmciKKHNT ssWP4CF+FRdHrKDQY75DSJbs161yEsQsLcoRnisbqrqaz+dyUTpYBvpHV HhXicoRrD7LXVF0fyNfUIzzKsDBBz35wTc3c8M+WN6MN0QGV16hYQAI8a AWXgMLVje7vzVbI4BSIoZevk8cw9YOeDuBbH67M51SWPX4b1V/NLzLpTu dWlfo38rgEB65h5YQxwDO8F8rxyzVOtAqAegZHEC3AsjDyIu9N+qEjAUQ P/doaAULEIWMelrbOdZoNorTqLHyhNS/noUD4yi8JuYLvw9LxGr8f14Q/ A==; X-IronPort-AV: E=McAfee;i="6500,9779,10615"; a="310225504" X-IronPort-AV: E=Sophos;i="5.97,281,1669104000"; d="scan'208";a="310225504" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Feb 2023 09:33:34 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10615"; a="660703959" X-IronPort-AV: E=Sophos;i="5.97,281,1669104000"; d="scan'208";a="660703959" Received: from black.fi.intel.com ([10.237.72.28]) by orsmga007.jf.intel.com with ESMTP; 08 Feb 2023 09:33:28 -0800 Received: by black.fi.intel.com (Postfix, from userid 1003) id 3C05D4BE; Wed, 8 Feb 2023 19:33:48 +0200 (EET) From: Andy Shevchenko To: Andy Shevchenko , Arnd Bergmann , Linus Walleij , Bartosz Golaszewski , Tony Lindgren , Thomas Gleixner , Krzysztof Kozlowski , Geert Uytterhoeven , Michael Ellerman , Christophe Leroy , Vincenzo Palazzo , Devarsh Thakkar , Michael Walle , Dmitry Torokhov , Dipen Patel , Thierry Reding , Stefan Schmidt , Miquel Raynal , Lee Jones , linux-gpio@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-doc-tw-discuss@lists.sourceforge.net, linux-arm-kernel@lists.infradead.org, linux-omap@vger.kernel.org, linux-samsung-soc@vger.kernel.org, linux-m68k@lists.linux-m68k.org, linuxppc-dev@lists.ozlabs.org, linux-sh@vger.kernel.org, linux-acpi@vger.kernel.org, linux-tegra@vger.kernel.org, linux-input@vger.kernel.org, linux-media@vger.kernel.org, linux-wpan@vger.kernel.org, netdev@vger.kernel.org, linux-wireless@vger.kernel.org, brcm80211-dev-list.pdl@broadcom.com, SHA-cyfmac-dev-list@infineon.com, linux-arch@vger.kernel.org, devicetree@vger.kernel.org Cc: Bartosz Golaszewski , Jonathan Corbet , Alex Shi , Yanteng Si , Hu Haowen , Russell King , Aaro Koskinen , Janusz Krzysztofik , Andrew Lunn , Sebastian Hesselbarth , Gregory Clement , Alim Akhtar , Nicholas Piggin , Yoshinori Sato , Rich Felker , Mun Yew Tham , Keerthy , Mika Westerberg , Thierry Reding , Jonathan Hunter , Mauro Carvalho Chehab , Alexander Aring , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Arend van Spriel , Franky Lin , Hante Meuleman , Kalle Valo , Qiang Zhao , Li Yang , Rob Herring , Frank Rowand , Geert Uytterhoeven Subject: [PATCH v4 12/18] gpio: aggregator: Add missing header(s) Date: Wed, 8 Feb 2023 19:33:37 +0200 Message-Id: <20230208173343.37582-13-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230208173343.37582-1-andriy.shevchenko@linux.intel.com> References: <20230208173343.37582-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org Do not imply that some of the generic headers may be always included. Instead, include explicitly what we are direct user of. While at it, drop unused linux/gpio.h and split out the GPIO group of headers. Signed-off-by: Andy Shevchenko Reviewed-by: Geert Uytterhoeven Reviewed-by: Linus Walleij --- drivers/gpio/gpio-aggregator.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/drivers/gpio/gpio-aggregator.c b/drivers/gpio/gpio-aggregator.c index 6d17d262ad91..20a686f12df7 100644 --- a/drivers/gpio/gpio-aggregator.c +++ b/drivers/gpio/gpio-aggregator.c @@ -10,19 +10,20 @@ #include #include #include -#include -#include -#include -#include #include #include #include #include #include #include +#include #include #include +#include +#include +#include + #define AGGREGATOR_MAX_GPIOS 512 /* From patchwork Wed Feb 8 17:33:38 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 13133419 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1DD53C64EC6 for ; Wed, 8 Feb 2023 17:38:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231612AbjBHRi2 (ORCPT ); Wed, 8 Feb 2023 12:38:28 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43102 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231476AbjBHRga (ORCPT ); Wed, 8 Feb 2023 12:36:30 -0500 Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 63C2D518F2; Wed, 8 Feb 2023 09:34:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1675877674; x=1707413674; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=EMgvq11k4/U6XFohBqROl1X58vyMfMqw1Azfwz74ROY=; b=haEigy/Lzq+JALE56XmDxz8TTzPL6dsPMH8Gqt9PT3JBcfByNqsG0Eoh 7c0cOOu+803/oo1u3wTRkJT+k9Wi3I5gWYPwJ1cdmusmJZlCeDJ7bSOMy qjF262DcxGIWFdHcAMYM+R6lgMl/vOFLiU8lB+QZag9Gg40Ivx6K8RRhT FMlvEuPWe5knibKT2rpl//1+3g18/NYc72Ur3SJr+7L9ViN8ND9Q9Xv4z cFIhWXHA6E2wiV4M/L9WLjXfVilJI29xb5q2z8pW3VCwJbqCPtji1KpWl apVuDtpF/lGj4q5d5xNQJH2VO+xJVvU6U6yeEJIfVF2sdLoJqavwGgDGy g==; X-IronPort-AV: E=McAfee;i="6500,9779,10615"; a="310225532" X-IronPort-AV: E=Sophos;i="5.97,281,1669104000"; d="scan'208";a="310225532" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Feb 2023 09:33:36 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10615"; a="660703963" X-IronPort-AV: E=Sophos;i="5.97,281,1669104000"; d="scan'208";a="660703963" Received: from black.fi.intel.com ([10.237.72.28]) by orsmga007.jf.intel.com with ESMTP; 08 Feb 2023 09:33:28 -0800 Received: by black.fi.intel.com (Postfix, from userid 1003) id 4A69C4C9; Wed, 8 Feb 2023 19:33:48 +0200 (EET) From: Andy Shevchenko To: Andy Shevchenko , Arnd Bergmann , Linus Walleij , Bartosz Golaszewski , Tony Lindgren , Thomas Gleixner , Krzysztof Kozlowski , Geert Uytterhoeven , Michael Ellerman , Christophe Leroy , Vincenzo Palazzo , Devarsh Thakkar , Michael Walle , Dmitry Torokhov , Dipen Patel , Thierry Reding , Stefan Schmidt , Miquel Raynal , Lee Jones , linux-gpio@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-doc-tw-discuss@lists.sourceforge.net, linux-arm-kernel@lists.infradead.org, linux-omap@vger.kernel.org, linux-samsung-soc@vger.kernel.org, linux-m68k@lists.linux-m68k.org, linuxppc-dev@lists.ozlabs.org, linux-sh@vger.kernel.org, linux-acpi@vger.kernel.org, linux-tegra@vger.kernel.org, linux-input@vger.kernel.org, linux-media@vger.kernel.org, linux-wpan@vger.kernel.org, netdev@vger.kernel.org, linux-wireless@vger.kernel.org, brcm80211-dev-list.pdl@broadcom.com, SHA-cyfmac-dev-list@infineon.com, linux-arch@vger.kernel.org, devicetree@vger.kernel.org Cc: Bartosz Golaszewski , Jonathan Corbet , Alex Shi , Yanteng Si , Hu Haowen , Russell King , Aaro Koskinen , Janusz Krzysztofik , Andrew Lunn , Sebastian Hesselbarth , Gregory Clement , Alim Akhtar , Nicholas Piggin , Yoshinori Sato , Rich Felker , Mun Yew Tham , Keerthy , Mika Westerberg , Thierry Reding , Jonathan Hunter , Mauro Carvalho Chehab , Alexander Aring , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Arend van Spriel , Franky Lin , Hante Meuleman , Kalle Valo , Qiang Zhao , Li Yang , Rob Herring , Frank Rowand Subject: [PATCH v4 13/18] gpio: reg: Add missing header(s) Date: Wed, 8 Feb 2023 19:33:38 +0200 Message-Id: <20230208173343.37582-14-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230208173343.37582-1-andriy.shevchenko@linux.intel.com> References: <20230208173343.37582-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org Do not imply that some of the generic headers may be always included. Instead, include explicitly what we are direct user of. While at it, split out the GPIO group of headers. Signed-off-by: Andy Shevchenko Reviewed-by: Linus Walleij --- drivers/gpio/gpio-reg.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/drivers/gpio/gpio-reg.c b/drivers/gpio/gpio-reg.c index d35169bde25a..73c7260d89c0 100644 --- a/drivers/gpio/gpio-reg.c +++ b/drivers/gpio/gpio-reg.c @@ -4,11 +4,19 @@ * * Copyright (C) 2016 Russell King */ -#include -#include +#include +#include +#include +#include +#include #include +#include #include #include +#include + +#include +#include struct gpio_reg { struct gpio_chip gc; From patchwork Wed Feb 8 17:33:39 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 13133420 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1F129C64ED6 for ; Wed, 8 Feb 2023 17:39:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231980AbjBHRjF (ORCPT ); Wed, 8 Feb 2023 12:39:05 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44216 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232077AbjBHRhS (ORCPT ); Wed, 8 Feb 2023 12:37:18 -0500 Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 344E0518F9; Wed, 8 Feb 2023 09:34:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1675877679; x=1707413679; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=OVTbdvlRwsSopBDkL3jXldnhlbwob+iYhRWLjAyRiyk=; b=lnttRk7c08jxjxkk3U+5stJriBVtv9hXLP5p5YzZ9vgXaDLD3XmnlNtB L6Rc+FROFzFjNhI/Q7X11tQ88k0QNfOjTVxNB8qaOI6Tzy+kw/IREzI2U 4nzMEIKH2JrkGJ84Fbn2UZW7OL0mYxii8TFCvw8x8Njw0E5iLQ0atC8Zo BJiE4RTCuBACtkyR9cA7dhOCpZSe6N7RkdtPJbONvUUV98RUk2pxrbkDA UxLCbvPiPIZ74HuxiHdg2EJicKGt1wtec8iTVQqjt3YbjbAx6Xo40ZTaA yNm7WK34v6d+MNVcbL4mtsM+ukOecy7kaUoI/mbmMjswLDPAID/hZ/ZF4 g==; X-IronPort-AV: E=McAfee;i="6500,9779,10615"; a="310225528" X-IronPort-AV: E=Sophos;i="5.97,281,1669104000"; d="scan'208";a="310225528" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Feb 2023 09:33:35 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10615"; a="660703962" X-IronPort-AV: E=Sophos;i="5.97,281,1669104000"; d="scan'208";a="660703962" Received: from black.fi.intel.com ([10.237.72.28]) by orsmga007.jf.intel.com with ESMTP; 08 Feb 2023 09:33:28 -0800 Received: by black.fi.intel.com (Postfix, from userid 1003) id 59E79556; Wed, 8 Feb 2023 19:33:48 +0200 (EET) From: Andy Shevchenko To: Andy Shevchenko , Arnd Bergmann , Linus Walleij , Bartosz Golaszewski , Tony Lindgren , Thomas Gleixner , Krzysztof Kozlowski , Geert Uytterhoeven , Michael Ellerman , Christophe Leroy , Vincenzo Palazzo , Devarsh Thakkar , Michael Walle , Dmitry Torokhov , Dipen Patel , Thierry Reding , Stefan Schmidt , Miquel Raynal , Lee Jones , linux-gpio@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-doc-tw-discuss@lists.sourceforge.net, linux-arm-kernel@lists.infradead.org, linux-omap@vger.kernel.org, linux-samsung-soc@vger.kernel.org, linux-m68k@lists.linux-m68k.org, linuxppc-dev@lists.ozlabs.org, linux-sh@vger.kernel.org, linux-acpi@vger.kernel.org, linux-tegra@vger.kernel.org, linux-input@vger.kernel.org, linux-media@vger.kernel.org, linux-wpan@vger.kernel.org, netdev@vger.kernel.org, linux-wireless@vger.kernel.org, brcm80211-dev-list.pdl@broadcom.com, SHA-cyfmac-dev-list@infineon.com, linux-arch@vger.kernel.org, devicetree@vger.kernel.org Cc: Bartosz Golaszewski , Jonathan Corbet , Alex Shi , Yanteng Si , Hu Haowen , Russell King , Aaro Koskinen , Janusz Krzysztofik , Andrew Lunn , Sebastian Hesselbarth , Gregory Clement , Alim Akhtar , Nicholas Piggin , Yoshinori Sato , Rich Felker , Mun Yew Tham , Keerthy , Mika Westerberg , Thierry Reding , Jonathan Hunter , Mauro Carvalho Chehab , Alexander Aring , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Arend van Spriel , Franky Lin , Hante Meuleman , Kalle Valo , Qiang Zhao , Li Yang , Rob Herring , Frank Rowand Subject: [PATCH v4 14/18] gpio: regmap: Add missing header(s) Date: Wed, 8 Feb 2023 19:33:39 +0200 Message-Id: <20230208173343.37582-15-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230208173343.37582-1-andriy.shevchenko@linux.intel.com> References: <20230208173343.37582-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org Do not imply that some of the generic headers may be always included. Instead, include explicitly what we are direct user of. While at it, split out the GPIO group of headers. Signed-off-by: Andy Shevchenko Reviewed-by: Linus Walleij --- drivers/gpio/gpio-regmap.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/drivers/gpio/gpio-regmap.c b/drivers/gpio/gpio-regmap.c index fca17d478984..c08c8e528867 100644 --- a/drivers/gpio/gpio-regmap.c +++ b/drivers/gpio/gpio-regmap.c @@ -5,11 +5,17 @@ * Copyright 2020 Michael Walle */ -#include -#include -#include +#include +#include +#include +#include #include #include +#include +#include + +#include +#include struct gpio_regmap { struct device *parent; From patchwork Wed Feb 8 17:33:40 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 13133404 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 054ECC64EC6 for ; Wed, 8 Feb 2023 17:34:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231928AbjBHReG (ORCPT ); Wed, 8 Feb 2023 12:34:06 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39640 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231674AbjBHRd7 (ORCPT ); Wed, 8 Feb 2023 12:33:59 -0500 Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C55583BDBB; Wed, 8 Feb 2023 09:33:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1675877636; x=1707413636; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=89Ua2SwK+9eoP7ii20ihjA/BcfunvekbP9EUK6guMxA=; b=CAjO61dTj7RKn2EJPQPpYHblquK/iyxwSeG3cmPJ0pAUNVnazJySNx1M 6iaB7lyI2IKcgwEKsQuDIz88j5w9q+MNpmC3D3IxTTEXjzxAW1ca7R6pn EACwyaxMcQXGXN/ZbJMb02iHPuR1m3gmvhtlv+GamSjTwE+qwpGyDQDf0 1v/Az6fO/9P7jzEKHJk3arvoS9eKLPOeyOzPlNUt3EUmU0q/fRXmw9ZsT 7GuOL+KSgWY0ZehkRZ0Wggj3e0pGLu8NW2TTKHWQJKv8RhfyMKguGZsjv 5ZN2zzF5jVi5RlnsYc/Ntg7Vw9JsxIm+Skmd5WDNusaAim6GLUuRzxRY7 A==; X-IronPort-AV: E=McAfee;i="6500,9779,10615"; a="327564277" X-IronPort-AV: E=Sophos;i="5.97,281,1669104000"; d="scan'208";a="327564277" Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Feb 2023 09:33:39 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10615"; a="644939003" X-IronPort-AV: E=Sophos;i="5.97,281,1669104000"; d="scan'208";a="644939003" Received: from black.fi.intel.com ([10.237.72.28]) by orsmga006.jf.intel.com with ESMTP; 08 Feb 2023 09:33:29 -0800 Received: by black.fi.intel.com (Postfix, from userid 1003) id 694D3590; Wed, 8 Feb 2023 19:33:48 +0200 (EET) From: Andy Shevchenko To: Andy Shevchenko , Arnd Bergmann , Linus Walleij , Bartosz Golaszewski , Tony Lindgren , Thomas Gleixner , Krzysztof Kozlowski , Geert Uytterhoeven , Michael Ellerman , Christophe Leroy , Vincenzo Palazzo , Devarsh Thakkar , Michael Walle , Dmitry Torokhov , Dipen Patel , Thierry Reding , Stefan Schmidt , Miquel Raynal , Lee Jones , linux-gpio@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-doc-tw-discuss@lists.sourceforge.net, linux-arm-kernel@lists.infradead.org, linux-omap@vger.kernel.org, linux-samsung-soc@vger.kernel.org, linux-m68k@lists.linux-m68k.org, linuxppc-dev@lists.ozlabs.org, linux-sh@vger.kernel.org, linux-acpi@vger.kernel.org, linux-tegra@vger.kernel.org, linux-input@vger.kernel.org, linux-media@vger.kernel.org, linux-wpan@vger.kernel.org, netdev@vger.kernel.org, linux-wireless@vger.kernel.org, brcm80211-dev-list.pdl@broadcom.com, SHA-cyfmac-dev-list@infineon.com, linux-arch@vger.kernel.org, devicetree@vger.kernel.org Cc: Bartosz Golaszewski , Jonathan Corbet , Alex Shi , Yanteng Si , Hu Haowen , Russell King , Aaro Koskinen , Janusz Krzysztofik , Andrew Lunn , Sebastian Hesselbarth , Gregory Clement , Alim Akhtar , Nicholas Piggin , Yoshinori Sato , Rich Felker , Mun Yew Tham , Keerthy , Mika Westerberg , Thierry Reding , Jonathan Hunter , Mauro Carvalho Chehab , Alexander Aring , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Arend van Spriel , Franky Lin , Hante Meuleman , Kalle Valo , Qiang Zhao , Li Yang , Rob Herring , Frank Rowand Subject: [PATCH v4 15/18] gpiolib: Drop unused forward declaration from driver.h Date: Wed, 8 Feb 2023 19:33:40 +0200 Message-Id: <20230208173343.37582-16-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230208173343.37582-1-andriy.shevchenko@linux.intel.com> References: <20230208173343.37582-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org There is no struct device_node pointers anywhere in the header, drop unused forward declaration. Signed-off-by: Andy Shevchenko --- include/linux/gpio/driver.h | 1 - 1 file changed, 1 deletion(-) diff --git a/include/linux/gpio/driver.h b/include/linux/gpio/driver.h index ccd8a512d854..262a84ce9bcb 100644 --- a/include/linux/gpio/driver.h +++ b/include/linux/gpio/driver.h @@ -16,7 +16,6 @@ struct gpio_desc; struct of_phandle_args; -struct device_node; struct seq_file; struct gpio_device; struct module; From patchwork Wed Feb 8 17:33:41 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 13133407 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E9F8BC7618A for ; Wed, 8 Feb 2023 17:34:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231961AbjBHReJ (ORCPT ); Wed, 8 Feb 2023 12:34:09 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39706 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231875AbjBHReD (ORCPT ); Wed, 8 Feb 2023 12:34:03 -0500 Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 759F24390F; Wed, 8 Feb 2023 09:33:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1675877640; x=1707413640; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=YtyTSKv3igoWzjKzirfnsuSbOV1zJhPUEQxw+fpoykQ=; b=HcHdtHAkD7WCj8eQy/VW/Ke/F2a37B7t3bwc6m4fdR6abo7QVBUCdDBi AScQ/paiga1eP1Uf4il4g4usjc6Qh8JP1bOWAIB4GTPMx8SCPdQ17qqCF FQ+fPPL5KE3J3n4Jn24C/9+R4F40PQtkpGsHTsxwV8dIEj8tGLkHx3bCO xXLyfBFfWeNa5vkatuivEutt5MFt5pa3DnbQ5XYz6GV46uw/2ORttJ9Po eLW2v11AzRk4shNsYLosOxbSfsvv8c3OxFmL+JsybMIovZ6HDDaI/lylA 5G0SL5PgW1RL+oBRB2aGiHK2FZpBEvdEIVEA9sfZ2OSkG7nRNM9ufPhSF A==; X-IronPort-AV: E=McAfee;i="6500,9779,10615"; a="331153853" X-IronPort-AV: E=Sophos;i="5.97,281,1669104000"; d="scan'208";a="331153853" Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Feb 2023 09:33:39 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10615"; a="669265907" X-IronPort-AV: E=Sophos;i="5.97,281,1669104000"; d="scan'208";a="669265907" Received: from black.fi.intel.com ([10.237.72.28]) by fmsmga007.fm.intel.com with ESMTP; 08 Feb 2023 09:33:33 -0800 Received: by black.fi.intel.com (Postfix, from userid 1003) id 78A38591; Wed, 8 Feb 2023 19:33:48 +0200 (EET) From: Andy Shevchenko To: Andy Shevchenko , Arnd Bergmann , Linus Walleij , Bartosz Golaszewski , Tony Lindgren , Thomas Gleixner , Krzysztof Kozlowski , Geert Uytterhoeven , Michael Ellerman , Christophe Leroy , Vincenzo Palazzo , Devarsh Thakkar , Michael Walle , Dmitry Torokhov , Dipen Patel , Thierry Reding , Stefan Schmidt , Miquel Raynal , Lee Jones , linux-gpio@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-doc-tw-discuss@lists.sourceforge.net, linux-arm-kernel@lists.infradead.org, linux-omap@vger.kernel.org, linux-samsung-soc@vger.kernel.org, linux-m68k@lists.linux-m68k.org, linuxppc-dev@lists.ozlabs.org, linux-sh@vger.kernel.org, linux-acpi@vger.kernel.org, linux-tegra@vger.kernel.org, linux-input@vger.kernel.org, linux-media@vger.kernel.org, linux-wpan@vger.kernel.org, netdev@vger.kernel.org, linux-wireless@vger.kernel.org, brcm80211-dev-list.pdl@broadcom.com, SHA-cyfmac-dev-list@infineon.com, linux-arch@vger.kernel.org, devicetree@vger.kernel.org Cc: Bartosz Golaszewski , Jonathan Corbet , Alex Shi , Yanteng Si , Hu Haowen , Russell King , Aaro Koskinen , Janusz Krzysztofik , Andrew Lunn , Sebastian Hesselbarth , Gregory Clement , Alim Akhtar , Nicholas Piggin , Yoshinori Sato , Rich Felker , Mun Yew Tham , Keerthy , Mika Westerberg , Thierry Reding , Jonathan Hunter , Mauro Carvalho Chehab , Alexander Aring , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Arend van Spriel , Franky Lin , Hante Meuleman , Kalle Valo , Qiang Zhao , Li Yang , Rob Herring , Frank Rowand Subject: [PATCH v4 16/18] gpiolib: Deduplicate forward declarations in consumer.h Date: Wed, 8 Feb 2023 19:33:41 +0200 Message-Id: <20230208173343.37582-17-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230208173343.37582-1-andriy.shevchenko@linux.intel.com> References: <20230208173343.37582-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org The struct fwnode_handle pointer is used in both branches of ifdeffery, no need to have a copy of the same in each of them, just make it global. Signed-off-by: Andy Shevchenko Reviewed-by: Linus Walleij --- include/linux/gpio/consumer.h | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/include/linux/gpio/consumer.h b/include/linux/gpio/consumer.h index 59cb20cfac3d..a7eb8aa1e54c 100644 --- a/include/linux/gpio/consumer.h +++ b/include/linux/gpio/consumer.h @@ -8,6 +8,7 @@ #include struct device; +struct fwnode_handle; struct gpio_desc; struct gpio_array; @@ -171,9 +172,6 @@ int gpiod_set_consumer_name(struct gpio_desc *desc, const char *name); struct gpio_desc *gpio_to_desc(unsigned gpio); int desc_to_gpio(const struct gpio_desc *desc); -/* Child properties interface */ -struct fwnode_handle; - struct gpio_desc *fwnode_gpiod_get_index(struct fwnode_handle *fwnode, const char *con_id, int index, enum gpiod_flags flags, @@ -546,9 +544,6 @@ static inline int desc_to_gpio(const struct gpio_desc *desc) return -EINVAL; } -/* Child properties interface */ -struct fwnode_handle; - static inline struct gpio_desc *fwnode_gpiod_get_index(struct fwnode_handle *fwnode, const char *con_id, int index, From patchwork Wed Feb 8 17:33:42 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 13133421 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 34127C677F1 for ; Wed, 8 Feb 2023 17:39:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232165AbjBHRjM (ORCPT ); Wed, 8 Feb 2023 12:39:12 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41592 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232276AbjBHRhT (ORCPT ); Wed, 8 Feb 2023 12:37:19 -0500 Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D892A4FCD2; Wed, 8 Feb 2023 09:34:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1675877693; x=1707413693; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=e2HL48VZL68iHiIHMOw3KrWX1/vewPFZgcuY53UtAyY=; b=l9kBc6ecKaMlTDOULFJKH75BwvzcZqOlVEmLmZyQ657FKD3DJmTv8w4o 51Kt99bJ1adqroS5+79UnJdbandYrBEH5JF+Em857/IwF+V7HPHGEVdVp 9Fk6ngQoeTwSyaLAJyJOb4qUi+nhKA271wH1tlf954ivjJ0XkTkWkMtod L8jAysB3kAtMAACuWaVma3l8pSjAe5HfBgI4v6BSuEXCYWur/ctaM9ro+ NznYIZ29gp8X+lnI/fUp3vpgO9L5WkYVGWmvutj7tgESsLTQd/MUtcwdR sESI3qzdsJRp0kMcKf7QApqJ0QgoiQMrGAAsDkACajih2C1qjS90NuBDk g==; X-IronPort-AV: E=McAfee;i="6500,9779,10615"; a="310225579" X-IronPort-AV: E=Sophos;i="5.97,281,1669104000"; d="scan'208";a="310225579" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Feb 2023 09:33:39 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10615"; a="697723055" X-IronPort-AV: E=Sophos;i="5.97,281,1669104000"; d="scan'208";a="697723055" Received: from black.fi.intel.com ([10.237.72.28]) by orsmga008.jf.intel.com with ESMTP; 08 Feb 2023 09:33:34 -0800 Received: by black.fi.intel.com (Postfix, from userid 1003) id 873635CC; Wed, 8 Feb 2023 19:33:48 +0200 (EET) From: Andy Shevchenko To: Andy Shevchenko , Arnd Bergmann , Linus Walleij , Bartosz Golaszewski , Tony Lindgren , Thomas Gleixner , Krzysztof Kozlowski , Geert Uytterhoeven , Michael Ellerman , Christophe Leroy , Vincenzo Palazzo , Devarsh Thakkar , Michael Walle , Dmitry Torokhov , Dipen Patel , Thierry Reding , Stefan Schmidt , Miquel Raynal , Lee Jones , linux-gpio@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-doc-tw-discuss@lists.sourceforge.net, linux-arm-kernel@lists.infradead.org, linux-omap@vger.kernel.org, linux-samsung-soc@vger.kernel.org, linux-m68k@lists.linux-m68k.org, linuxppc-dev@lists.ozlabs.org, linux-sh@vger.kernel.org, linux-acpi@vger.kernel.org, linux-tegra@vger.kernel.org, linux-input@vger.kernel.org, linux-media@vger.kernel.org, linux-wpan@vger.kernel.org, netdev@vger.kernel.org, linux-wireless@vger.kernel.org, brcm80211-dev-list.pdl@broadcom.com, SHA-cyfmac-dev-list@infineon.com, linux-arch@vger.kernel.org, devicetree@vger.kernel.org Cc: Bartosz Golaszewski , Jonathan Corbet , Alex Shi , Yanteng Si , Hu Haowen , Russell King , Aaro Koskinen , Janusz Krzysztofik , Andrew Lunn , Sebastian Hesselbarth , Gregory Clement , Alim Akhtar , Nicholas Piggin , Yoshinori Sato , Rich Felker , Mun Yew Tham , Keerthy , Mika Westerberg , Thierry Reding , Jonathan Hunter , Mauro Carvalho Chehab , Alexander Aring , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Arend van Spriel , Franky Lin , Hante Meuleman , Kalle Valo , Qiang Zhao , Li Yang , Rob Herring , Frank Rowand Subject: [PATCH v4 17/18] gpiolib: Group forward declarations in consumer.h Date: Wed, 8 Feb 2023 19:33:42 +0200 Message-Id: <20230208173343.37582-18-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230208173343.37582-1-andriy.shevchenko@linux.intel.com> References: <20230208173343.37582-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org For better maintenance group the forward declarations together. Signed-off-by: Andy Shevchenko Reviewed-by: Linus Walleij --- include/linux/gpio/consumer.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/include/linux/gpio/consumer.h b/include/linux/gpio/consumer.h index a7eb8aa1e54c..5432e5d5fbfb 100644 --- a/include/linux/gpio/consumer.h +++ b/include/linux/gpio/consumer.h @@ -7,6 +7,7 @@ #include #include +struct acpi_device; struct device; struct fwnode_handle; struct gpio_desc; @@ -602,8 +603,6 @@ struct acpi_gpio_mapping { unsigned int quirks; }; -struct acpi_device; - #if IS_ENABLED(CONFIG_GPIOLIB) && IS_ENABLED(CONFIG_ACPI) int acpi_dev_add_driver_gpios(struct acpi_device *adev, From patchwork Wed Feb 8 17:33:43 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 13133422 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id CD330C64EC7 for ; Wed, 8 Feb 2023 17:39:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232318AbjBHRjj (ORCPT ); Wed, 8 Feb 2023 12:39:39 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44188 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231670AbjBHRib (ORCPT ); Wed, 8 Feb 2023 12:38:31 -0500 Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 75CFC521EA; Wed, 8 Feb 2023 09:35:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1675877711; x=1707413711; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=+wJ1YEr+a1gEPzvL6ED5LpiCM/LRrff7/mLXvqmfqJk=; b=asRprENOSKcB9AYxsKinm4HWkVFwO6+VDa/IjMd+cwRO+fyjMXOPfvt1 rORoz7wQg/0U97n1kwE3mn3KnOqNviespGwBNVyOORuCfRxScDCZVTehf qfoaqLmgMzO83lKkppd/6zwWLJFC+gZxFmcbDjO/3PbTwLUpX4W7d8Tez 232LM19uy7bOlkw9YEPQeAO9muEvF+BbD2kvlIRpDXUkMYOGLATJP9HK0 IECzzXp/n/PYrmzW8Gapag7K4Du2tlooqKyxGTGIOlJUTbHdqgdpzbc8Y ZMViBYoHMPOH1TdlhCbQF4DNE6wIEobyjSydjPm8Jdiuc9GnZhsKJ9b8e Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10615"; a="310225592" X-IronPort-AV: E=Sophos;i="5.97,281,1669104000"; d="scan'208";a="310225592" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Feb 2023 09:33:40 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10615"; a="697723056" X-IronPort-AV: E=Sophos;i="5.97,281,1669104000"; d="scan'208";a="697723056" Received: from black.fi.intel.com ([10.237.72.28]) by orsmga008.jf.intel.com with ESMTP; 08 Feb 2023 09:33:34 -0800 Received: by black.fi.intel.com (Postfix, from userid 1003) id 95C0B612; Wed, 8 Feb 2023 19:33:48 +0200 (EET) From: Andy Shevchenko To: Andy Shevchenko , Arnd Bergmann , Linus Walleij , Bartosz Golaszewski , Tony Lindgren , Thomas Gleixner , Krzysztof Kozlowski , Geert Uytterhoeven , Michael Ellerman , Christophe Leroy , Vincenzo Palazzo , Devarsh Thakkar , Michael Walle , Dmitry Torokhov , Dipen Patel , Thierry Reding , Stefan Schmidt , Miquel Raynal , Lee Jones , linux-gpio@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-doc-tw-discuss@lists.sourceforge.net, linux-arm-kernel@lists.infradead.org, linux-omap@vger.kernel.org, linux-samsung-soc@vger.kernel.org, linux-m68k@lists.linux-m68k.org, linuxppc-dev@lists.ozlabs.org, linux-sh@vger.kernel.org, linux-acpi@vger.kernel.org, linux-tegra@vger.kernel.org, linux-input@vger.kernel.org, linux-media@vger.kernel.org, linux-wpan@vger.kernel.org, netdev@vger.kernel.org, linux-wireless@vger.kernel.org, brcm80211-dev-list.pdl@broadcom.com, SHA-cyfmac-dev-list@infineon.com, linux-arch@vger.kernel.org, devicetree@vger.kernel.org Cc: Bartosz Golaszewski , Jonathan Corbet , Alex Shi , Yanteng Si , Hu Haowen , Russell King , Aaro Koskinen , Janusz Krzysztofik , Andrew Lunn , Sebastian Hesselbarth , Gregory Clement , Alim Akhtar , Nicholas Piggin , Yoshinori Sato , Rich Felker , Mun Yew Tham , Keerthy , Mika Westerberg , Thierry Reding , Jonathan Hunter , Mauro Carvalho Chehab , Alexander Aring , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Arend van Spriel , Franky Lin , Hante Meuleman , Kalle Valo , Qiang Zhao , Li Yang , Rob Herring , Frank Rowand Subject: [PATCH v4 18/18] gpiolib: Clean up headers Date: Wed, 8 Feb 2023 19:33:43 +0200 Message-Id: <20230208173343.37582-19-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230208173343.37582-1-andriy.shevchenko@linux.intel.com> References: <20230208173343.37582-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org There is a few things done: - include only the headers we are direct user of - when pointer is in use, provide a forward declaration - add missing headers - group generic headers and subsystem headers - sort each group alphabetically Signed-off-by: Andy Shevchenko Reviewed-by: Linus Walleij --- drivers/gpio/gpiolib-acpi.c | 10 ++++++---- drivers/gpio/gpiolib-acpi.h | 1 - drivers/gpio/gpiolib-of.c | 6 ++++-- drivers/gpio/gpiolib-of.h | 1 - drivers/gpio/gpiolib-swnode.c | 5 +++-- drivers/gpio/gpiolib-sysfs.c | 21 ++++++++++++++++----- drivers/gpio/gpiolib.c | 9 ++++++--- include/linux/gpio.h | 10 ++++------ include/linux/gpio/consumer.h | 14 ++++++++++---- include/linux/gpio/driver.h | 30 +++++++++++++++++++++++------- 10 files changed, 72 insertions(+), 35 deletions(-) diff --git a/drivers/gpio/gpiolib-acpi.c b/drivers/gpio/gpiolib-acpi.c index bb583cea366c..3871dade186a 100644 --- a/drivers/gpio/gpiolib-acpi.c +++ b/drivers/gpio/gpiolib-acpi.c @@ -7,17 +7,19 @@ * Mika Westerberg */ +#include #include #include -#include -#include -#include #include -#include #include +#include #include #include +#include +#include +#include + #include "gpiolib.h" #include "gpiolib-acpi.h" diff --git a/drivers/gpio/gpiolib-acpi.h b/drivers/gpio/gpiolib-acpi.h index 5fa315b3c912..a6f3be0bb921 100644 --- a/drivers/gpio/gpiolib-acpi.h +++ b/drivers/gpio/gpiolib-acpi.h @@ -9,7 +9,6 @@ #define GPIOLIB_ACPI_H #include -#include #include #include diff --git a/drivers/gpio/gpiolib-of.c b/drivers/gpio/gpiolib-of.c index 0f699af438b0..1436cdb5fa26 100644 --- a/drivers/gpio/gpiolib-of.c +++ b/drivers/gpio/gpiolib-of.c @@ -10,14 +10,16 @@ #include #include #include -#include #include -#include +#include #include #include #include #include #include +#include + +#include #include #include "gpiolib.h" diff --git a/drivers/gpio/gpiolib-of.h b/drivers/gpio/gpiolib-of.h index e5bb065d82ef..6b3a5347c5d9 100644 --- a/drivers/gpio/gpiolib-of.h +++ b/drivers/gpio/gpiolib-of.h @@ -4,7 +4,6 @@ #define GPIOLIB_OF_H #include -#include #include #include diff --git a/drivers/gpio/gpiolib-swnode.c b/drivers/gpio/gpiolib-swnode.c index dd9ccac214d1..b5a6eaf3729b 100644 --- a/drivers/gpio/gpiolib-swnode.c +++ b/drivers/gpio/gpiolib-swnode.c @@ -6,13 +6,14 @@ */ #include #include -#include -#include #include #include #include #include +#include +#include + #include "gpiolib.h" #include "gpiolib-swnode.h" diff --git a/drivers/gpio/gpiolib-sysfs.c b/drivers/gpio/gpiolib-sysfs.c index 6e4267944f80..c1cbf71329f0 100644 --- a/drivers/gpio/gpiolib-sysfs.c +++ b/drivers/gpio/gpiolib-sysfs.c @@ -1,18 +1,29 @@ // SPDX-License-Identifier: GPL-2.0 + +#include +#include #include +#include +#include +#include +#include +#include #include -#include +#include +#include +#include +#include #include +#include + #include #include -#include -#include -#include -#include #include "gpiolib.h" #include "gpiolib-sysfs.h" +struct kernfs_node; + #define GPIO_IRQF_TRIGGER_NONE 0 #define GPIO_IRQF_TRIGGER_FALLING BIT(0) #define GPIO_IRQF_TRIGGER_RISING BIT(1) diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c index 99a2c77c3711..900f6573c070 100644 --- a/drivers/gpio/gpiolib.c +++ b/drivers/gpio/gpiolib.c @@ -6,22 +6,25 @@ #include #include #include +#include #include #include -#include -#include -#include #include #include #include #include #include #include +#include #include #include #include #include +#include +#include +#include + #include #include "gpiolib-acpi.h" diff --git a/include/linux/gpio.h b/include/linux/gpio.h index a86953696e47..8528353e073b 100644 --- a/include/linux/gpio.h +++ b/include/linux/gpio.h @@ -12,9 +12,10 @@ #ifndef __LINUX_GPIO_H #define __LINUX_GPIO_H -#include #include +struct device; + /* see Documentation/driver-api/gpio/legacy.rst */ /* make these flag values available regardless of GPIO kconfig options */ @@ -134,19 +135,16 @@ void gpio_free_array(const struct gpio *array, size_t num); /* CONFIG_GPIOLIB: bindings for managed devices that want to request gpios */ -struct device; - int devm_gpio_request(struct device *dev, unsigned gpio, const char *label); int devm_gpio_request_one(struct device *dev, unsigned gpio, unsigned long flags, const char *label); #else /* ! CONFIG_GPIOLIB */ -#include #include -struct device; -struct gpio_chip; +#include +#include static inline bool gpio_is_valid(int number) { diff --git a/include/linux/gpio/consumer.h b/include/linux/gpio/consumer.h index 5432e5d5fbfb..1c4385a00f88 100644 --- a/include/linux/gpio/consumer.h +++ b/include/linux/gpio/consumer.h @@ -3,15 +3,14 @@ #define __LINUX_GPIO_CONSUMER_H #include -#include -#include -#include +#include struct acpi_device; struct device; struct fwnode_handle; -struct gpio_desc; + struct gpio_array; +struct gpio_desc; /** * struct gpio_descs - Struct containing an array of descriptors that can be @@ -185,8 +184,11 @@ struct gpio_desc *devm_fwnode_gpiod_get_index(struct device *dev, #else /* CONFIG_GPIOLIB */ +#include #include +#include + static inline int gpiod_count(struct device *dev, const char *con_id) { return 0; @@ -616,6 +618,8 @@ struct gpio_desc *acpi_get_and_request_gpiod(char *path, unsigned int pin, char #else /* CONFIG_GPIOLIB && CONFIG_ACPI */ +#include + static inline int acpi_dev_add_driver_gpios(struct acpi_device *adev, const struct acpi_gpio_mapping *gpios) { @@ -647,6 +651,8 @@ void gpiod_unexport(struct gpio_desc *desc); #else /* CONFIG_GPIOLIB && CONFIG_GPIO_SYSFS */ +#include + static inline int gpiod_export(struct gpio_desc *desc, bool direction_may_change) { diff --git a/include/linux/gpio/driver.h b/include/linux/gpio/driver.h index 262a84ce9bcb..5c6db5533be6 100644 --- a/include/linux/gpio/driver.h +++ b/include/linux/gpio/driver.h @@ -2,27 +2,35 @@ #ifndef __LINUX_GPIO_DRIVER_H #define __LINUX_GPIO_DRIVER_H -#include -#include +#include #include #include +#include #include #include #include #include +#include #include +#ifdef CONFIG_GENERIC_MSI_IRQ #include +#endif -struct gpio_desc; +struct device; +struct irq_chip; +struct irq_data; +struct module; struct of_phandle_args; +struct pinctrl_dev; struct seq_file; -struct gpio_device; -struct module; -enum gpiod_flags; -enum gpio_lookup_flags; struct gpio_chip; +struct gpio_desc; +struct gpio_device; + +enum gpio_lookup_flags; +enum gpiod_flags; union gpio_irq_fwspec { struct irq_fwspec fwspec; @@ -679,6 +687,10 @@ bool gpiochip_irqchip_irq_valid(const struct gpio_chip *gc, int gpiochip_irqchip_add_domain(struct gpio_chip *gc, struct irq_domain *domain); #else + +#include +#include + static inline int gpiochip_irqchip_add_domain(struct gpio_chip *gc, struct irq_domain *domain) { @@ -756,6 +768,10 @@ struct gpio_chip *gpiod_to_chip(const struct gpio_desc *desc); #else /* CONFIG_GPIOLIB */ +#include + +#include + static inline struct gpio_chip *gpiod_to_chip(const struct gpio_desc *desc) { /* GPIO can never have been requested */