drivers/comedi/drivers/pcl726.c
Source file repositories/reference/linux-study-clean/drivers/comedi/drivers/pcl726.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/comedi/drivers/pcl726.c- Extension
.c- Size
- 10874 bytes
- Lines
- 434
- 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.
- Touches IRQ or DMA behavior; this matters for the representative real-device path.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/module.hlinux/interrupt.hlinux/comedi/comedidev.h
Detected Declarations
struct pcl726_boardstruct pcl726_privatefunction pcl726_intr_insn_bitsfunction pcl726_intr_cmdtestfunction pcl726_intr_cmdfunction pcl726_intr_cancelfunction pcl726_interruptfunction pcl726_ao_insn_writefunction pcl726_di_insn_bitsfunction pcl726_do_insn_bitsfunction pcl726_attach
Annotated Snippet
struct pcl726_board {
const char *name;
unsigned int io_len;
unsigned int min_io_start;
unsigned int irq_mask;
const struct comedi_lrange *const *ao_ranges;
int ao_num_ranges;
int ao_nchan;
unsigned int have_dio:1;
unsigned int is_pcl727:1;
};
static const struct pcl726_board pcl726_boards[] = {
{
.name = "pcl726",
.io_len = 0x10,
.min_io_start = 0x200,
.ao_ranges = &rangelist_726[0],
.ao_num_ranges = ARRAY_SIZE(rangelist_726),
.ao_nchan = 6,
.have_dio = 1,
}, {
.name = "pcl727",
.io_len = 0x20,
.min_io_start = 0x200,
.ao_ranges = &rangelist_727[0],
.ao_num_ranges = ARRAY_SIZE(rangelist_727),
.ao_nchan = 12,
.have_dio = 1,
.is_pcl727 = 1,
}, {
.name = "pcl728",
.io_len = 0x08,
.min_io_start = 0,
.ao_num_ranges = ARRAY_SIZE(rangelist_728),
.ao_ranges = &rangelist_728[0],
.ao_nchan = 2,
}, {
.name = "acl6126",
.io_len = 0x10,
.min_io_start = 0x200,
.irq_mask = 0x96e8,
.ao_num_ranges = ARRAY_SIZE(rangelist_726),
.ao_ranges = &rangelist_726[0],
.ao_nchan = 6,
.have_dio = 1,
}, {
.name = "acl6128",
.io_len = 0x08,
.min_io_start = 0,
.ao_num_ranges = ARRAY_SIZE(rangelist_728),
.ao_ranges = &rangelist_728[0],
.ao_nchan = 2,
},
};
struct pcl726_private {
const struct comedi_lrange *rangelist[12];
unsigned int cmd_running:1;
};
static int pcl726_intr_insn_bits(struct comedi_device *dev,
struct comedi_subdevice *s,
struct comedi_insn *insn,
unsigned int *data)
{
data[1] = 0;
return insn->n;
}
static int pcl726_intr_cmdtest(struct comedi_device *dev,
struct comedi_subdevice *s,
struct comedi_cmd *cmd)
{
int err = 0;
/* Step 1 : check if triggers are trivially valid */
err |= comedi_check_trigger_src(&cmd->start_src, TRIG_NOW);
err |= comedi_check_trigger_src(&cmd->scan_begin_src, TRIG_EXT);
err |= comedi_check_trigger_src(&cmd->convert_src, TRIG_FOLLOW);
err |= comedi_check_trigger_src(&cmd->scan_end_src, TRIG_COUNT);
err |= comedi_check_trigger_src(&cmd->stop_src, TRIG_NONE);
if (err)
return 1;
/* Step 2a : make sure trigger sources are unique */
/* Step 2b : and mutually compatible */
Annotation
- Immediate include surface: `linux/module.h`, `linux/interrupt.h`, `linux/comedi/comedidev.h`.
- Detected declarations: `struct pcl726_board`, `struct pcl726_private`, `function pcl726_intr_insn_bits`, `function pcl726_intr_cmdtest`, `function pcl726_intr_cmd`, `function pcl726_intr_cancel`, `function pcl726_interrupt`, `function pcl726_ao_insn_write`, `function pcl726_di_insn_bits`, `function pcl726_do_insn_bits`.
- Atlas domain: Driver Families / drivers/comedi.
- Implementation status: source implementation candidate.
- IRQ or DMA behavior appears here, which is relevant to the selected PCIe/NVMe device path.
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.