drivers/media/platform/nxp/imx-mipi-csis.c
Source file repositories/reference/linux-study-clean/drivers/media/platform/nxp/imx-mipi-csis.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/media/platform/nxp/imx-mipi-csis.c- Extension
.c- Size
- 49610 bytes
- Lines
- 1638
- Domain
- Driver Families
- Bucket
- drivers/media
- Inferred role
- Driver Families: implementation source
- Status
- source 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.
- 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/cleanup.hlinux/clk.hlinux/debugfs.hlinux/delay.hlinux/errno.hlinux/interrupt.hlinux/io.hlinux/kernel.hlinux/module.hlinux/mutex.hlinux/of.hlinux/platform_device.hlinux/pm_runtime.hlinux/regulator/consumer.hlinux/reset.hlinux/spinlock.hmedia/mipi-csi2.hmedia/v4l2-common.hmedia/v4l2-device.hmedia/v4l2-event.hmedia/v4l2-fwnode.hmedia/v4l2-mc.hmedia/v4l2-subdev.h
Detected Declarations
struct mipi_csis_eventstruct mipi_csis_infostruct mipi_csis_devicestruct csis_pix_formatstruct mipi_csis_reg_infoenum mipi_csis_clkenum mipi_csis_versionfunction mipi_csis_readfunction mipi_csis_writefunction mipi_csis_enable_interruptsfunction mipi_csis_sw_resetfunction mipi_csis_system_enablefunction __mipi_csis_set_formatfunction mipi_csis_calculate_paramsfunction mipi_csis_set_paramsfunction mipi_csis_clk_enablefunction mipi_csis_clk_disablefunction mipi_csis_clk_getfunction mipi_csis_start_streamfunction mipi_csis_stop_streamfunction mipi_csis_queue_event_soffunction mipi_csis_irq_handlerfunction mipi_csis_phy_enablefunction mipi_csis_phy_disablefunction mipi_csis_phy_resetfunction mipi_csis_phy_initfunction mipi_csis_clear_countersfunction mipi_csis_log_countersfunction mipi_csis_dump_channel_regfunction mipi_csis_dump_regsfunction mipi_csis_dump_regs_showfunction mipi_csis_debugfs_initfunction mipi_csis_debugfs_exitfunction mipi_csis_s_streamfunction mipi_csis_enum_mbus_codefunction mipi_csis_set_fmtfunction mipi_csis_get_frame_descfunction mipi_csis_init_statefunction mipi_csis_log_statusfunction mipi_csis_subscribe_eventfunction mipi_csis_link_setupfunction mipi_notifier_to_csis_statefunction mipi_csis_notify_boundfunction mipi_csis_async_registerfunction mipi_csis_runtime_suspendfunction mipi_csis_runtime_resumefunction mipi_csis_subdev_initfunction mipi_csis_parse_dt
Annotated Snippet
struct mipi_csis_event {
bool debug;
unsigned int channel;
u32 mask;
const char * const name;
unsigned int counter;
};
static const struct mipi_csis_event mipi_csis_events[] = {
/* Errors */
{ false, 0, MIPI_CSIS_INT_SRC_ERR_SOT_HS(0), "SOT 0 Error" },
{ false, 0, MIPI_CSIS_INT_SRC_ERR_SOT_HS(1), "SOT 1 Error" },
{ false, 0, MIPI_CSIS_INT_SRC_ERR_SOT_HS(2), "SOT 2 Error" },
{ false, 0, MIPI_CSIS_INT_SRC_ERR_SOT_HS(3), "SOT 3 Error" },
{ false, 0, MIPI_CSIS_INT_SRC_ERR_LOST_FS(0), "Lost Frame Start Error 0" },
{ false, 1, MIPI_CSIS_INT_SRC_ERR_LOST_FS(1), "Lost Frame Start Error 1" },
{ false, 2, MIPI_CSIS_INT_SRC_ERR_LOST_FS(2), "Lost Frame Start Error 2" },
{ false, 3, MIPI_CSIS_INT_SRC_ERR_LOST_FS(3), "Lost Frame Start Error 3" },
{ false, 0, MIPI_CSIS_INT_SRC_ERR_LOST_FE(0), "Lost Frame End Error 0" },
{ false, 1, MIPI_CSIS_INT_SRC_ERR_LOST_FE(1), "Lost Frame End Error 1" },
{ false, 2, MIPI_CSIS_INT_SRC_ERR_LOST_FE(2), "Lost Frame End Error 2" },
{ false, 3, MIPI_CSIS_INT_SRC_ERR_LOST_FE(3), "Lost Frame End Error 3" },
{ false, 0, MIPI_CSIS_INT_SRC_ERR_OVER(0), "FIFO Overflow Error 0" },
{ false, 1, MIPI_CSIS_INT_SRC_ERR_OVER(1), "FIFO Overflow Error 1" },
{ false, 2, MIPI_CSIS_INT_SRC_ERR_OVER(2), "FIFO Overflow Error 2" },
{ false, 3, MIPI_CSIS_INT_SRC_ERR_OVER(3), "FIFO Overflow Error 3" },
{ false, 0, MIPI_CSIS_INT_SRC_ERR_WRONG_CFG, "Wrong Configuration Error" },
{ false, 0, MIPI_CSIS_INT_SRC_ERR_ECC, "ECC Error" },
{ false, 0, MIPI_CSIS_INT_SRC_ERR_CRC, "CRC Error" },
{ false, 0, MIPI_CSIS_INT_SRC_ERR_ID, "Unknown ID Error" },
{ true, 0, MIPI_CSIS_DBG_INTR_SRC_DT_NOT_SUPPORT, "Data Type Not Supported" },
{ true, 0, MIPI_CSIS_DBG_INTR_SRC_DT_IGNORE, "Data Type Ignored" },
{ true, 0, MIPI_CSIS_DBG_INTR_SRC_ERR_FRAME_SIZE(0), "Frame Size Error 0" },
{ true, 1, MIPI_CSIS_DBG_INTR_SRC_ERR_FRAME_SIZE(1), "Frame Size Error 1" },
{ true, 2, MIPI_CSIS_DBG_INTR_SRC_ERR_FRAME_SIZE(2), "Frame Size Error 2" },
{ true, 3, MIPI_CSIS_DBG_INTR_SRC_ERR_FRAME_SIZE(3), "Frame Size Error 3" },
{ true, 0, MIPI_CSIS_DBG_INTR_SRC_TRUNCATED_FRAME(0), "Truncated Frame 0" },
{ true, 1, MIPI_CSIS_DBG_INTR_SRC_TRUNCATED_FRAME(1), "Truncated Frame 1" },
{ true, 2, MIPI_CSIS_DBG_INTR_SRC_TRUNCATED_FRAME(2), "Truncated Frame 2" },
{ true, 3, MIPI_CSIS_DBG_INTR_SRC_TRUNCATED_FRAME(3), "Truncated Frame 3" },
{ true, 0, MIPI_CSIS_DBG_INTR_SRC_EARLY_FE(0), "Early Frame End 0" },
{ true, 1, MIPI_CSIS_DBG_INTR_SRC_EARLY_FE(1), "Early Frame End 1" },
{ true, 2, MIPI_CSIS_DBG_INTR_SRC_EARLY_FE(2), "Early Frame End 2" },
{ true, 3, MIPI_CSIS_DBG_INTR_SRC_EARLY_FE(3), "Early Frame End 3" },
{ true, 0, MIPI_CSIS_DBG_INTR_SRC_EARLY_FS(0), "Early Frame Start 0" },
{ true, 1, MIPI_CSIS_DBG_INTR_SRC_EARLY_FS(1), "Early Frame Start 1" },
{ true, 2, MIPI_CSIS_DBG_INTR_SRC_EARLY_FS(2), "Early Frame Start 2" },
{ true, 3, MIPI_CSIS_DBG_INTR_SRC_EARLY_FS(3), "Early Frame Start 3" },
/* Non-image data receive events */
{ false, 0, MIPI_CSIS_INT_SRC_EVEN_BEFORE, "Non-image data before even frame" },
{ false, 0, MIPI_CSIS_INT_SRC_EVEN_AFTER, "Non-image data after even frame" },
{ false, 0, MIPI_CSIS_INT_SRC_ODD_BEFORE, "Non-image data before odd frame" },
{ false, 0, MIPI_CSIS_INT_SRC_ODD_AFTER, "Non-image data after odd frame" },
/* Frame start/end */
{ false, 0, MIPI_CSIS_INT_SRC_FRAME_START(0), "Frame Start 0" },
{ false, 1, MIPI_CSIS_INT_SRC_FRAME_START(1), "Frame Start 1" },
{ false, 2, MIPI_CSIS_INT_SRC_FRAME_START(2), "Frame Start 2" },
{ false, 3, MIPI_CSIS_INT_SRC_FRAME_START(3), "Frame Start 3" },
{ false, 0, MIPI_CSIS_INT_SRC_FRAME_END(0), "Frame End 0" },
{ false, 1, MIPI_CSIS_INT_SRC_FRAME_END(1), "Frame End 1" },
{ false, 2, MIPI_CSIS_INT_SRC_FRAME_END(2), "Frame End 2" },
{ false, 3, MIPI_CSIS_INT_SRC_FRAME_END(3), "Frame End 3" },
{ true, 0, MIPI_CSIS_DBG_INTR_SRC_CAM_VSYNC_FALL(0), "VSYNC Falling Edge 0" },
{ true, 1, MIPI_CSIS_DBG_INTR_SRC_CAM_VSYNC_FALL(1), "VSYNC Falling Edge 1" },
{ true, 2, MIPI_CSIS_DBG_INTR_SRC_CAM_VSYNC_FALL(2), "VSYNC Falling Edge 2" },
{ true, 3, MIPI_CSIS_DBG_INTR_SRC_CAM_VSYNC_FALL(3), "VSYNC Falling Edge 3" },
{ true, 0, MIPI_CSIS_DBG_INTR_SRC_CAM_VSYNC_RISE(0), "VSYNC Rising Edge 0" },
{ true, 1, MIPI_CSIS_DBG_INTR_SRC_CAM_VSYNC_RISE(1), "VSYNC Rising Edge 1" },
{ true, 2, MIPI_CSIS_DBG_INTR_SRC_CAM_VSYNC_RISE(2), "VSYNC Rising Edge 2" },
{ true, 3, MIPI_CSIS_DBG_INTR_SRC_CAM_VSYNC_RISE(3), "VSYNC Rising Edge 3" },
};
#define MIPI_CSIS_NUM_EVENTS ARRAY_SIZE(mipi_csis_events)
#define MIPI_CSIS_NUM_ERROR_EVENTS 38
enum mipi_csis_clk {
MIPI_CSIS_CLK_PCLK,
MIPI_CSIS_CLK_WRAP,
MIPI_CSIS_CLK_PHY,
MIPI_CSIS_CLK_AXI,
};
static const char * const mipi_csis_clk_id[] = {
"pclk",
"wrap",
"phy",
"axi",
};
enum mipi_csis_version {
Annotation
- Immediate include surface: `linux/cleanup.h`, `linux/clk.h`, `linux/debugfs.h`, `linux/delay.h`, `linux/errno.h`, `linux/interrupt.h`, `linux/io.h`, `linux/kernel.h`.
- Detected declarations: `struct mipi_csis_event`, `struct mipi_csis_info`, `struct mipi_csis_device`, `struct csis_pix_format`, `struct mipi_csis_reg_info`, `enum mipi_csis_clk`, `enum mipi_csis_version`, `function mipi_csis_read`, `function mipi_csis_write`, `function mipi_csis_enable_interrupts`.
- Atlas domain: Driver Families / drivers/media.
- Implementation status: source 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.