[PATCH RESEND 1/2] arm64: dts: rockchip: rk3308: Add gpio-ranges properties
Linus Walleij
linusw at kernel.org
Tue Mar 10 01:59:03 PDT 2026
On Tue, Mar 10, 2026 at 9:53 AM Matthijs Kooijman <matthijs at stdin.nl> wrote:
> Ah, I had not realized these aliases existed. However, it seems they are
> not actually relevant in this case. My assumption was that gpio
> numbering was based on initalizating order,
It usually is.
We do not like it when people depend on the global GPIO numbering.
> but I see in the code that
> GPIO drivers decide themselves (by setting gc->base statically or maybe
> based on DT).
They *can* but they really shouldn't. This mechanism exists for
legacy reasons.
Neither kernel drivers nor userspace should depend on the
global GPIO number.
We even replaced the sysfs with a mechanism that avoids using
the global GPIO number in favour of chip-local offsets to drive
home the point.
The reasoning behind this is clear: it is impossible to maintain
the global numberspace in any system with enough hot-pluggable
GPIO expanders such as on USB and to some extent other
slow buses. Do we know how many will be plugged in? No.
So we can't have any reliable numberspace.
It's only embedded developers who has never seen a USB
GPIO expander who thinks the global numberspace can work.
Yours,
Linus Walleij
More information about the Linux-rockchip
mailing list