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

From: Linus Walleij

Date: Tue Nov 18 2025 - 17:54:31 EST


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.

Yours,
Linus Walleij