Re: [PATCH 2/2] gpio: adg1712: add driver support

From: Nuno Sá

Date: Wed Nov 19 2025 - 04:38:13 EST


On Tue, 2025-11-18 at 23:54 +0100, Linus Walleij wrote:
> On Tue, Nov 11, 2025 at 5:01 PM Nuno Sá <noname.nuno@xxxxxxxxx> wrote:
>
> [Me]
> > > - Implement .set_config() and implement the generic pin
> > >   control property PIN_CONFIG_OUTPUT_ENABLE as 1
> > >   to switch "on" and 0 for switch "off".
> > >   See include/linux/pinctrl/pinconf-generic.h
>
> > The above makes sense to me. I'll let Antoniu take it from here and check if
> > the above fits the usecases he is aware of. Not sure if it makes sense for a piece
> > of HW like this but if the usecase is for userspace to control the on/off states,
> > then I guess we would need .get() and .set(). Or some kind of "frontend" driver
> > making use of the consumer helpers.
>
> There is already GPIO_V2_LINE_SET_CONFIG_IOCTL
> in <uapi/linux/gpio.h> so setting configs from userspace is no issue,
> just use the character device.
>
> You will need to add I think two new config flags for userspace:
> GPIO_V2_LINE_FLAG_OUTPUT_ENABLE
> GPIO_V2_LINE_FLAG_OUTPUT_DISABLE
>
> And update gpio_v2_line_config_flags_to_desc_flags() in
> drivers/gpio/gpiolib-cdev.c accordingly.
>
> Then you probably want some tests or examples in libgpiod to make
> sure userspace is fine. Bartosz knows all about how to do this.
>

It seems there's no need for userspace control. If you look at v3, it seems
we don't really need it to be a gpiochip (at least, I think). Maybe take a look,
you might have some good pointers :)


Thx!
- Nuno Sá