[PATCH 2/3] gpio: of: support gpio-ranges for multiple gpiochip devices
Linus Walleij
linus.walleij at linaro.org
Mon May 6 00:02:42 PDT 2024
On Fri, May 3, 2024 at 10:21 PM Doug Berger <opendmb at gmail.com> wrote:
> On 5/3/2024 1:25 AM, Linus Walleij wrote:
> > It rather looks like you are trying to accomodate the Linux numberspace
> > in the ranges, which it was explicitly designed to avoid.
> The struct gpio_chip documentation in include/linux/gpio/driver.h says:
>
> > * @offset: when multiple gpio chips belong to the same device this
> > * can be used as offset within the device so friendly names can
> > * be properly assigned.
>
> It is my understanding that this value represents the offset of a
> gpiochip relative to the GPIO controller device defined by the GPIO
> controller node in device tree. This puts it in the same number space as
> [GPIO controller offset]. I believe it was introduced for the specific
> purpose of translating [GPIO controller offset] values into
> Linux-specific offsets, which is why it is being reused for that purpose
> in this patch.
You're right, I had it confused with .base!
It's because I missed it completely when this new property was added
in 2021.
Sorry for the fuzz.
Yours,
Linus Walleij
More information about the linux-arm-kernel
mailing list