drivers/media/pci/mgb4/mgb4_core.c
Source file repositories/reference/linux-study-clean/drivers/media/pci/mgb4/mgb4_core.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/media/pci/mgb4/mgb4_core.c- Extension
.c- Size
- 18120 bytes
- Lines
- 716
- 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.
- Touches user memory; correctness depends on fault-safe copying and privilege boundary handling.
- 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/types.hlinux/module.hlinux/pci.hlinux/platform_device.hlinux/clk.hlinux/clk-provider.hlinux/clkdev.hlinux/i2c.hlinux/delay.hlinux/dma/amd_xdma.hlinux/platform_data/amd_xdma.hlinux/spi/xilinx_spi.hlinux/mtd/mtd.hlinux/hwmon.hlinux/debugfs.hmgb4_dma.hmgb4_i2c.hmgb4_sysfs.hmgb4_vout.hmgb4_vin.hmgb4_trigger.hmgb4_core.h
Detected Declarations
function temp_is_visiblefunction temp_readfunction temp_read_stringfunction match_i2c_adapfunction match_spi_adapfunction init_spifunction free_spifunction init_i2cfunction free_i2cfunction get_serial_numberfunction get_module_versionfunction MGB4_IS_GMSL3function map_regsfunction init_xdmafunction free_xdmafunction mgb4_probefunction mgb4_remove
Annotated Snippet
static struct pci_driver mgb4_pci_driver = {
.name = KBUILD_MODNAME,
.id_table = mgb4_pci_ids,
.probe = mgb4_probe,
.remove = mgb4_remove,
};
module_pci_driver(mgb4_pci_driver);
MODULE_AUTHOR("Digiteq Automotive s.r.o.");
MODULE_DESCRIPTION("Digiteq Automotive MGB4 Driver");
MODULE_LICENSE("GPL");
MODULE_SOFTDEP("pre: platform:xiic-i2c platform:xilinx_spi spi-nor");
Annotation
- Immediate include surface: `linux/types.h`, `linux/module.h`, `linux/pci.h`, `linux/platform_device.h`, `linux/clk.h`, `linux/clk-provider.h`, `linux/clkdev.h`, `linux/i2c.h`.
- Detected declarations: `function temp_is_visible`, `function temp_read`, `function temp_read_string`, `function match_i2c_adap`, `function match_spi_adap`, `function init_spi`, `function free_spi`, `function init_i2c`, `function free_i2c`, `function get_serial_number`.
- Atlas domain: Driver Families / drivers/media.
- Implementation status: pattern implementation candidate.
- This snippet crosses the user/kernel memory boundary; validate fault handling and access checks before translating the pattern.
- 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.