drivers/media/platform/rockchip/rkcif/rkcif-common.h
Source file repositories/reference/linux-study-clean/drivers/media/platform/rockchip/rkcif/rkcif-common.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/media/platform/rockchip/rkcif/rkcif-common.h- Extension
.h- Size
- 5222 bytes
- Lines
- 251
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/clk.hlinux/mutex.hlinux/regmap.hmedia/media-device.hmedia/media-entity.hmedia/v4l2-common.hmedia/v4l2-device.hmedia/v4l2-fwnode.hmedia/v4l2-mc.hmedia/v4l2-subdev.hmedia/videobuf2-v4l2.hrkcif-regs.h
Detected Declarations
struct rkcif_bufferstruct rkcif_dummy_bufferstruct rkcif_input_fmtstruct rkcif_output_fmtstruct rkcif_interfacestruct rkcif_remotestruct rkcif_streamstruct rkcif_dvpstruct rkcif_interfacestruct rkcif_mipi_match_datastruct rkcif_dvp_match_datastruct rkcif_match_datastruct rkcif_deviceenum rkcif_format_typeenum rkcif_id_indexenum rkcif_interface_indexenum rkcif_interface_pad_indexenum rkcif_interface_statusenum rkcif_interface_typeenum rkcif_mipi_format_typeenum rkcif_plane_index
Annotated Snippet
struct rkcif_buffer {
struct vb2_v4l2_buffer vb;
struct list_head queue;
dma_addr_t buff_addr[VIDEO_MAX_PLANES];
bool is_dummy;
};
struct rkcif_dummy_buffer {
struct rkcif_buffer buffer;
void *vaddr;
u32 size;
};
enum rkcif_plane_index {
RKCIF_PLANE_Y,
RKCIF_PLANE_UV,
RKCIF_PLANE_MAX
};
struct rkcif_input_fmt {
u32 mbus_code;
enum rkcif_format_type fmt_type;
enum v4l2_field field;
union {
u32 dvp_fmt_val;
};
};
struct rkcif_output_fmt {
u32 fourcc;
u32 mbus_code;
u8 cplanes;
u8 depth;
union {
u32 dvp_fmt_val;
struct {
u8 dt;
bool compact;
enum rkcif_mipi_format_type type;
} mipi;
};
};
struct rkcif_interface;
struct rkcif_remote {
struct v4l2_async_connection async_conn;
struct v4l2_subdev *sd;
struct rkcif_interface *interface;
};
struct rkcif_stream {
enum rkcif_id_index id;
struct rkcif_device *rkcif;
struct rkcif_interface *interface;
const struct rkcif_output_fmt *out_fmts;
unsigned int out_fmts_num;
/* in ping-pong mode, two buffers can be provided to the HW */
struct rkcif_buffer *buffers[2];
int frame_idx;
int frame_phase;
/* in case of no available buffer, HW can write to the dummy buffer */
struct rkcif_dummy_buffer dummy;
bool stopping;
wait_queue_head_t wq_stopped;
/* queue of available buffers plus spinlock that protects it */
spinlock_t driver_queue_lock;
struct list_head driver_queue;
/* lock used by the V4L2 core */
struct mutex vlock;
struct media_pad pad;
struct media_pipeline pipeline;
struct v4l2_pix_format_mplane pix;
struct vb2_queue buf_queue;
struct video_device vdev;
void (*queue_buffer)(struct rkcif_stream *stream, unsigned int index);
int (*start_streaming)(struct rkcif_stream *stream);
void (*stop_streaming)(struct rkcif_stream *stream);
};
Annotation
- Immediate include surface: `linux/clk.h`, `linux/mutex.h`, `linux/regmap.h`, `media/media-device.h`, `media/media-entity.h`, `media/v4l2-common.h`, `media/v4l2-device.h`, `media/v4l2-fwnode.h`.
- Detected declarations: `struct rkcif_buffer`, `struct rkcif_dummy_buffer`, `struct rkcif_input_fmt`, `struct rkcif_output_fmt`, `struct rkcif_interface`, `struct rkcif_remote`, `struct rkcif_stream`, `struct rkcif_dvp`, `struct rkcif_interface`, `struct rkcif_mipi_match_data`.
- 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.