From: Matthias Urlichs <matthias@urlichs.de>
To: linux-gpio@vger.kernel.org
Subject: Open-collector GPIO usage question
Date: Fri, 21 Nov 2025 19:59:47 +0100 [thread overview]
Message-ID: <fa30998c-db6e-4ff3-b327-d8b6270979fa@urlichs.de> (raw)
[-- Attachment #1.1: Type: text/plain, Size: 793 bytes --]
Hi,
so I want to efficiently implement a bit-bang-ish protocol, meaning I'd
like to use events instead of busy-looping.
The hardware uses open-collector wiring.
This doesn't seem possible with Linux GPIO.
I cannot set input and output flags at the same time. Getting events
requires the input flag while the open-drain output flag requires, well,
output. Owch.
AFAICS all of this is enforced by
drivers/gpio/gpiolib-cdev.c::gpio_v2_line_flags_validate(), so not gpio
driver specific.
As some hardware seems capable enough to trigger an interrupt on raw
port levels even if configured for "output", this seems overly
restrictive … also, I happen to not have enough GPIO ports to use two
per wire.
Thoughts?
--
-- regards
--
-- Matthias Urlichs
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 840 bytes --]
next reply other threads:[~2025-11-21 19:47 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-21 18:59 Matthias Urlichs [this message]
2025-11-22 4:03 ` Open-collector GPIO usage question Kent Gibson
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=fa30998c-db6e-4ff3-b327-d8b6270979fa@urlichs.de \
--to=matthias@urlichs.de \
--cc=linux-gpio@vger.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).