Re: PXA25x: GPIO driver fails probe due to resource conflict with pinctrl driver

Russell King (Oracle)
2022-12-08T22:29:35Z

On Thu, Dec 08, 2022 at 09:19:12PM +0100, Robert Jarzmik wrote:
>
> "Russell King (Oracle)" <linux@armlinux.org.uk> writes:
> > From a quick look, I think this commit is to blame:
> >
> > 542c25b7a209 drivers: gpio: pxa: use devm_platform_ioremap_resource()
> >
> > Someone "helpfully" making this change:
> >
> > - res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> > - if (!res)
> > - return -EINVAL;
> > - gpio_reg_base = devm_ioremap(&pdev->dev, res->start,
> > - resource_size(res));
> > +
> > + gpio_reg_base = devm_platform_ioremap_resource(pdev, 0);
> >
> > which introduces request_mem_region() to the PXA GPIO driver, resulting
> > in this resource clash.
> You're right.
>
> Now, as for Jonathan, there are 2 options :
> - first one : revert the patch Russell pointed out
> - second one : a lot of work, detailed below :
>
> Given that Arnd is removing legacy platformdata code, that will only leave
> the
> device-tree one, which works only with the pinctrl driver enabled.
> That gives the opportunity to drop the use of GPDR from the gpio-pxa driver,
> and now we can map with separate iomem ressources pinctrl-pxa and gpio-pxa.

Does the GPIO driver talk to the pinctrl driver to switch GPIOs between
input and output mode? If it does, that's fine. If not, that can cause
regressions, as GPIOs may need to be switched between input and output
mode at runtime (e.g. for I2C gpio-based bitbang).

--
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last!