drivers/media/platform/rockchip/rkcif/rkcif-capture-dvp.c
Source file repositories/reference/linux-study-clean/drivers/media/platform/rockchip/rkcif/rkcif-capture-dvp.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/media/platform/rockchip/rkcif/rkcif-capture-dvp.c- Extension
.c- Size
- 23657 bytes
- Lines
- 866
- 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
media/v4l2-common.hmedia/v4l2-fwnode.hmedia/v4l2-mc.hmedia/v4l2-subdev.hrkcif-capture-dvp.hrkcif-common.hrkcif-interface.hrkcif-regs.hrkcif-stream.h
Detected Declarations
function rk3568_dvp_grf_setupfunction rkcif_dvp_get_addrfunction rkcif_dvp_writefunction rkcif_dvp_readfunction rkcif_dvp_queue_bufferfunction rkcif_dvp_start_streamingfunction rkcif_dvp_stop_streamingfunction rkcif_dvp_reset_streamfunction rkcif_dvp_set_cropfunction rkcif_dvp_isrfunction rkcif_dvp_registerfunction rkcif_dvp_unregister
Annotated Snippet
if (stream->stopping) {
rkcif_dvp_stop_streaming(stream);
wake_up(&stream->wq_stopped);
ret = IRQ_HANDLED;
goto out;
}
if (lastline != stream->pix.height) {
v4l2_err(&rkcif->v4l2_dev,
"bad frame, irq:%#x frmst:%#x size:%dx%d\n",
intstat, cif_frmst, lastpix, lastline);
rkcif_dvp_reset_stream(rkcif);
}
rkcif_stream_pingpong(stream);
ret = IRQ_HANDLED;
}
out:
return ret;
}
int rkcif_dvp_register(struct rkcif_device *rkcif)
{
struct rkcif_interface *interface;
unsigned int streams_num;
int ret;
if (!rkcif->match_data->dvp)
return 0;
interface = &rkcif->interfaces[RKCIF_DVP];
interface->index = RKCIF_DVP;
interface->type = RKCIF_IF_DVP;
interface->in_fmts = rkcif->match_data->dvp->in_fmts;
interface->in_fmts_num = rkcif->match_data->dvp->in_fmts_num;
interface->set_crop = rkcif_dvp_set_crop;
ret = rkcif_interface_register(rkcif, interface);
if (ret)
return ret;
if (rkcif->match_data->dvp->setup)
rkcif->match_data->dvp->setup(rkcif);
streams_num = rkcif->match_data->dvp->has_ids ? 4 : 1;
for (unsigned int i = 0; i < streams_num; i++) {
struct rkcif_stream *stream = &interface->streams[i];
stream->id = i;
stream->interface = interface;
stream->out_fmts = rkcif->match_data->dvp->out_fmts;
stream->out_fmts_num = rkcif->match_data->dvp->out_fmts_num;
stream->queue_buffer = rkcif_dvp_queue_buffer;
stream->start_streaming = rkcif_dvp_start_streaming;
stream->stop_streaming = rkcif_dvp_stop_streaming;
ret = rkcif_stream_register(rkcif, stream);
if (ret)
goto err_streams_unregister;
interface->streams_num++;
}
return 0;
err_streams_unregister:
for (unsigned int i = 0; i < interface->streams_num; i++)
rkcif_stream_unregister(&interface->streams[i]);
rkcif_interface_unregister(interface);
return ret;
}
void rkcif_dvp_unregister(struct rkcif_device *rkcif)
{
struct rkcif_interface *interface;
if (!rkcif->match_data->dvp)
return;
interface = &rkcif->interfaces[RKCIF_DVP];
for (unsigned int i = 0; i < interface->streams_num; i++)
rkcif_stream_unregister(&interface->streams[i]);
rkcif_interface_unregister(interface);
}
Annotation
- Immediate include surface: `media/v4l2-common.h`, `media/v4l2-fwnode.h`, `media/v4l2-mc.h`, `media/v4l2-subdev.h`, `rkcif-capture-dvp.h`, `rkcif-common.h`, `rkcif-interface.h`, `rkcif-regs.h`.
- Detected declarations: `function rk3568_dvp_grf_setup`, `function rkcif_dvp_get_addr`, `function rkcif_dvp_write`, `function rkcif_dvp_read`, `function rkcif_dvp_queue_buffer`, `function rkcif_dvp_start_streaming`, `function rkcif_dvp_stop_streaming`, `function rkcif_dvp_reset_stream`, `function rkcif_dvp_set_crop`, `function rkcif_dvp_isr`.
- 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.