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

Robert Jarzmik
2022-12-09T08:58:20Z

"Russell King (Oracle)" <linux@armlinux.org.uk> writes:
> 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).

It does.
Basically it tries pinctrl first, and falls back to direct
registers
access. Here is a small extract of the gpio direction manipulation
in
gpio-pxa.c :
if (pxa_gpio_has_pinctrl()) {
ret = pinctrl_gpio_direction_output(chip->base +
offset);
if (ret)
return ret;
}

spin_lock_irqsave(&gpio_lock, flags);

tmp = readl_relaxed(base + GPDR_OFFSET);
... blablabal we set the bit, and write back the register.

Cheers.

--
Robert