drivers/media/platform/xilinx/xilinx-csi2rxss.c
Source file repositories/reference/linux-study-clean/drivers/media/platform/xilinx/xilinx-csi2rxss.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/media/platform/xilinx/xilinx-csi2rxss.c- Extension
.c- Size
- 28609 bytes
- Lines
- 1039
- 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/gpio/consumer.hlinux/interrupt.hlinux/module.hlinux/mutex.hlinux/of.hlinux/of_irq.hlinux/platform_device.hlinux/v4l2-subdev.hmedia/media-entity.hmedia/mipi-csi2.hmedia/v4l2-common.hmedia/v4l2-ctrls.hmedia/v4l2-fwnode.hmedia/v4l2-subdev.hxilinx-vip.h
Detected Declarations
struct xcsi2rxss_eventstruct xcsi2rxss_statefunction to_xcsi2rxssstatefunction xcsi2rxss_readfunction xcsi2rxss_writefunction xcsi2rxss_clrfunction xcsi2rxss_setfunction xcsi2rxss_get_nth_mbusfunction xcsi2rxss_get_dtfunction xcsi2rxss_soft_resetfunction xcsi2rxss_hard_resetfunction xcsi2rxss_reset_event_countersfunction xcsi2rxss_log_countersfunction xcsi2rxss_log_statusfunction xcsi2rxss_start_streamfunction xcsi2rxss_stop_streamfunction xcsi2rxss_irq_handlerfunction xcsi2rxss_s_streamfunction __xcsi2rxss_get_pad_formatfunction xcsi2rxss_init_statefunction xcsi2rxss_get_formatfunction xcsi2rxss_set_formatfunction xcsi2rxss_enum_mbus_codefunction xcsi2rxss_parse_offunction xcsi2rxss_probefunction xcsi2rxss_remove
Annotated Snippet
struct xcsi2rxss_event {
u32 mask;
const char *name;
};
static const struct xcsi2rxss_event xcsi2rxss_events[] = {
{ XCSI_ISR_FR, "Frame Received" },
{ XCSI_ISR_VCXFE, "VCX Frame Errors" },
{ XCSI_ISR_WCC, "Word Count Errors" },
{ XCSI_ISR_ILC, "Invalid Lane Count Error" },
{ XCSI_ISR_SPFIFOF, "Short Packet FIFO OverFlow Error" },
{ XCSI_ISR_SPFIFONE, "Short Packet FIFO Not Empty" },
{ XCSI_ISR_SLBF, "Streamline Buffer Full Error" },
{ XCSI_ISR_STOP, "Lane Stop State" },
{ XCSI_ISR_SOTERR, "SOT Error" },
{ XCSI_ISR_SOTSYNCERR, "SOT Sync Error" },
{ XCSI_ISR_ECC2BERR, "2 Bit ECC Unrecoverable Error" },
{ XCSI_ISR_ECC1BERR, "1 Bit ECC Recoverable Error" },
{ XCSI_ISR_CRCERR, "CRC Error" },
{ XCSI_ISR_DATAIDERR, "Data Id Error" },
{ XCSI_ISR_VC3FSYNCERR, "Virtual Channel 3 Frame Sync Error" },
{ XCSI_ISR_VC3FLVLERR, "Virtual Channel 3 Frame Level Error" },
{ XCSI_ISR_VC2FSYNCERR, "Virtual Channel 2 Frame Sync Error" },
{ XCSI_ISR_VC2FLVLERR, "Virtual Channel 2 Frame Level Error" },
{ XCSI_ISR_VC1FSYNCERR, "Virtual Channel 1 Frame Sync Error" },
{ XCSI_ISR_VC1FLVLERR, "Virtual Channel 1 Frame Level Error" },
{ XCSI_ISR_VC0FSYNCERR, "Virtual Channel 0 Frame Sync Error" },
{ XCSI_ISR_VC0FLVLERR, "Virtual Channel 0 Frame Level Error" }
};
#define XCSI_NUM_EVENTS ARRAY_SIZE(xcsi2rxss_events)
/*
* This table provides a mapping between CSI-2 Data type
* and media bus formats
*/
static const u32 xcsi2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T_RAW16, MEDIA_BUS_FMT_SGBRG16_1X16 },
{ MIPI_CSI2_DT_RAW16, MEDIA_BUS_FMT_SGRBG16_1X16 },
{ MIPI_CSI2_DT_RAW20, 0 },
};
/**
* struct xcsi2rxss_state - CSI-2 Rx Subsystem device structure
* @subdev: The v4l2 subdev structure
* @format: Active V4L2 formats on each pad
* @default_format: Default V4L2 format
* @events: counter for events
* @vcx_events: counter for vcx_events
* @dev: Platform structure
* @rsubdev: Remote subdev connected to sink pad
* @rst_gpio: reset to video_aresetn
* @clks: array of clocks
* @iomem: Base address of subsystem
* @max_num_lanes: Maximum number of lanes present
* @datatype: Data type filter
* @lock: mutex for accessing this structure
* @pads: media pads
* @streaming: Flag for storing streaming state
* @enable_active_lanes: If number of active lanes can be modified
* @en_vcx: If more than 4 VC are enabled
*
* This structure contains the device driver related parameters
*/
struct xcsi2rxss_state {
struct v4l2_subdev subdev;
Annotation
- Immediate include surface: `linux/clk.h`, `linux/delay.h`, `linux/gpio/consumer.h`, `linux/interrupt.h`, `linux/module.h`, `linux/mutex.h`, `linux/of.h`, `linux/of_irq.h`.
- Detected declarations: `struct xcsi2rxss_event`, `struct xcsi2rxss_state`, `function to_xcsi2rxssstate`, `function xcsi2rxss_read`, `function xcsi2rxss_write`, `function xcsi2rxss_clr`, `function xcsi2rxss_set`, `function xcsi2rxss_get_nth_mbus`, `function xcsi2rxss_get_dt`, `function xcsi2rxss_soft_reset`.
- 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.