drivers/media/pci/ivtv/ivtv-driver.c
Source file repositories/reference/linux-study-clean/drivers/media/pci/ivtv/ivtv-driver.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/media/pci/ivtv/ivtv-driver.c- Extension
.c- Size
- 45178 bytes
- Lines
- 1456
- 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
ivtv-driver.hivtv-version.hivtv-fileops.hivtv-i2c.hivtv-firmware.hivtv-queue.hivtv-udma.hivtv-irq.hivtv-mailbox.hivtv-streams.hivtv-ioctl.hivtv-cards.hivtv-vbi.hivtv-routing.hivtv-controls.hivtv-gpio.hlinux/dma-mapping.hmedia/tveeprom.hmedia/i2c/saa7115.hxc2028.huapi/linux/sched/types.h
Detected Declarations
function request_module_asyncfunction request_modulesfunction flush_request_modulesfunction ivtv_clear_irq_maskfunction ivtv_set_irq_maskfunction ivtv_set_output_modefunction ivtv_waitqfunction ivtv_msleep_timeoutfunction ivtv_read_eepromfunction ivtv_process_eepromfunction ivtv_parse_stdfunction ivtv_process_optionsfunction herefunction ivtv_init_struct2function ivtv_setup_pcifunction ivtv_load_and_init_modulesfunction ivtv_probefunction ivtv_init_on_first_openfunction ivtv_removefunction module_startfunction module_cleanupmodule init module_startexport ivtv_ext_initexport ivtv_set_irq_maskexport ivtv_apiexport ivtv_vapiexport ivtv_vapi_resultexport ivtv_clear_irq_maskexport ivtv_debugexport ivtv_fw_debugexport ivtv_reset_ir_gpioexport ivtv_udma_setupexport ivtv_udma_unmapexport ivtv_udma_allocexport ivtv_udma_prepareexport ivtv_init_on_first_openexport ivtv_firmware_check
Annotated Snippet
static struct pci_driver ivtv_pci_driver = {
.name = "ivtv",
.id_table = ivtv_pci_tbl,
.probe = ivtv_probe,
.remove = ivtv_remove,
};
static int __init module_start(void)
{
pr_info("Start initialization, version %s\n", IVTV_VERSION);
/* Validate parameters */
if (ivtv_first_minor < 0 || ivtv_first_minor >= IVTV_MAX_CARDS) {
pr_err("Exiting, ivtv_first_minor must be between 0 and %d\n",
IVTV_MAX_CARDS - 1);
return -1;
}
if (ivtv_debug < 0 || ivtv_debug > 2047) {
ivtv_debug = 0;
pr_info("Debug value must be >= 0 and <= 2047\n");
}
if (pci_register_driver(&ivtv_pci_driver)) {
pr_err("Error detecting PCI card\n");
return -ENODEV;
}
pr_info("End initialization\n");
return 0;
}
static void __exit module_cleanup(void)
{
pci_unregister_driver(&ivtv_pci_driver);
}
/* Note: These symbols are exported because they are used by the ivtvfb
framebuffer module and an infrared module for the IR-blaster. */
EXPORT_SYMBOL(ivtv_set_irq_mask);
EXPORT_SYMBOL(ivtv_api);
EXPORT_SYMBOL(ivtv_vapi);
EXPORT_SYMBOL(ivtv_vapi_result);
EXPORT_SYMBOL(ivtv_clear_irq_mask);
EXPORT_SYMBOL(ivtv_debug);
#ifdef CONFIG_VIDEO_ADV_DEBUG
EXPORT_SYMBOL(ivtv_fw_debug);
#endif
EXPORT_SYMBOL(ivtv_reset_ir_gpio);
EXPORT_SYMBOL(ivtv_udma_setup);
EXPORT_SYMBOL(ivtv_udma_unmap);
EXPORT_SYMBOL(ivtv_udma_alloc);
EXPORT_SYMBOL(ivtv_udma_prepare);
EXPORT_SYMBOL(ivtv_init_on_first_open);
EXPORT_SYMBOL(ivtv_firmware_check);
module_init(module_start);
module_exit(module_cleanup);
Annotation
- Immediate include surface: `ivtv-driver.h`, `ivtv-version.h`, `ivtv-fileops.h`, `ivtv-i2c.h`, `ivtv-firmware.h`, `ivtv-queue.h`, `ivtv-udma.h`, `ivtv-irq.h`.
- Detected declarations: `function request_module_async`, `function request_modules`, `function flush_request_modules`, `function ivtv_clear_irq_mask`, `function ivtv_set_irq_mask`, `function ivtv_set_output_mode`, `function ivtv_waitq`, `function ivtv_msleep_timeout`, `function ivtv_read_eeprom`, `function ivtv_process_eeprom`.
- 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.