From: Linus Walleij <linus.walleij@linaro.org>
To: "Nuno Sá" <noname.nuno@gmail.com>
Cc: Antoniu Miclaus <antoniu.miclaus@analog.com>,
Bartosz Golaszewski <brgl@bgdev.pl>,
Rob Herring <robh@kernel.org>,
Krzysztof Kozlowski <krzk+dt@kernel.org>,
Conor Dooley <conor+dt@kernel.org>,
linux-gpio@vger.kernel.org, devicetree@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/2] gpio: adg1712: add driver support
Date: Tue, 18 Nov 2025 23:54:17 +0100 [thread overview]
Message-ID: <CACRpkdbZgxWaf7B7vwD3n-OSbt8h8vGKQ_CmB_SNjDG6aXHayA@mail.gmail.com> (raw)
In-Reply-To: <0cd7cf10d47683f22a4358635f243a2dfb6be564.camel@gmail.com>
On Tue, Nov 11, 2025 at 5:01 PM Nuno Sá <noname.nuno@gmail.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
next prev parent reply other threads:[~2025-11-18 22:54 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-31 16:07 [PATCH 0/2] gpio: Add support for ADG1712 quad SPST switch Antoniu Miclaus
2025-10-31 16:07 ` [PATCH 1/2] dt-bindings: gpio: adg1712: add adg1712 support Antoniu Miclaus
2025-10-31 17:38 ` Rob Herring (Arm)
2025-11-10 10:27 ` Linus Walleij
2025-10-31 16:07 ` [PATCH 2/2] gpio: adg1712: add driver support Antoniu Miclaus
2025-11-03 11:18 ` Nuno Sá
2025-11-10 10:30 ` Linus Walleij
2025-11-10 12:32 ` Nuno Sá
2025-11-11 11:05 ` Linus Walleij
2025-11-11 16:01 ` Nuno Sá
2025-11-18 22:54 ` Linus Walleij [this message]
2025-11-19 9:38 ` Nuno Sá
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CACRpkdbZgxWaf7B7vwD3n-OSbt8h8vGKQ_CmB_SNjDG6aXHayA@mail.gmail.com \
--to=linus.walleij@linaro.org \
--cc=antoniu.miclaus@analog.com \
--cc=brgl@bgdev.pl \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=krzk+dt@kernel.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=noname.nuno@gmail.com \
--cc=robh@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).