Thread (24 messages) 24 messages, 5 authors, 2022-09-02

Re: [PATCH v1 4/8] gpiolib: Get rid of ARCH_NR_GPIOS

From: Andy Shevchenko <hidden>
Date: 2022-08-30 20:19:11
Also in: linux-arch, linux-doc, linux-gpio, lkml

On Mon, Aug 29, 2022 at 7:19 PM Christophe Leroy
[off-list ref] wrote:
Since commit 14e85c0e69d5 ("gpio: remove gpio_descs global array")
there is no limitation on the number of GPIOs that can be allocated
in the system since the allocation is fully dynamic.

ARCH_NR_GPIOS is today only used in order to provide downwards
gpiobase allocation from that value, while static allocation is
performed upwards from 0. However that has the disadvantage of
limiting the number of GPIOs that can be registered in the system.

To overcome this limitation without requiring each and every
platform to provide its 'best-guess' maximum number, rework the
allocation to allocate upwards, allowing approx 2 millions of
GPIOs.

In order to still allow static allocation for legacy drivers, define
GPIO_DYNAMIC_BASE with the value 256 as the start for dynamic
allocation.
Not sure about 256, but I understand that this can only be the best guess.

-- 
With Best Regards,
Andy Shevchenko

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help