gpio-mt7621 offset fix for 5.10 kernel series

Martin Blumenstingl martin.blumenstingl at googlemail.com
Tue Oct 18 12:55:06 PDT 2022


Hello Peter,

On Tue, Oct 18, 2022 at 9:34 PM Peter Naulls <peter at chocky.org> wrote:
>
>
> Looks like there was some code loss when the driver came from an earlier kernel
> series. Without this, my MT7621 board starts its GPIO offsets at 416 (why that
> number, I don't know):
You should also explain the problem with this behavior (if there's any).

Upstream kernel doc [0] mentions:
 * @base: identifies the first GPIO number handled by this chip;
 * or, if negative during registration, requests dynamic ID allocation.
 * DEPRECATION: providing anything non-negative and nailing the base
 * offset of GPIO chips is deprecated. Please pass -1 as base to
 * let gpiolib select the chip base in all possible cases. We want to
 * get rid of the static GPIO number space in the long run.

I never used it but my understanding is that the recommended way for
accessing GPIOs from userspace (in case that's what you need) should
be done through libgpiod.


Best regards,
Martin


[0] https://elixir.bootlin.com/linux/v4.14.295/source/include/linux/gpio/driver.h#L48



More information about the openwrt-devel mailing list