drivers/media/pci/bt8xx/bttv-driver.c
Source file repositories/reference/linux-study-clean/drivers/media/pci/bt8xx/bttv-driver.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/media/pci/bt8xx/bttv-driver.c- Extension
.c- Size
- 98738 bytes
- Lines
- 3626
- 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
linux/init.hlinux/module.hlinux/delay.hlinux/slab.hlinux/errno.hlinux/fs.hlinux/kernel.hlinux/sched.hlinux/interrupt.hlinux/kdev_t.hbttvp.hmedia/v4l2-common.hmedia/v4l2-ioctl.hmedia/v4l2-event.hmedia/i2c/tvaudio.hmedia/drv-intf/msp3400.hlinux/dma-mapping.hasm/io.hasm/byteorder.hmedia/i2c/saa6588.h
Detected Declarations
function card_showfunction request_module_asyncfunction request_modulesfunction flush_request_modulesfunction check_alloc_btres_lockfunction check_btresfunction locked_btresfunction disclaim_vbi_linesfunction disclaim_video_linesfunction free_btres_lockfunction PALfunction set_pllfunction bt848A_set_timingfunction bt848_brightfunction bt848_huefunction bt848_contrastfunction bt848_satfunction video_muxfunction audio_mux_gpiofunction audio_mutefunction audio_inputfunction bttv_crop_calc_limitsfunction bttv_crop_resetfunction set_tvnormfunction set_inputfunction init_irqregfunction init_bt848function bttv_reinit_bt848function bttv_s_ctrlfunction bttv_gpio_trackingfunction format_by_fourccfunction queue_setupfunction buf_queuefunction buf_preparefunction buf_cleanupfunction start_streamingfunction stop_streamingfunction radio_enablefunction bttv_s_stdfunction bttv_g_stdfunction bttv_querystdfunction bttv_enum_inputfunction bttv_g_inputfunction bttv_s_inputfunction bttv_s_tunerfunction bttv_g_frequencyfunction bttv_set_frequencyfunction bttv_s_frequency
Annotated Snippet
static struct pci_driver bttv_pci_driver = {
.name = "bttv",
.id_table = bttv_pci_tbl,
.probe = bttv_probe,
.remove = bttv_remove,
.driver.pm = &bttv_pm_ops,
};
static int __init bttv_init_module(void)
{
int ret;
bttv_num = 0;
pr_info("driver version %s loaded\n", BTTV_VERSION);
if (gbuffers < 2 || gbuffers > VIDEO_MAX_FRAME)
gbuffers = 2;
if (gbufsize > BTTV_MAX_FBUF)
gbufsize = BTTV_MAX_FBUF;
gbufsize = (gbufsize + PAGE_SIZE - 1) & PAGE_MASK;
if (bttv_verbose)
pr_info("using %d buffers with %dk (%d pages) each for capture\n",
gbuffers, gbufsize >> 10, gbufsize >> PAGE_SHIFT);
bttv_check_chipset();
ret = bus_register(&bttv_sub_bus_type);
if (ret < 0) {
pr_warn("bus_register error: %d\n", ret);
return ret;
}
ret = pci_register_driver(&bttv_pci_driver);
if (ret < 0)
bus_unregister(&bttv_sub_bus_type);
return ret;
}
static void __exit bttv_cleanup_module(void)
{
pci_unregister_driver(&bttv_pci_driver);
bus_unregister(&bttv_sub_bus_type);
}
module_init(bttv_init_module);
module_exit(bttv_cleanup_module);
Annotation
- Immediate include surface: `linux/init.h`, `linux/module.h`, `linux/delay.h`, `linux/slab.h`, `linux/errno.h`, `linux/fs.h`, `linux/kernel.h`, `linux/sched.h`.
- Detected declarations: `function card_show`, `function request_module_async`, `function request_modules`, `function flush_request_modules`, `function check_alloc_btres_lock`, `function check_btres`, `function locked_btres`, `function disclaim_vbi_lines`, `function disclaim_video_lines`, `function free_btres_lock`.
- 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.