drivers/comedi/drivers/dt2801.c
Source file repositories/reference/linux-study-clean/drivers/comedi/drivers/dt2801.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/comedi/drivers/dt2801.c- Extension
.c- Size
- 13706 bytes
- Lines
- 647
- Domain
- Driver Families
- Bucket
- drivers/comedi
- Inferred role
- Driver Families: implementation source
- Status
- source implementation candidate
Why This File Exists
Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/module.hlinux/comedi/comedidev.hlinux/delay.h
Detected Declarations
struct dt2801_boardstruct dt2801_privatefunction dt2801_readdatafunction dt2801_readdata2function dt2801_writedatafunction dt2801_writedata2function dt2801_wait_for_readyfunction dt2801_writecmdfunction dt2801_resetfunction probe_number_of_ai_chansfunction dt2801_errorfunction dt2801_ai_insn_readfunction dt2801_ao_insn_writefunction dt2801_dio_insn_bitsfunction dt2801_dio_insn_configfunction dt2801_attach
Annotated Snippet
struct dt2801_board {
const char *name;
int boardcode;
int ad_diff;
int ad_chan;
int adbits;
int adrangetype;
int dabits;
};
/*
* Typeid's for the different boards of the DT2801-series
* (taken from the test-software, that comes with the board)
*/
static const struct dt2801_board boardtypes[] = {
{
.name = "dt2801",
.boardcode = 0x09,
.ad_diff = 2,
.ad_chan = 16,
.adbits = 12,
.adrangetype = 0,
.dabits = 12},
{
.name = "dt2801-a",
.boardcode = 0x52,
.ad_diff = 2,
.ad_chan = 16,
.adbits = 12,
.adrangetype = 0,
.dabits = 12},
{
.name = "dt2801/5716a",
.boardcode = 0x82,
.ad_diff = 1,
.ad_chan = 16,
.adbits = 16,
.adrangetype = 1,
.dabits = 12},
{
.name = "dt2805",
.boardcode = 0x12,
.ad_diff = 1,
.ad_chan = 16,
.adbits = 12,
.adrangetype = 0,
.dabits = 12},
{
.name = "dt2805/5716a",
.boardcode = 0x92,
.ad_diff = 1,
.ad_chan = 16,
.adbits = 16,
.adrangetype = 1,
.dabits = 12},
{
.name = "dt2808",
.boardcode = 0x20,
.ad_diff = 0,
.ad_chan = 16,
.adbits = 12,
.adrangetype = 2,
.dabits = 8},
{
.name = "dt2818",
.boardcode = 0xa2,
.ad_diff = 0,
.ad_chan = 4,
.adbits = 12,
.adrangetype = 0,
.dabits = 12},
{
.name = "dt2809",
.boardcode = 0xb0,
.ad_diff = 0,
.ad_chan = 8,
.adbits = 12,
.adrangetype = 1,
.dabits = 12},
};
struct dt2801_private {
const struct comedi_lrange *dac_range_types[2];
};
/*
* These are the low-level routines:
* writecommand: write a command to the board
* writedata: write data byte
* readdata: read data byte
Annotation
- Immediate include surface: `linux/module.h`, `linux/comedi/comedidev.h`, `linux/delay.h`.
- Detected declarations: `struct dt2801_board`, `struct dt2801_private`, `function dt2801_readdata`, `function dt2801_readdata2`, `function dt2801_writedata`, `function dt2801_writedata2`, `function dt2801_wait_for_ready`, `function dt2801_writecmd`, `function dt2801_reset`, `function probe_number_of_ai_chans`.
- Atlas domain: Driver Families / drivers/comedi.
- Implementation status: source implementation candidate.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.