From mboxrd@z Thu Jan 1 00:00:00 1970 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 8D39BC38145 for ; Fri, 2 Sep 2022 12:01:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235485AbiIBMA5 (ORCPT ); Fri, 2 Sep 2022 08:00:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39872 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235614AbiIBMAw (ORCPT ); Fri, 2 Sep 2022 08:00:52 -0400 Received: from new4-smtp.messagingengine.com (new4-smtp.messagingengine.com [66.111.4.230]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2CBF932EE9; Fri, 2 Sep 2022 05:00:48 -0700 (PDT) Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailnew.nyi.internal (Postfix) with ESMTP id 05520580E63; Fri, 2 Sep 2022 08:00:45 -0400 (EDT) Received: from imap51 ([10.202.2.101]) by compute3.internal (MEProxy); Fri, 02 Sep 2022 08:00:45 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arndb.de; h=cc :cc:content-type:date:date:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to; s=fm1; t=1662120045; x=1662123645; bh=ZOo52ojNLD +QQW1owuGlJGIJHO9inLm8ClF8VUiGMYc=; b=Q5LypI9JctwwOK78feEceNVi9z mxfNcLR/Jr4MB9NTHeYJiHLefznX6HqRh6CiZvo1s/eRDzJ670NSZN2e2i+Fc7t/ ZdFzJtd0Ct06j6/lCrkdTQuc7BEdm0b726E16z+A38p/+rOnXKPeMSAnC7pozGyS 6LHwx11Ik1NmqfJlvPhWnbaw5ebEDvsbNdMkZN8g4WOrGEsqQWCRtu6Nc+KKLiho MkqZpq7U0aQ2IjWx4UFJNZkc169bO+S4kLlj7u9QlxTpC3Q48s5HY7A4wJHVAWsN uviiLlU190bmFHfBqdbNuWPA9Bl/oorH0qcnJRzDoDZTEOzV99ax1d6g+CXQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:date:date:feedback-id :feedback-id:from:from:in-reply-to:in-reply-to:message-id :mime-version:references:reply-to:sender:subject:subject:to:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= i56a14606.fm1; t=1662120045; x=1662123645; bh=ZOo52ojNLD+QQW1owu GlJGIJHO9inLm8ClF8VUiGMYc=; b=RiVPKGcUZp5HCdJHIyJkhIwH94i5ibwBiY oIFBEtvkT5pEFqhCw8suvvo7zv+tFQylSuIgMGfzqvRjfMsr09J8LJ25TAG4A1Og ZvgL5Yawofqm5gp1rqdKtCSfr5Y6feD3oZ+Xcs2wJcvV9YKY7FblBQlDZYdj18F+ ieBUJRAGKot6vy/iMUWaAxvCiXfr7dD2j3nweX3d+fo89N6tfjQufBXjRjzYiNr0 0swaOd8oblHwLSMK5LzNxEFrmHggOx0jKAYA/QZ0/nnsRPklrgz1CDkNYwUqhZ6h D8bKPP++xX+JoFHh4uBKaHJJsbmr46Yeuoj//lmBLDDq0srXLCQQ== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedrvdeltddggeelucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepofgfggfkjghffffhvfevufgtsehttdertderredtnecuhfhrohhmpedftehr nhguuceuvghrghhmrghnnhdfuceorghrnhgusegrrhhnuggsrdguvgeqnecuggftrfgrth htvghrnhepffehueegteeihfegtefhjefgtdeugfegjeelheejueethfefgeeghfektdek teffnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomheprg hrnhgusegrrhhnuggsrdguvg X-ME-Proxy: Feedback-ID: i56a14606:Fastmail Received: by mailuser.nyi.internal (Postfix, from userid 501) id 83F4AB60083; Fri, 2 Sep 2022 08:00:42 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.7.0-alpha0-841-g7899e99a45-fm-20220811.002-g7899e99a Mime-Version: 1.0 Message-Id: <254b7b9d-72b7-4b3a-821a-51a2745ebac5@www.fastmail.com> In-Reply-To: References: <18cda49e-84f0-a806-566a-6e77705e98b3@csgroup.eu> <1d548a19-feec-42b9-944d-890d6dde2fb8@www.fastmail.com> Date: Fri, 02 Sep 2022 14:00:21 +0200 From: "Arnd Bergmann" To: "Andy Shevchenko" , =?UTF-8?Q?Nuno_S=C3=A1?= Cc: "Christophe Leroy" , "Linus Walleij" , "Bartosz Golaszewski" , "Geert Uytterhoeven" , Keerthy , "Russell King" , "Jonathan Corbet" , "Thomas Gleixner" , "Ingo Molnar" , "Borislav Petkov" , "Dave Hansen" , "H. Peter Anvin" , "Catalin Marinas" , "Will Deacon" , "Linux Kernel Mailing List" , "open list:GPIO SUBSYSTEM" , "linux-arm Mailing List" , Linux-Arch , "Linux Documentation List" , "maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT)" Subject: Re: [PATCH v1 4/8] gpiolib: Get rid of ARCH_NR_GPIOS Content-Type: text/plain Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org On Fri, Sep 2, 2022, at 12:52 PM, Andy Shevchenko wrote: > On Wed, Aug 31, 2022 at 11:55 PM Arnd Bergmann wrote: > > ... > >> drivers/gpio/gpio-adp5520.c: gc->base = pdata->gpio_start; // unused >> drivers/gpio/gpio-adp5588.c: gc->base = pdata->gpio_start; // unused >> drivers/input/keyboard/adp5588-keys.c: kpad->gc.base = gpio_data->gpio_start; // unused >> drivers/input/keyboard/adp5589-keys.c: kpad->gc.base = gpio_data->gpio_start; // unused > > I believe we should convert them to -1. This is probably something we should do separately, but a lot of the drivers currently don't have support for probing from DT or any other firmware interface but rely on platform_data definitions from a board file that was never part of the upstream kernel. We are going to remove a lot more board files early next year, and I was hoping to follow up with a treewide cleanup of such drivers and remove a lot of them entirely. >> drivers/gpio/gpio-dwapb.c: port->gc.base = pp->gpio_base; // from DT, deprecated > > From board files, since some platforms expect a fixed number for it. >> drivers/gpio/gpio-pca953x.c: gc->base = chip->gpio_start; // ???? used a lot > > To answer this one needs to go via all board files (most of them ARM > 32-bit based) and look, but it means almost the same case as per Intel > above: 512-ngpios. Right, I went through all the board files the other drivers, this one just happens to be used more than the others: arch/arm/mach-davinci/board-da850-evm.c:#include arch/arm/mach-ep93xx/vision_ep9307.c:#include arch/arm/mach-mmp/ttc_dkb.c:#include arch/arm/mach-pxa/cm-x300.c:#include arch/arm/mach-pxa/spitz.c:#include arch/arm/mach-pxa/zeus.c:#include arch/arm/mach-pxa/zylonite_pxa300.c:#include arch/arm/mach-s3c/mach-crag6410.c:#include The only ones that have known users though are crag6410 and vision_ep9307, the other ones will be removed. Vision-ep9307 has 128 GPIOs total, crag6410 is complicated because it many different GPIO controllers in various combinations. >> drivers/pinctrl/renesas/gpio.c: gc->base = pfc->nr_gpio_pins; // ??? don't understand > > I think, w/o looking into the code, that this just guarantees the > continuous numbering for all banks (chips) on the platform. Yes, that seems to be the idea most of the pinctrl drivers. Arnd