drivers/comedi/drivers/amplc_dio200_common.c
Source file repositories/reference/linux-study-clean/drivers/comedi/drivers/amplc_dio200_common.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/comedi/drivers/amplc_dio200_common.c- Extension
.c- Size
- 23264 bytes
- Lines
- 907
- Domain
- Driver Families
- Bucket
- drivers/comedi
- Inferred role
- Driver Families: exported/initcall integration point
- Status
- integration 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.
- Exports symbols or registers init work; inspect boot/module ordering and who consumes the exported contract.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- 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.hlinux/comedi/comedi_8255.hlinux/comedi/comedi_8254.hamplc_dio200.h
Detected Declarations
struct dio200_subdev_8255struct dio200_subdev_intrfunction clk_gat_scefunction dio200___read8function dio200___write8function dio200___read32function dio200___write32function dio200___read8function dio200___write8function dio200___read32function dio200___write32function dio200_read8function dio200_write8function dio200_read32function dio200_write32function dio200_subdev_8254_offsetfunction dio200_subdev_intr_insn_bitsfunction dio200_stop_intrfunction dio200_start_intrfunction dio200_inttrig_start_intrfunction dio200_read_scan_intrfunction dio200_handle_read_intrfunction dio200_subdev_intr_cancelfunction dio200_subdev_intr_cmdtestfunction dio200_subdev_intr_cmdfunction dio200_subdev_intr_initfunction dio200_interruptfunction dio200_subdev_8254_set_gate_srcfunction dio200_subdev_8254_set_clock_srcfunction dio200_subdev_8254_configfunction dio200_subdev_8254_initfunction dio200_subdev_8255_set_dirfunction dio200_subdev_8255_bitsfunction dio200_subdev_8255_configfunction dio200_subdev_8255_initfunction dio200_subdev_timer_readfunction dio200_subdev_timer_resetfunction dio200_subdev_timer_get_clock_srcfunction dio200_subdev_timer_set_clock_srcfunction dio200_subdev_timer_configfunction amplc_dio200_set_enhancefunction amplc_dio200_common_attachexport amplc_dio200_set_enhanceexport amplc_dio200_common_attach
Annotated Snippet
struct dio200_subdev_8255 {
unsigned int ofs; /* DIO base offset */
};
struct dio200_subdev_intr {
spinlock_t spinlock; /* protects the 'active' flag */
unsigned int ofs;
unsigned int valid_isns;
unsigned int enabled_isns;
unsigned int active:1;
};
#ifdef CONFIG_HAS_IOPORT
static unsigned char dio200___read8(struct comedi_device *dev,
unsigned int offset)
{
if (dev->mmio)
return readb(dev->mmio + offset);
return inb(dev->iobase + offset);
}
static void dio200___write8(struct comedi_device *dev,
unsigned int offset, unsigned char val)
{
if (dev->mmio)
writeb(val, dev->mmio + offset);
else
outb(val, dev->iobase + offset);
}
static unsigned int dio200___read32(struct comedi_device *dev,
unsigned int offset)
{
if (dev->mmio)
return readl(dev->mmio + offset);
return inl(dev->iobase + offset);
}
static void dio200___write32(struct comedi_device *dev,
unsigned int offset, unsigned int val)
{
if (dev->mmio)
writel(val, dev->mmio + offset);
else
outl(val, dev->iobase + offset);
}
#else /* CONFIG_HAS_IOPORT */
static unsigned char dio200___read8(struct comedi_device *dev,
unsigned int offset)
{
return readb(dev->mmio + offset);
}
static void dio200___write8(struct comedi_device *dev,
unsigned int offset, unsigned char val)
{
writeb(val, dev->mmio + offset);
}
static unsigned int dio200___read32(struct comedi_device *dev,
unsigned int offset)
{
return readl(dev->mmio + offset);
}
static void dio200___write32(struct comedi_device *dev,
unsigned int offset, unsigned int val)
{
writel(val, dev->mmio + offset);
}
#endif /* CONFIG_HAS_IOPORT */
static unsigned char dio200_read8(struct comedi_device *dev,
unsigned int offset)
{
const struct dio200_board *board = dev->board_ptr;
if (board->is_pcie)
offset <<= 3;
return dio200___read8(dev, offset);
}
static void dio200_write8(struct comedi_device *dev,
unsigned int offset, unsigned char val)
{
Annotation
- Immediate include surface: `linux/module.h`, `linux/interrupt.h`, `linux/comedi/comedidev.h`, `linux/comedi/comedi_8255.h`, `linux/comedi/comedi_8254.h`, `amplc_dio200.h`.
- Detected declarations: `struct dio200_subdev_8255`, `struct dio200_subdev_intr`, `function clk_gat_sce`, `function dio200___read8`, `function dio200___write8`, `function dio200___read32`, `function dio200___write32`, `function dio200___read8`, `function dio200___write8`, `function dio200___read32`.
- Atlas domain: Driver Families / drivers/comedi.
- Implementation status: integration implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
- 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.