linux-gpio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Arnd Bergmann" <arnd@arndb.de>
To: "Andy Shevchenko" <andy.shevchenko@gmail.com>,
	"Nuno Sá" <nuno.sa@analog.com>
Cc: "Christophe Leroy" <christophe.leroy@csgroup.eu>,
	"Linus Walleij" <linus.walleij@linaro.org>,
	"Bartosz Golaszewski" <brgl@bgdev.pl>,
	"Geert Uytterhoeven" <geert+renesas@glider.be>,
	Keerthy <j-keerthy@ti.com>,
	"Russell King" <linux@armlinux.org.uk>,
	"Jonathan Corbet" <corbet@lwn.net>,
	"Thomas Gleixner" <tglx@linutronix.de>,
	"Ingo Molnar" <mingo@redhat.com>,
	"Borislav Petkov" <bp@alien8.de>,
	"Dave Hansen" <dave.hansen@linux.intel.com>,
	"H. Peter Anvin" <hpa@zytor.com>,
	"Catalin Marinas" <catalin.marinas@arm.com>,
	"Will Deacon" <will@kernel.org>,
	"Linux Kernel Mailing List" <linux-kernel@vger.kernel.org>,
	"open list:GPIO SUBSYSTEM" <linux-gpio@vger.kernel.org>,
	"linux-arm Mailing List" <linux-arm-kernel@lists.infradead.org>,
	Linux-Arch <linux-arch@vger.kernel.org>,
	"Linux Documentation List" <linux-doc@vger.kernel.org>,
	"maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT)"
	<x86@kernel.org>
Subject: Re: [PATCH v1 4/8] gpiolib: Get rid of ARCH_NR_GPIOS
Date: Fri, 02 Sep 2022 14:00:21 +0200	[thread overview]
Message-ID: <254b7b9d-72b7-4b3a-821a-51a2745ebac5@www.fastmail.com> (raw)
In-Reply-To: <CAHp75VfF78rWpC6+i2Hu6-PMULFeFMbqXhBVRkx5aFGFTU3U4A@mail.gmail.com>

On Fri, Sep 2, 2022, at 12:52 PM, Andy Shevchenko wrote:
> On Wed, Aug 31, 2022 at 11:55 PM Arnd Bergmann <arnd@arndb.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

  parent reply	other threads:[~2022-09-02 12:01 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-29 16:15 [PATCH v1 0/8] gpio: Get rid of ARCH_NR_GPIOS (v1) Christophe Leroy
2022-08-29 16:15 ` [PATCH v1 1/8] gpio: aggregator: Stop using ARCH_NR_GPIOS Christophe Leroy
2022-08-30  7:51   ` Geert Uytterhoeven
2022-08-29 16:15 ` [PATCH v1 2/8] gpio: davinci: " Christophe Leroy
2022-08-29 16:15 ` [PATCH v1 3/8] gpiolib: Warn on drivers still using static gpiobase allocation Christophe Leroy
2022-08-30 20:14   ` Andy Shevchenko
2022-08-31  5:39     ` Christophe Leroy
2022-08-31  8:00       ` Geert Uytterhoeven
2022-08-29 16:15 ` [PATCH v1 4/8] gpiolib: Get rid of ARCH_NR_GPIOS Christophe Leroy
2022-08-30 20:18   ` Andy Shevchenko
2022-08-31  5:49     ` Christophe Leroy
2022-08-31 20:55       ` Arnd Bergmann
2022-09-02 10:21         ` Christophe Leroy
2022-09-02 10:52         ` Andy Shevchenko
2022-09-02 11:02           ` Geert Uytterhoeven
2022-09-02 11:39           ` Nuno Sá
2022-09-02 12:00           ` Arnd Bergmann [this message]
2022-08-29 16:15 ` [PATCH v1 5/8] Documentation: gpio: Remove text about ARCH_NR_GPIOS Christophe Leroy
2022-08-29 16:15 ` [PATCH v1 6/8] x86: Remove CONFIG_ARCH_NR_GPIO Christophe Leroy
2022-08-29 16:15 ` [PATCH v1 7/8] arm: " Christophe Leroy
2022-08-29 16:15 ` [PATCH v1 8/8] arm64: " Christophe Leroy
2022-08-30 20:20 ` [PATCH v1 0/8] gpio: Get rid of ARCH_NR_GPIOS (v1) Andy Shevchenko
2022-08-30 20:21   ` Andy Shevchenko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=254b7b9d-72b7-4b3a-821a-51a2745ebac5@www.fastmail.com \
    --to=arnd@arndb.de \
    --cc=andy.shevchenko@gmail.com \
    --cc=bp@alien8.de \
    --cc=brgl@bgdev.pl \
    --cc=catalin.marinas@arm.com \
    --cc=christophe.leroy@csgroup.eu \
    --cc=corbet@lwn.net \
    --cc=dave.hansen@linux.intel.com \
    --cc=geert+renesas@glider.be \
    --cc=hpa@zytor.com \
    --cc=j-keerthy@ti.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-arch@vger.kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=mingo@redhat.com \
    --cc=nuno.sa@analog.com \
    --cc=tglx@linutronix.de \
    --cc=will@kernel.org \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).