* [PATCH] gpio: ixp4xx: switch to dynamic GPIO base
@ 2026-04-27 21:43 Mohamed Ayman
2026-04-28 7:56 ` Linus Walleij
2026-04-28 8:14 ` Bartosz Golaszewski
0 siblings, 2 replies; 3+ messages in thread
From: Mohamed Ayman @ 2026-04-27 21:43 UTC (permalink / raw)
To: Linus Walleij, Imre Kaloz, Bartosz Golaszewski,
moderated list:ARM/INTEL IXP4XX ARM ARCHITECTURE,
open list:GPIO SUBSYSTEM, open list
Cc: Mohamed Ayman, moderated list:ARM/INTEL IXP4XX ARM ARCHITECTURE,
open list:GPIO SUBSYSTEM, open list
Most IXP4xx platforms are Device Tree-based, and GPIO consumers
use phandle-based descriptors rather than legacy integer GPIO numbers.
Audit of the IXP4xx platform shows:
- No gpio_request(), gpio_get_value(), or gpio_set_value() users
in arch/arm/mach-ixp4xx/
- No platform data using fixed GPIO numbers
This switches the gpiochip to dynamic base allocation, aligning
with modern gpiolib expectations where GPIO numbers are not globally
fixed and may be assigned dynamically.
Set gpiochip.base = -1 to allow gpiolib to assign the GPIO base
dynamically, avoiding global GPIO number space conflicts.
Signed-off-by: Mohamed Ayman <mohamedaymanworkspace@gmail.com>
---
drivers/gpio/gpio-ixp4xx.c | 7 +------
1 file changed, 1 insertion(+), 6 deletions(-)
diff --git a/drivers/gpio/gpio-ixp4xx.c b/drivers/gpio/gpio-ixp4xx.c
index f34d87869c8b..669b139cd499 100644
--- a/drivers/gpio/gpio-ixp4xx.c
+++ b/drivers/gpio/gpio-ixp4xx.c
@@ -311,12 +311,7 @@ static int ixp4xx_gpio_probe(struct platform_device *pdev)
}
g->chip.gc.ngpio = 16;
g->chip.gc.label = "IXP4XX_GPIO_CHIP";
- /*
- * TODO: when we have migrated to device tree and all GPIOs
- * are fetched using phandles, set this to -1 to get rid of
- * the fixed gpiochip base.
- */
- g->chip.gc.base = 0;
+ g->chip.gc.base = -1;
g->chip.gc.parent = &pdev->dev;
g->chip.gc.owner = THIS_MODULE;
--
2.34.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] gpio: ixp4xx: switch to dynamic GPIO base
2026-04-27 21:43 [PATCH] gpio: ixp4xx: switch to dynamic GPIO base Mohamed Ayman
@ 2026-04-28 7:56 ` Linus Walleij
2026-04-28 8:14 ` Bartosz Golaszewski
1 sibling, 0 replies; 3+ messages in thread
From: Linus Walleij @ 2026-04-28 7:56 UTC (permalink / raw)
To: Mohamed Ayman
Cc: Imre Kaloz, Bartosz Golaszewski,
moderated list:ARM/INTEL IXP4XX ARM ARCHITECTURE,
open list:GPIO SUBSYSTEM, open list
On Mon, Apr 27, 2026 at 11:43 PM Mohamed Ayman
<mohamedaymanworkspace@gmail.com> wrote:
> Most IXP4xx platforms are Device Tree-based, and GPIO consumers
> use phandle-based descriptors rather than legacy integer GPIO numbers.
>
> Audit of the IXP4xx platform shows:
> - No gpio_request(), gpio_get_value(), or gpio_set_value() users
> in arch/arm/mach-ixp4xx/
> - No platform data using fixed GPIO numbers
>
> This switches the gpiochip to dynamic base allocation, aligning
> with modern gpiolib expectations where GPIO numbers are not globally
> fixed and may be assigned dynamically.
>
> Set gpiochip.base = -1 to allow gpiolib to assign the GPIO base
> dynamically, avoiding global GPIO number space conflicts.
>
> Signed-off-by: Mohamed Ayman <mohamedaymanworkspace@gmail.com>
You're right and you beat me to it! No-one is dependent on the
fixed GPIO numbering for this platform.
Reviewed-by: Linus Walleij <linusw@kernel.org>
Yours,
Linus Walleij
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] gpio: ixp4xx: switch to dynamic GPIO base
2026-04-27 21:43 [PATCH] gpio: ixp4xx: switch to dynamic GPIO base Mohamed Ayman
2026-04-28 7:56 ` Linus Walleij
@ 2026-04-28 8:14 ` Bartosz Golaszewski
1 sibling, 0 replies; 3+ messages in thread
From: Bartosz Golaszewski @ 2026-04-28 8:14 UTC (permalink / raw)
To: Linus Walleij, Imre Kaloz, Bartosz Golaszewski, linux-arm-kernel,
linux-gpio, linux-kernel, Mohamed Ayman
Cc: Bartosz Golaszewski
On Tue, 28 Apr 2026 00:43:10 +0300, Mohamed Ayman wrote:
> Most IXP4xx platforms are Device Tree-based, and GPIO consumers
> use phandle-based descriptors rather than legacy integer GPIO numbers.
>
> Audit of the IXP4xx platform shows:
> - No gpio_request(), gpio_get_value(), or gpio_set_value() users
> in arch/arm/mach-ixp4xx/
> - No platform data using fixed GPIO numbers
>
> [...]
Applied, thanks!
[1/1] gpio: ixp4xx: switch to dynamic GPIO base
https://git.kernel.org/brgl/c/1005d6e0257a5623ef79bfbd8f588b498c1cab0d
Best regards,
--
Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-04-28 8:15 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-27 21:43 [PATCH] gpio: ixp4xx: switch to dynamic GPIO base Mohamed Ayman
2026-04-28 7:56 ` Linus Walleij
2026-04-28 8:14 ` Bartosz Golaszewski
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox