drivers/media/platform/microchip/microchip-csi2dc.c
Source file repositories/reference/linux-study-clean/drivers/media/platform/microchip/microchip-csi2dc.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/media/platform/microchip/microchip-csi2dc.c- Extension
.c- Size
- 21255 bytes
- Lines
- 798
- 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.
- 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/mod_devicetable.hlinux/module.hlinux/of_graph.hlinux/platform_device.hlinux/pm_runtime.hlinux/videodev2.hmedia/v4l2-fwnode.hmedia/v4l2-subdev.h
Detected Declarations
struct csi2dc_formatstruct csi2dc_deviceenum mipi_csi_padsfunction csi2dc_sd_to_csi2dc_devicefunction csi2dc_enum_mbus_codefunction csi2dc_get_fmtfunction csi2dc_set_fmtfunction csi2dc_powerfunction csi2dc_get_mbus_configfunction csi2dc_vp_updatefunction csi2dc_s_streamfunction csi2dc_init_statefunction csi2dc_async_boundfunction csi2dc_prepare_notifierfunction csi2dc_of_parsefunction csi2dc_default_formatfunction csi2dc_probefunction csi2dc_removefunction csi2dc_runtime_suspendfunction csi2dc_runtime_resume
Annotated Snippet
struct csi2dc_format {
u32 mbus_code;
u32 dt;
};
static const struct csi2dc_format csi2dc_formats[] = {
{
.mbus_code = MEDIA_BUS_FMT_SRGGB8_1X8,
.dt = CSI2DC_DT_RAW8,
}, {
.mbus_code = MEDIA_BUS_FMT_SBGGR8_1X8,
.dt = CSI2DC_DT_RAW8,
}, {
.mbus_code = MEDIA_BUS_FMT_SGRBG8_1X8,
.dt = CSI2DC_DT_RAW8,
}, {
.mbus_code = MEDIA_BUS_FMT_SGBRG8_1X8,
.dt = CSI2DC_DT_RAW8,
}, {
.mbus_code = MEDIA_BUS_FMT_SRGGB10_1X10,
.dt = CSI2DC_DT_RAW10,
}, {
.mbus_code = MEDIA_BUS_FMT_SBGGR10_1X10,
.dt = CSI2DC_DT_RAW10,
}, {
.mbus_code = MEDIA_BUS_FMT_SGRBG10_1X10,
.dt = CSI2DC_DT_RAW10,
}, {
.mbus_code = MEDIA_BUS_FMT_SGBRG10_1X10,
.dt = CSI2DC_DT_RAW10,
}, {
.mbus_code = MEDIA_BUS_FMT_YUYV8_2X8,
.dt = CSI2DC_DT_YUV422_8B,
},
};
enum mipi_csi_pads {
CSI2DC_PAD_SINK = 0,
CSI2DC_PAD_SOURCE = 1,
CSI2DC_PADS_NUM = 2,
};
/*
* struct csi2dc_device - CSI2DC device driver data/config struct
* @base: Register map base address
* @csi2dc_sd: v4l2 subdevice for the csi2dc device
* This is the subdevice that the csi2dc device itself
* registers in v4l2 subsystem
* @dev: struct device for this csi2dc device
* @pclk: Peripheral clock reference
* Input clock that clocks the hardware block internal
* logic
* @scck: Sensor Controller clock reference
* Input clock that is used to generate the pixel clock
* @format: Current saved format used in g/s fmt
* @cur_fmt: Current state format
* @try_fmt: Try format that is being tried
* @pads: Media entity pads for the csi2dc subdevice
* @clk_gated: Whether the clock is gated or free running
* @video_pipe: Whether video pipeline is configured
* @parallel_mode: The underlying subdevice is connected on a parallel bus
* @vc: Current set virtual channel
* @notifier: Async notifier that is used to bound the underlying
* subdevice to the csi2dc subdevice
* @input_sd: Reference to the underlying subdevice bound to the
* csi2dc subdevice
* @remote_pad: Pad number of the underlying subdevice that is linked
* to the csi2dc subdevice sink pad.
*/
struct csi2dc_device {
void __iomem *base;
struct v4l2_subdev csi2dc_sd;
struct device *dev;
struct clk *pclk;
struct clk *scck;
struct v4l2_mbus_framefmt format;
const struct csi2dc_format *cur_fmt;
const struct csi2dc_format *try_fmt;
struct media_pad pads[CSI2DC_PADS_NUM];
bool clk_gated;
bool video_pipe;
bool parallel_mode;
u32 vc;
struct v4l2_async_notifier notifier;
Annotation
- Immediate include surface: `linux/clk.h`, `linux/mod_devicetable.h`, `linux/module.h`, `linux/of_graph.h`, `linux/platform_device.h`, `linux/pm_runtime.h`, `linux/videodev2.h`, `media/v4l2-fwnode.h`.
- Detected declarations: `struct csi2dc_format`, `struct csi2dc_device`, `enum mipi_csi_pads`, `function csi2dc_sd_to_csi2dc_device`, `function csi2dc_enum_mbus_code`, `function csi2dc_get_fmt`, `function csi2dc_set_fmt`, `function csi2dc_power`, `function csi2dc_get_mbus_config`, `function csi2dc_vp_update`.
- Atlas domain: Driver Families / drivers/media.
- Implementation status: source implementation candidate.
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.