Received: by 2002:a05:6358:45e:b0:b5:b6eb:e1f9 with SMTP id 30csp1803576rwe; Fri, 2 Sep 2022 04:14:04 -0700 (PDT) X-Google-Smtp-Source: AA6agR64oC+p/e3EalZeCsUuqAxtVP96y7sNlXQfyEYbHsh1XOPQ80GHlJ7AqhuX8sBbwN5we+mv X-Received: by 2002:a05:6402:2949:b0:445:dc8d:44d with SMTP id ed9-20020a056402294900b00445dc8d044dmr32852092edb.60.1662117244304; Fri, 02 Sep 2022 04:14:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662117244; cv=none; d=google.com; s=arc-20160816; b=klAfe3Ox3R3+lGjvlZ3FgzubiH8YGCTU+WbssX1bbjadWojWkzUY71yb4/U0NaVk2j NeerLEl+W/KLMTcGaPx7qsMpV6q9T+KXBF4/Ts1dEHZWmanq9JPcBl+TMlse6Fs6Sa/U gK2q1X4mIZ43YVcB+MucZP+Edd9nqxrJB6NZ9rlsDxg5c2Ryxh+aWUpac2OmAhdGRPg2 2h2DDQL5N5gTi3kKwl/wjThLqclkOc+idLDpWRZfFPNMntMRYl6hKrHMF1xTggvxT66a yVQ5X6lerfN106In9gN4XDfvNVlQpw3hbesqCNB79T2HEay9+W7b1LqS8KVsDvWJW79G VP6Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=LGFWBpXGuGtPPFnyd0g7vGaOWidpAnEGhpM4DC7jOvU=; b=R0COrTl0UvFtj1Th/7SILoi4EtHF9HKsKDokdxZSm+CsbxupCB3+nNV+VGRedneAYY 34KT8PNtO12iG+rnt/DERq95b6OS87NchmWWni19x/V+Kbp9MkL/slsx3850tsqK2SL/ +mjhSwbzO4pu2jnlr7Tk5pcCoRE0VQLTdJqK9XOXfsDoUN+Fn9XXb0t+DOTt32Jn1N9l Io+eVQFZL6Yr4Ij+lQAVgyQfiisw+sh/8XonTj8IXFvBHBdAOpKmrwQe1h/kKHvmMXbA L/AnTL7U7DmqTUKIqW1g3ueMhQZjw0iIx7ogn8OFBq2LsBAm/HexOoQ9zzbJYroZGoK5 tQNA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=LQN7OCs8; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q11-20020a056402518b00b004483940b2b5si1775225edd.234.2022.09.02.04.13.36; Fri, 02 Sep 2022 04:14:04 -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=@gmail.com header.s=20210112 header.b=LQN7OCs8; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235770AbiIBKxS (ORCPT + 99 others); Fri, 2 Sep 2022 06:53:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55656 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229506AbiIBKxQ (ORCPT ); Fri, 2 Sep 2022 06:53:16 -0400 Received: from mail-qk1-x730.google.com (mail-qk1-x730.google.com [IPv6:2607:f8b0:4864:20::730]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6CF86C1654; Fri, 2 Sep 2022 03:53:15 -0700 (PDT) Received: by mail-qk1-x730.google.com with SMTP id a15so1382719qko.4; Fri, 02 Sep 2022 03:53:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date; bh=LGFWBpXGuGtPPFnyd0g7vGaOWidpAnEGhpM4DC7jOvU=; b=LQN7OCs87Q7FvHg8zuWABcEGqqz46CqxTMRZgyCtFDODSb4aVWVzKKohKOgRl80nJQ 3spxwhsHptQb3FfaknuK3qJ2w88ZZWKvYPfc2VxtDO/D0gdhOozb5J6r+Oo9IzNxE/rx Qb1sZBiUmNMkxx8aF76b2JC4VpOqEjdYVudd4SNZj8Xrw8zWXOB9GS8rdGCh2DTuHblJ vV3E2ybZjvQB8RmXY0WMy+cGrX+b/po/PdVaYB4V8cOkE7joBx5w3pNcefJG1ET2t9iX 8H/vWMl5LY3DoWaSMWGnmWDP2ps2UvRIVihRRM8lsil/jHehr/FiS+RVEsBDAeSnp3MH TQKw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date; bh=LGFWBpXGuGtPPFnyd0g7vGaOWidpAnEGhpM4DC7jOvU=; b=Sx70aaKIwg98GcRDq/GKz8FCd5KIBwCYH858x0AuxaWji8lC571/Nhodwp5XDdDxas fx9WD+iwGIKVNtPTuXufXbhS6y8qbYzFOE2E8kNBN957w64+9l95GDvWWB9E5hFGWjCe BIs/GFs3Xe5v+0DA6taxcBibxoA1WUDLSNMAxCnWUh1awyCm2O/tGJaqaB6QzBp5u7CJ pEAxNbw7uFccZD/fVrpto28ZbbgQl2XOSiBlwpciRug4tqFLwc3VWQkch8aMrl5FbFy0 dR5Nd0QW9NsAUu7mKmYUql4KuyT7FUo2Zhx7bLGejgEDgrVjF4p6l7KDLrSNvitwmnAA mDXg== X-Gm-Message-State: ACgBeo2vOiO71O3YG1jZDzuXRvUxy5QyyOs6gPW4SyxglbORQmnJEPib 3RboByMKXCpR2RGT8mfMB+4sNCGC7hXuOcCJ1H0= X-Received: by 2002:a05:620a:254d:b0:6ab:84b8:25eb with SMTP id s13-20020a05620a254d00b006ab84b825ebmr22678075qko.383.1662115994453; Fri, 02 Sep 2022 03:53:14 -0700 (PDT) MIME-Version: 1.0 References: <18cda49e-84f0-a806-566a-6e77705e98b3@csgroup.eu> <1d548a19-feec-42b9-944d-890d6dde2fb8@www.fastmail.com> In-Reply-To: <1d548a19-feec-42b9-944d-890d6dde2fb8@www.fastmail.com> From: Andy Shevchenko Date: Fri, 2 Sep 2022 13:52:37 +0300 Message-ID: Subject: Re: [PATCH v1 4/8] gpiolib: Get rid of ARCH_NR_GPIOS To: Arnd Bergmann , =?UTF-8?B?TnVubyBTw6E=?= 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)" Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,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 (Nuno, one point below for you) 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. > drivers/gpio/gpio-bt8xx.c: c->base = modparam_gpiobase; // from modprobe > drivers/gpio/gpio-ich.c: chip->base = modparam_gpiobase; // from modprobe I believe it was designed for Intel hardware and so it can't be higher than 512 - ngpios, where the latter one is small enough (dozen or a couple of dozens of pins). > 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-mockup.c: gc->base = base; // module parama This is for testing, so the test cases should be amended accordingly. But I think the module itself is deprecated, and gpio-sim seems not using it as a modprobe parameter, but rather as configfs. > 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. > 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. > drivers/pinctrl/stm32/pinctrl-stm32.c: bank->gpio_chip.base = args.args[1]; Device Tree?! -- With Best Regards, Andy Shevchenko