[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CACRpkdbZgxWaf7B7vwD3n-OSbt8h8vGKQ_CmB_SNjDG6aXHayA@mail.gmail.com>
Date: Tue, 18 Nov 2025 23:54:17 +0100
From: Linus Walleij <linus.walleij@...aro.org>
To: Nuno Sá <noname.nuno@...il.com>
Cc: Antoniu Miclaus <antoniu.miclaus@...log.com>, Bartosz Golaszewski <brgl@...ev.pl>,
Rob Herring <robh@...nel.org>, Krzysztof Kozlowski <krzk+dt@...nel.org>, Conor Dooley <conor+dt@...nel.org>,
linux-gpio@...r.kernel.org, devicetree@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH 2/2] gpio: adg1712: add driver support
On Tue, Nov 11, 2025 at 5:01 PM Nuno Sá <noname.nuno@...il.com> 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
Powered by blists - more mailing lists