drivers/media/platform/marvell/cafe-driver.c
Source file repositories/reference/linux-study-clean/drivers/media/platform/marvell/cafe-driver.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/media/platform/marvell/cafe-driver.c- Extension
.c- Size
- 18208 bytes
- Lines
- 683
- 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/kernel.hlinux/module.hlinux/init.hlinux/pci.hlinux/i2c.hlinux/interrupt.hlinux/spinlock.hlinux/slab.hlinux/videodev2.hmedia/v4l2-device.hmedia/i2c/ov7670.hlinux/device.hlinux/wait.hlinux/delay.hlinux/io.hlinux/clkdev.hmcam-core.h
Detected Declarations
struct cafe_camerafunction cafe_smbus_write_donefunction cafe_smbus_write_datafunction cafe_smbus_read_donefunction cafe_smbus_read_datafunction cafe_smbus_xferfunction cafe_smbus_enable_irqfunction cafe_smbus_funcfunction cafe_smbus_setupfunction cafe_smbus_shutdownfunction cafe_ctlr_initfunction cafe_ctlr_power_upfunction cafe_ctlr_power_downfunction cafe_irqfunction cafe_pci_probefunction cafe_shutdownfunction cafe_pci_removefunction cafe_pci_suspendfunction cafe_pci_resumefunction cafe_initfunction cafe_exitmodule init cafe_init
Annotated Snippet
static struct pci_driver cafe_pci_driver = {
.name = "cafe1000-ccic",
.id_table = cafe_ids,
.probe = cafe_pci_probe,
.remove = cafe_pci_remove,
.driver.pm = &cafe_pci_pm_ops,
};
static int __init cafe_init(void)
{
int ret;
printk(KERN_NOTICE "Marvell M88ALP01 'CAFE' Camera Controller version %d\n",
CAFE_VERSION);
ret = pci_register_driver(&cafe_pci_driver);
if (ret) {
printk(KERN_ERR "Unable to register cafe_ccic driver\n");
goto out;
}
ret = 0;
out:
return ret;
}
static void __exit cafe_exit(void)
{
pci_unregister_driver(&cafe_pci_driver);
}
module_init(cafe_init);
module_exit(cafe_exit);
Annotation
- Immediate include surface: `linux/kernel.h`, `linux/module.h`, `linux/init.h`, `linux/pci.h`, `linux/i2c.h`, `linux/interrupt.h`, `linux/spinlock.h`, `linux/slab.h`.
- Detected declarations: `struct cafe_camera`, `function cafe_smbus_write_done`, `function cafe_smbus_write_data`, `function cafe_smbus_read_done`, `function cafe_smbus_read_data`, `function cafe_smbus_xfer`, `function cafe_smbus_enable_irq`, `function cafe_smbus_func`, `function cafe_smbus_setup`, `function cafe_smbus_shutdown`.
- 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.