On Thu, Feb 13, 2025 at 10:45 PM Linus Walleij <linus.walleij@xxxxxxxxxx> wrote: > On Fri, Feb 7, 2025 at 7:21 AM Bough Chen <haibo.chen@xxxxxxx> wrote: > [Me]: > > > I have no idea why this driver isn't using gpio-mmio. > > > Not your fault though, just pointing out obvious improvement opportunities. > > > > I check the code, for vf610_gpio_direction_input()/vf610_gpio_direction_output(), > > to let the input/output really works, need to call pinctrl_gpio_direction_input() > > for vf610/imx7ulp/imx8ulp SoC. > > Refer to drivers/pinctrl/freescale/pinctrl-vf610.c, it implement gpio_set_direction > > callback. Also for imx7ulp/imx8ulp pinctrl drivers. > > This should be the reason why not using gpio-mmio. > > If this is the *only* thing you need additionally from gpio-mmio > then what about just adding a new flag to bgpio_init() function > in <linux/gpio/driver.h>: > > #define BGPIOF_PINCTRL_BACKEND BIT(7) > > That makes gpio-mmio call these callbacks when setting > direction? It's easier if I demonstrate. I wrote patches to do this, will send them now, test it out! Yours, Linus Walleij