drivers/media/platform/samsung/exynos4-is/mipi-csis.c
Source file repositories/reference/linux-study-clean/drivers/media/platform/samsung/exynos4-is/mipi-csis.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/media/platform/samsung/exynos4-is/mipi-csis.c- Extension
.c- Size
- 27471 bytes
- Lines
- 1042
- 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/clk.hlinux/delay.hlinux/device.hlinux/errno.hlinux/interrupt.hlinux/io.hlinux/irq.hlinux/kernel.hlinux/memory.hlinux/module.hlinux/of.hlinux/of_graph.hlinux/phy/phy.hlinux/platform_device.hlinux/pm_runtime.hlinux/regulator/consumer.hlinux/sizes.hlinux/slab.hlinux/spinlock.hlinux/videodev2.hmedia/drv-intf/exynos-fimc.hmedia/v4l2-fwnode.hmedia/v4l2-subdev.hmipi-csis.h
Detected Declarations
struct s5pcsis_eventstruct csis_pktbufstruct csis_drvdatastruct csis_statestruct csis_pix_formatfunction s5pcsis_enable_interruptsfunction s5pcsis_resetfunction s5pcsis_system_enablefunction __s5pcsis_set_formatfunction s5pcsis_set_hsync_settlefunction s5pcsis_set_paramsfunction s5pcsis_clk_putfunction s5pcsis_clk_getfunction dump_regsfunction s5pcsis_start_streamfunction s5pcsis_stop_streamfunction s5pcsis_clear_countersfunction s5pcsis_log_countersfunction s5pcsis_s_powerfunction s5pcsis_s_streamfunction s5pcsis_enum_mbus_codefunction s5pcsis_set_fmtfunction s5pcsis_get_fmtfunction s5pcsis_s_rx_bufferfunction s5pcsis_log_statusfunction s5pcsis_irq_handlerfunction s5pcsis_parse_dtfunction s5pcsis_probefunction s5pcsis_pm_suspendfunction s5pcsis_pm_resumefunction s5pcsis_suspendfunction s5pcsis_resumefunction s5pcsis_runtime_suspendfunction s5pcsis_runtime_resumefunction s5pcsis_remove
Annotated Snippet
struct s5pcsis_event {
u32 mask;
const char * const name;
unsigned int counter;
};
static const struct s5pcsis_event s5pcsis_events[] = {
/* Errors */
{ S5PCSIS_INTSRC_ERR_SOT_HS, "SOT Error" },
{ S5PCSIS_INTSRC_ERR_LOST_FS, "Lost Frame Start Error" },
{ S5PCSIS_INTSRC_ERR_LOST_FE, "Lost Frame End Error" },
{ S5PCSIS_INTSRC_ERR_OVER, "FIFO Overflow Error" },
{ S5PCSIS_INTSRC_ERR_ECC, "ECC Error" },
{ S5PCSIS_INTSRC_ERR_CRC, "CRC Error" },
{ S5PCSIS_INTSRC_ERR_UNKNOWN, "Unknown Error" },
/* Non-image data receive events */
{ S5PCSIS_INTSRC_EVEN_BEFORE, "Non-image data before even frame" },
{ S5PCSIS_INTSRC_EVEN_AFTER, "Non-image data after even frame" },
{ S5PCSIS_INTSRC_ODD_BEFORE, "Non-image data before odd frame" },
{ S5PCSIS_INTSRC_ODD_AFTER, "Non-image data after odd frame" },
/* Frame start/end */
{ S5PCSIS_INTSRC_FRAME_START, "Frame Start" },
{ S5PCSIS_INTSRC_FRAME_END, "Frame End" },
};
#define S5PCSIS_NUM_EVENTS ARRAY_SIZE(s5pcsis_events)
struct csis_pktbuf {
u32 *data;
unsigned int len;
};
struct csis_drvdata {
/* Mask of all used interrupts in S5PCSIS_INTMSK register */
u32 interrupt_mask;
};
/**
* struct csis_state - the driver's internal state data structure
* @lock: mutex serializing the subdev and power management operations,
* protecting @format and @flags members
* @pads: CSIS pads array
* @sd: v4l2_subdev associated with CSIS device instance
* @index: the hardware instance index
* @pdev: CSIS platform device
* @phy: pointer to the CSIS generic PHY
* @regs: mmapped I/O registers memory
* @supplies: CSIS regulator supplies
* @clock: CSIS clocks
* @irq: requested s5p-mipi-csis irq number
* @interrupt_mask: interrupt mask of the all used interrupts
* @flags: the state variable for power and streaming control
* @clk_frequency: device bus clock frequency
* @hs_settle: HS-RX settle time
* @num_lanes: number of MIPI-CSI data lanes used
* @max_num_lanes: maximum number of MIPI-CSI data lanes supported
* @wclk_ext: CSI wrapper clock: 0 - bus clock, 1 - external SCLK_CAM
* @csis_fmt: current CSIS pixel format
* @format: common media bus format for the source and sink pad
* @slock: spinlock protecting structure members below
* @pkt_buf: the frame embedded (non-image) data buffer
* @events: MIPI-CSIS event (error) counters
*/
struct csis_state {
struct mutex lock;
struct media_pad pads[CSIS_PADS_NUM];
struct v4l2_subdev sd;
u8 index;
struct platform_device *pdev;
struct phy *phy;
void __iomem *regs;
struct regulator_bulk_data supplies[CSIS_NUM_SUPPLIES];
struct clk *clock[NUM_CSIS_CLOCKS];
int irq;
u32 interrupt_mask;
u32 flags;
u32 clk_frequency;
u32 hs_settle;
u32 num_lanes;
u32 max_num_lanes;
u8 wclk_ext;
const struct csis_pix_format *csis_fmt;
struct v4l2_mbus_framefmt format;
spinlock_t slock;
struct csis_pktbuf pkt_buf;
struct s5pcsis_event events[S5PCSIS_NUM_EVENTS];
};
Annotation
- Immediate include surface: `linux/clk.h`, `linux/delay.h`, `linux/device.h`, `linux/errno.h`, `linux/interrupt.h`, `linux/io.h`, `linux/irq.h`, `linux/kernel.h`.
- Detected declarations: `struct s5pcsis_event`, `struct csis_pktbuf`, `struct csis_drvdata`, `struct csis_state`, `struct csis_pix_format`, `function s5pcsis_enable_interrupts`, `function s5pcsis_reset`, `function s5pcsis_system_enable`, `function __s5pcsis_set_format`, `function s5pcsis_set_hsync_settle`.
- 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.