gpio: ixp4xx: switch to dynamic GPIO base
Subsystems (2)
PATCH 1/1 gpio: ixp4xx: switch to dynamic GPIO base
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.
--- drivers/gpio/gpio-ixp4xx.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-)
drivers/gpio/gpio-ixp4xx.c +1 -6
@@ -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 ;
Signature · 1 line
2.34.1
Quoted 8 lines · Mohamed Ayman
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:
- Nogpio_request(),gpio_get_value(), orgpio_set_value()users inarch/arm/mach-ixp4xx/
- No platform data using fixed GPIO numbers
Quoted 8 lines
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 <[email protected]>
You're right and you beat me to it! No-one is dependent on the fixed GPIO numbering for this platform.
Yours,
Linus Walleij
Bartosz Golaszewski
AppliedQuoted 9 lines · Mohamed Ayman
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:
- Nogpio_request(),gpio_get_value(), orgpio_set_value()users inarch/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,
Signature · 1 line
Bartosz Golaszewski <[email protected]>