Re: [PATCH] gpiolib: return quietly from gpiod_get_direction() without .get_direction()
Mehmet Fide <[email protected]>
| Newsgroups | org.kernel.vger.linux-gpio |
|---|---|
| Message-ID | <[email protected]> |
Hi Bartosz,
On 26/08/2026 at 17:06, Bartosz Golaszewski wrote:
> I would rather implement the missing callback in gpio-mmio. We already call
> into pinctrl if needed when setting direction, could we call
> pinctrl_gpio_get_config() here and read the direction from the underlying
> pinctrl driver?
I agree that is the better place, and I am happy to drop this patch in
favour of it. One wrinkle I ran into while prototyping: for the config
road to work, the pinctrl driver has to report the direction as a
generic parameter, and pinctrl-imx (which serves vf610) does not - its
pin_config_get() returns the raw pad register value, not
pinconf-generic parameters, so gpio-mmio cannot decode it generically
(on vf610 the buffer enables are bits 1:0 of the shared mux/conf
register).
So my plan would be two small steps:
1. teach the vf610 pinconf side to report PIN_CONFIG_OUTPUT_ENABLE
(and PIN_CONFIG_INPUT_ENABLE) from the pad register;
2. give gpio-mmio a get_direction() that is only installed when the
chip has no direction registers, asking pinctrl for
PIN_CONFIG_OUTPUT_ENABLE, as you suggest.
Does that match what you had in mind? If so I will send that series
instead of this patch. Enjoy the rest of your time off - September is
fine for me.
Thanks,
Mehmet