Received: by 2002:a05:6358:45e:b0:b5:b6eb:e1f9 with SMTP id 30csp1874079rwe; Fri, 2 Sep 2022 05:21:56 -0700 (PDT) X-Google-Smtp-Source: AA6agR6/uowee2EiFhIF6koi+StLLgRydVWYrPTVALwGwjs1+fZGbRB1zB4ODDAla38IXr6xlUz5 X-Received: by 2002:a65:5c82:0:b0:42b:b14:7b4a with SMTP id a2-20020a655c82000000b0042b0b147b4amr29361693pgt.588.1662121316666; Fri, 02 Sep 2022 05:21:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662121316; cv=none; d=google.com; s=arc-20160816; b=MMDgUAGcLq0VRJh2M+lP1AKJlTBmQm96wDp/8E7lTRFf2aqnf/feSZqZWg4C6vSL42 UnburvbX01UT8Qpi3e0E1v9iL3P7mTrqqW176wbYrFbBll5QUP9EHvVQL879CnW2topL N9diiCO29Au33GwAn9GIFIadBHAQ2q4XKlfvTTuESE57Dn982goFpwKye21IiXwqrZWy AVpxGd2v8xLsRjJCsh5jtLVwdqlYuyoqmjOwZbzpg6K3nL0ufRw/tcsLEhz9GfsPvcf6 OGA/nv/Fs1yxz9CM3OzyWNCqbhDkCQgzoDjfMvNg1Zss8AMC4A445BogQmhnHhUacsiO 35Jg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:subject:cc:to:from:date:references:in-reply-to :message-id:mime-version:user-agent:feedback-id:dkim-signature :dkim-signature; bh=ZOo52ojNLD+QQW1owuGlJGIJHO9inLm8ClF8VUiGMYc=; b=p8RZDiD9EuCq1oAEv9xYy7u1FCCm4zOiG9Pf2TOoksKUp2rAvqy01bVU7VUr+7h4cr EK+jVF6X0yYEsQsNwKVUWksUPet9ETCQWPis42IvQZPFiTaw/C14uncE8dGqUim3S5og dRFLhs2IxtAss3mD1hUxKKTZAcBNkNB/FJTuUUmgxDDHqy2E6VSU6ilZWOKwRGRPWekO mXHeAlpZmoDRYtAt1fB9pWnTgAH7eirVrRJgutz0bm4SJqF6vayoIiZzya/D83acudSm 38v/cRtiiQfe4Z7UCVOvLVIPOpj0LO2Z1sQA6WcK3lIZKLbn+bFtPvspnF/2etHnJ8xa PlwQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@arndb.de header.s=fm1 header.b=Q5LypI9J; dkim=pass header.i=@messagingengine.com header.s=i56a14606.fm1 header.b=RiVPKGcU; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id bd9-20020a056a00278900b0052e57ed915asi2074178pfb.233.2022.09.02.05.21.44; Fri, 02 Sep 2022 05:21:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@arndb.de header.s=fm1 header.b=Q5LypI9J; dkim=pass header.i=@messagingengine.com header.s=i56a14606.fm1 header.b=RiVPKGcU; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235606AbiIBMBA (ORCPT + 99 others); Fri, 2 Sep 2022 08:01:00 -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 X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW,SPF_HELO_PASS, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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