[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <254b7b9d-72b7-4b3a-821a-51a2745ebac5@www.fastmail.com>
Date: Fri, 02 Sep 2022 14:00:21 +0200
From: "Arnd Bergmann" <arnd@...db.de>
To: "Andy Shevchenko" <andy.shevchenko@...il.com>,
Nuno Sá <nuno.sa@...log.com>
Cc: "Christophe Leroy" <christophe.leroy@...roup.eu>,
"Linus Walleij" <linus.walleij@...aro.org>,
"Bartosz Golaszewski" <brgl@...ev.pl>,
"Geert Uytterhoeven" <geert+renesas@...der.be>,
Keerthy <j-keerthy@...com>,
"Russell King" <linux@...linux.org.uk>,
"Jonathan Corbet" <corbet@....net>,
"Thomas Gleixner" <tglx@...utronix.de>,
"Ingo Molnar" <mingo@...hat.com>, "Borislav Petkov" <bp@...en8.de>,
"Dave Hansen" <dave.hansen@...ux.intel.com>,
"H. Peter Anvin" <hpa@...or.com>,
"Catalin Marinas" <catalin.marinas@....com>,
"Will Deacon" <will@...nel.org>,
"Linux Kernel Mailing List" <linux-kernel@...r.kernel.org>,
"open list:GPIO SUBSYSTEM" <linux-gpio@...r.kernel.org>,
"linux-arm Mailing List" <linux-arm-kernel@...ts.infradead.org>,
Linux-Arch <linux-arch@...r.kernel.org>,
"Linux Documentation List" <linux-doc@...r.kernel.org>,
"maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT)" <x86@...nel.org>
Subject: Re: [PATCH v1 4/8] gpiolib: Get rid of ARCH_NR_GPIOS
On Fri, Sep 2, 2022, at 12:52 PM, Andy Shevchenko wrote:
> On Wed, Aug 31, 2022 at 11:55 PM Arnd Bergmann <arnd@...db.de> 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 <linux/platform_data/pca953x.h>
arch/arm/mach-ep93xx/vision_ep9307.c:#include <linux/platform_data/pca953x.h>
arch/arm/mach-mmp/ttc_dkb.c:#include <linux/platform_data/pca953x.h>
arch/arm/mach-pxa/cm-x300.c:#include <linux/platform_data/pca953x.h>
arch/arm/mach-pxa/spitz.c:#include <linux/platform_data/pca953x.h>
arch/arm/mach-pxa/zeus.c:#include <linux/platform_data/pca953x.h>
arch/arm/mach-pxa/zylonite_pxa300.c:#include <linux/platform_data/pca953x.h>
arch/arm/mach-s3c/mach-crag6410.c:#include <linux/platform_data/pca953x.h>
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
Powered by blists - more mailing lists