linux-gpio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Open-collector GPIO usage question
@ 2025-11-21 18:59 Matthias Urlichs
  2025-11-22  4:03 ` Kent Gibson
  0 siblings, 1 reply; 2+ messages in thread
From: Matthias Urlichs @ 2025-11-21 18:59 UTC (permalink / raw)
  To: linux-gpio


[-- 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 --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2025-11-22  4:03 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-11-21 18:59 Open-collector GPIO usage question Matthias Urlichs
2025-11-22  4:03 ` Kent Gibson

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).