]> git.ipfire.org Git - thirdparty/linux.git/commit
comedi: comedi_test: add a DIO subdevice
authorIan Abbott <abbotti@mev.co.uk>
Wed, 10 Dec 2025 12:44:55 +0000 (12:44 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 16 Jan 2026 15:33:13 +0000 (16:33 +0100)
commitb842f8c6397ab59786ad5d5bb8c6899d2fc55ae9
treef44c2eba4af795a7ffce2490000c43922b6c057e
parentd63cf1eea10c904c1b31b22ff3e118033ec7edfb
comedi: comedi_test: add a DIO subdevice

The fake "comedi_test" device currently has two subdevices: an analog
input subdevice, and an analog output subdevice.  To make it a bit more
useful for testing, add a third subdevice for digital I/O.

The new DIO subdevice has 32 channels with each channel individually
programmable as an input or an output.  To add a bit of interaction,
channels 0 to 15 are wired to channels 16 to 31 (0 to 16, 1 to 17,
etc.), and the state of each wire can be read back on both of the
channels connected to it.  The outputs are modelled as NPN open
collector outputs with a pull-up resistor on the wire, so the state of
each wire (and the value read back from each channel connected to it)
will be logic level 1 unless either channel is configured as an output
at logic level 0.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Link: https://patch.msgid.link/20251210124455.69131-1-abbotti@mev.co.uk
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/comedi/drivers/comedi_test.c