[PATCH v2 2/9] gpio: pxa: use dynamic allocation of base

Duje Mihanović posted 9 patches 1 year, 1 month ago
There is a newer version of this series
[PATCH v2 2/9] gpio: pxa: use dynamic allocation of base
Posted by Duje Mihanović 1 year, 1 month ago
Fixes the warning in dmesg that static allocation of the base is
deprecated.

This will break some older PXA boards (such as Spitz) as they still
seem to rely on fixed GPIO numbers with gpio_request and such.

Signed-off-by: Duje Mihanović <duje.mihanovic@skole.hr>
---
 drivers/gpio/gpio-pxa.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/gpio/gpio-pxa.c b/drivers/gpio/gpio-pxa.c
index d92650aecb06..b48d142b736d 100644
--- a/drivers/gpio/gpio-pxa.c
+++ b/drivers/gpio/gpio-pxa.c
@@ -351,6 +351,7 @@ static int pxa_init_gpio_chip(struct pxa_gpio_chip *pchip, int ngpio, void __iom
 
 	pchip->chip.parent = pchip->dev;
 	pchip->chip.label = "gpio-pxa";
+	pchip->chip.base = -1;
 	pchip->chip.direction_input  = pxa_gpio_direction_input;
 	pchip->chip.direction_output = pxa_gpio_direction_output;
 	pchip->chip.get = pxa_gpio_get;
-- 
2.41.0


Re: [PATCH v2 2/9] gpio: pxa: use dynamic allocation of base
Posted by Andy Shevchenko 1 year, 1 month ago
On Thu, Jul 27, 2023 at 06:29:00PM +0200, Duje Mihanović wrote:
> Fixes the warning in dmesg that static allocation of the base is
> deprecated.

Right.

> This will break some older PXA boards (such as Spitz) as they still
> seem to rely on fixed GPIO numbers with gpio_request and such.

So...? Why do you think this patch can be accepted?

-- 
With Best Regards,
Andy Shevchenko


Re: [PATCH v2 2/9] gpio: pxa: use dynamic allocation of base
Posted by Duje Mihanović 1 year, 1 month ago
On Thursday, July 27, 2023 6:40:24 PM CEST Andy Shevchenko wrote:
> > This will break some older PXA boards (such as Spitz) as they still
> > seem to rely on fixed GPIO numbers with gpio_request and such.
> 
> So...? Why do you think this patch can be accepted?

Understandable, I'll drop it.

Regards,
Duje
Re: [PATCH v2 2/9] gpio: pxa: use dynamic allocation of base
Posted by Linus Walleij 1 year, 1 month ago
On Sun, Jul 30, 2023 at 11:18 PM Duje Mihanović <duje.mihanovic@skole.hr> wrote:
> On Thursday, July 27, 2023 6:40:24 PM CEST Andy Shevchenko wrote:
> > > This will break some older PXA boards (such as Spitz) as they still
> > > seem to rely on fixed GPIO numbers with gpio_request and such.
> >
> > So...? Why do you think this patch can be accepted?
>
> Understandable, I'll drop it.

Or you can fix the real issue! This is what I had to do to fix the
OMAP, all the way down:

8e0285ab95a9 ARM/musb: omap2: Remove global GPIO numbers from TUSB6010
078dc5194c0a ARM: omap2: Rewrite WLAN quirk to use GPIO descriptors
94075d16beef ARM: omap2: Get USB hub reset GPIO from descriptor
d5f4fa60d63a ARM/gpio: Push OMAP2 quirk down into TWL4030 driver
c729baa86042 ARM: omap1: Exorcise the legacy GPIO header
df89de979f0e ARM: omap1: Make serial wakeup GPIOs use descriptors
084b6f216778 ARM: omap1: Fix up the Nokia 770 board device IRQs
e519f0bb64ef ARM/mmc: Convert old mmci-omap to GPIO descriptors
767d83361aaa Input: ads7846 - Convert to use software nodes
480c82daa3e4 ARM: omap1: Remove reliance on GPIO numbers from SX1
4c40db6249ff ARM: omap1: Remove reliance on GPIO numbers from PalmTE
fa1ae0cd897b ARM: omap1: Drop header on AMS Delta
c32c81f3dbdf ARM/mfd/gpio: Fixup TPS65010 regression on OMAP1 OSK1
a47137a5134b mfd/omap1: htc-i2cpld: Convert to a pure GPIO driver
6efac0173cd1 ARM: OMAP1: OSK: fix ohci-omap breakage
45c5775460f3 usb: ohci-omap: Fix descriptor conversion
f3ef38160e3d usb: isp1301-omap: Convert to use GPIO descriptors
15d157e87443 usb: ohci-omap: Convert to use GPIO descriptors
e63201f19438 mmc: omap_hsmmc: Delete platform data GPIO CD and WP

And maybe some more. Yeah it's tough, but it can be done!

Yours,
Linus Walleij
Re: [PATCH v2 2/9] gpio: pxa: use dynamic allocation of base
Posted by Duje Mihanović 1 year, 1 month ago
On Monday, August 7, 2023 3:31:19 PM CEST Linus Walleij wrote:
> On Sun, Jul 30, 2023 at 11:18 PM Duje Mihanović <duje.mihanovic@skole.hr> 
wrote:
> > Understandable, I'll drop it.
> 
> Or you can fix the real issue! This is what I had to do to fix the
> OMAP, all the way down:
...
> And maybe some more. Yeah it's tough, but it can be done!

I could certainly look into it.

Regards,
Duje



Re: [PATCH v2 2/9] gpio: pxa: use dynamic allocation of base
Posted by Andy Shevchenko 1 year, 1 month ago
On Mon, Aug 7, 2023 at 4:31 PM Linus Walleij <linus.walleij@linaro.org> wrote:
> On Sun, Jul 30, 2023 at 11:18 PM Duje Mihanović <duje.mihanovic@skole.hr> wrote:

...

> And maybe some more. Yeah it's tough, but it can be done!

And I will add "earlier started less effort it requires".

-- 
With Best Regards,
Andy Shevchenko