drivers/media/pci/cx18/cx18-driver.c
Source file repositories/reference/linux-study-clean/drivers/media/pci/cx18/cx18-driver.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/media/pci/cx18/cx18-driver.c- Extension
.c- Size
- 39144 bytes
- Lines
- 1341
- Domain
- Driver Families
- Bucket
- drivers/media
- Inferred role
- Driver Families: operation-table or driver-model contract
- Status
- pattern 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 an operation table; this is where Linux turns generic core objects into subsystem-specific behavior.
- 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.
- Allocates kernel memory; connect allocation flags and lifetime to context constraints.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
cx18-driver.hcx18-io.hcx18-version.hcx18-cards.hcx18-i2c.hcx18-irq.hcx18-gpio.hcx18-firmware.hcx18-queue.hcx18-streams.hcx18-av-core.hcx18-scb.hcx18-mailbox.hcx18-ioctl.hcx18-controls.hxc2028.hlinux/dma-mapping.hmedia/tveeprom.h
Detected Declarations
function request_module_asyncfunction request_modulesfunction flush_request_modulesfunction cx18_msleep_timeoutfunction cx18_iounmapfunction cx18_eeprom_dumpfunction cx18_read_eepromfunction cx18_process_eepromfunction cx18_parse_stdfunction cx18_process_optionsfunction cx18_create_in_workqfunction cx18_init_in_work_ordersfunction herefunction cx18_init_struct2function cx18_setup_pcifunction cx18_init_subdevsfunction cx18_probefunction cx18_init_on_first_openfunction cx18_cancel_in_work_ordersfunction cx18_cancel_out_work_ordersfunction cx18_removefunction module_startfunction module_cleanupmodule init module_startexport cx18_ext_init
Annotated Snippet
static struct pci_driver cx18_pci_driver = {
.name = "cx18",
.id_table = cx18_pci_tbl,
.probe = cx18_probe,
.remove = cx18_remove,
};
static int __init module_start(void)
{
printk(KERN_INFO "cx18: Start initialization, version %s\n",
CX18_VERSION);
/* Validate parameters */
if (cx18_first_minor < 0 || cx18_first_minor >= CX18_MAX_CARDS) {
printk(KERN_ERR "cx18: Exiting, cx18_first_minor must be between 0 and %d\n",
CX18_MAX_CARDS - 1);
return -1;
}
if (cx18_debug < 0 || cx18_debug > 511) {
cx18_debug = 0;
printk(KERN_INFO "cx18: Debug value must be >= 0 and <= 511!\n");
}
if (pci_register_driver(&cx18_pci_driver)) {
printk(KERN_ERR "cx18: Error detecting PCI card\n");
return -ENODEV;
}
printk(KERN_INFO "cx18: End initialization\n");
return 0;
}
static void __exit module_cleanup(void)
{
pci_unregister_driver(&cx18_pci_driver);
}
module_init(module_start);
module_exit(module_cleanup);
MODULE_FIRMWARE(XC2028_DEFAULT_FIRMWARE);
Annotation
- Immediate include surface: `cx18-driver.h`, `cx18-io.h`, `cx18-version.h`, `cx18-cards.h`, `cx18-i2c.h`, `cx18-irq.h`, `cx18-gpio.h`, `cx18-firmware.h`.
- Detected declarations: `function request_module_async`, `function request_modules`, `function flush_request_modules`, `function cx18_msleep_timeout`, `function cx18_iounmap`, `function cx18_eeprom_dump`, `function cx18_read_eeprom`, `function cx18_process_eeprom`, `function cx18_parse_std`, `function cx18_process_options`.
- Atlas domain: Driver Families / drivers/media.
- Implementation status: pattern 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.