drivers/media/platform/rockchip/rkcif/rkcif-capture-mipi.c
Source file repositories/reference/linux-study-clean/drivers/media/platform/rockchip/rkcif/rkcif-capture-mipi.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/media/platform/rockchip/rkcif/rkcif-capture-mipi.c- Extension
.c- Size
- 22956 bytes
- Lines
- 916
- 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.
- Touches IRQ or DMA behavior; this matters for the representative real-device path.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/interrupt.hmedia/mipi-csi2.hmedia/v4l2-common.hmedia/v4l2-event.hmedia/v4l2-fh.hmedia/v4l2-fwnode.hmedia/v4l2-ioctl.hmedia/v4l2-mc.hmedia/v4l2-subdev.hrkcif-capture-mipi.hrkcif-common.hrkcif-interface.hrkcif-regs.hrkcif-stream.h
Detected Declarations
function rkcif_rk3568_mipi_ctrl0function rkcif_rk3588_mipi_ctrl0function rkcif_mipi_get_regfunction rkcif_mipi_id_get_regfunction rkcif_mipi_writefunction rkcif_mipi_stream_writefunction rkcif_mipi_readfunction rkcif_mipi_stream_readfunction rkcif_mipi_queue_bufferfunction rkcif_mipi_start_streamingfunction rkcif_mipi_stop_streamingfunction rkcif_mipi_set_cropfunction rkcif_mipi_isrfunction rkcif_mipi_registerfunction rkcif_mipi_unregister
Annotated Snippet
if (stream->stopping) {
rkcif_mipi_stop_streaming(stream);
wake_up(&stream->wq_stopped);
continue;
}
rkcif_stream_pingpong(stream);
}
}
}
return ret;
}
int rkcif_mipi_register(struct rkcif_device *rkcif)
{
int ret;
if (!rkcif->match_data->mipi)
return 0;
for (unsigned int i = 0; i < rkcif->match_data->mipi->mipi_num; i++) {
enum rkcif_interface_index index = RKCIF_MIPI_BASE + i;
struct rkcif_interface *interface = &rkcif->interfaces[index];
interface->index = index;
interface->type = RKCIF_IF_MIPI;
interface->in_fmts = mipi_in_fmts;
interface->in_fmts_num = ARRAY_SIZE(mipi_in_fmts);
interface->set_crop = rkcif_mipi_set_crop;
interface->streams_num = 0;
ret = rkcif_interface_register(rkcif, interface);
if (ret)
continue;
for (unsigned int j = 0; j < RKCIF_ID_MAX; j++) {
struct rkcif_stream *stream = &interface->streams[j];
stream->id = j;
stream->interface = interface;
stream->out_fmts = mipi_out_fmts;
stream->out_fmts_num = ARRAY_SIZE(mipi_out_fmts);
stream->queue_buffer = rkcif_mipi_queue_buffer;
stream->start_streaming = rkcif_mipi_start_streaming;
stream->stop_streaming = rkcif_mipi_stop_streaming;
ret = rkcif_stream_register(rkcif, stream);
if (ret)
goto err;
interface->streams_num++;
}
}
return 0;
err:
for (unsigned int i = 0; i < rkcif->match_data->mipi->mipi_num; i++) {
enum rkcif_interface_index index = RKCIF_MIPI_BASE + i;
struct rkcif_interface *interface = &rkcif->interfaces[index];
for (unsigned int j = 0; j < interface->streams_num; j++)
rkcif_stream_unregister(&interface->streams[j]);
rkcif_interface_unregister(interface);
}
return ret;
}
void rkcif_mipi_unregister(struct rkcif_device *rkcif)
{
if (!rkcif->match_data->mipi)
return;
for (unsigned int i = 0; i < rkcif->match_data->mipi->mipi_num; i++) {
enum rkcif_interface_index index = RKCIF_MIPI_BASE + i;
struct rkcif_interface *interface = &rkcif->interfaces[index];
for (unsigned int j = 0; j < interface->streams_num; j++)
rkcif_stream_unregister(&interface->streams[j]);
rkcif_interface_unregister(interface);
}
}
Annotation
- Immediate include surface: `linux/interrupt.h`, `media/mipi-csi2.h`, `media/v4l2-common.h`, `media/v4l2-event.h`, `media/v4l2-fh.h`, `media/v4l2-fwnode.h`, `media/v4l2-ioctl.h`, `media/v4l2-mc.h`.
- Detected declarations: `function rkcif_rk3568_mipi_ctrl0`, `function rkcif_rk3588_mipi_ctrl0`, `function rkcif_mipi_get_reg`, `function rkcif_mipi_id_get_reg`, `function rkcif_mipi_write`, `function rkcif_mipi_stream_write`, `function rkcif_mipi_read`, `function rkcif_mipi_stream_read`, `function rkcif_mipi_queue_buffer`, `function rkcif_mipi_start_streaming`.
- Atlas domain: Driver Families / drivers/media.
- Implementation status: source implementation candidate.
- 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.