drivers/media/platform/qcom/camss/camss-vfe-4-7.c
Source file repositories/reference/linux-study-clean/drivers/media/platform/qcom/camss/camss-vfe-4-7.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/media/platform/qcom/camss/camss-vfe-4-7.c- Extension
.c- Size
- 36279 bytes
- Lines
- 1161
- 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/device.hlinux/interrupt.hlinux/io.hlinux/iopoll.hcamss.hcamss-vfe.hcamss-vfe-gen1.h
Detected Declarations
function Copyrightfunction vfe_reg_clrfunction vfe_reg_setfunction vfe_global_resetfunction vfe_halt_requestfunction vfe_halt_clearfunction vfe_wm_enablefunction vfe_wm_frame_basedfunction vfe_word_per_line_by_pixelfunction vfe_word_per_line_by_bytesfunction vfe_get_wm_sizesfunction vfe_wm_line_basedfunction vfe_wm_set_framedrop_periodfunction vfe_wm_set_framedrop_patternfunction vfe_wm_set_ub_cfgfunction vfe_bus_reload_wmfunction vfe_wm_set_ping_addrfunction vfe_wm_set_pong_addrfunction vfe_wm_get_ping_pong_statusfunction vfe_bus_enable_wr_iffunction vfe_bus_connect_wm_to_rdifunction vfe_wm_set_subsamplefunction vfe_bus_disconnect_wm_from_rdifunction vfe_set_xbar_cfgfunction vfe_set_realign_cfgfunction vfe_set_rdi_cidfunction vfe_reg_updatefunction vfe_reg_update_clearfunction vfe_enable_irq_wm_linefunction vfe_enable_irq_pix_linefunction vfe_enable_irq_commonfunction vfe_set_demux_cfgfunction vfe_set_scale_cfgfunction vfe_set_crop_cfgfunction vfe_set_clamp_cfgfunction vfe_set_qosfunction vfe_set_dsfunction vfe_set_cgc_overridefunction vfe_set_camif_cmdfunction vfe_set_module_cfgfunction vfe_camif_wait_for_stopfunction vfe_isrfunction vfe_isr_readfunction vfe_violation_readfunction vfe_subdev_init
Annotated Snippet
if (value0 & VFE_0_IRQ_STATUS_0_IMAGE_COMPOSITE_DONE_n(i)) {
vfe->isr_ops.comp_done(vfe, i);
for (j = 0; j < ARRAY_SIZE(vfe->wm_output_map); j++)
if (vfe->wm_output_map[j] == VFE_LINE_PIX)
value0 &= ~VFE_0_IRQ_MASK_0_IMAGE_MASTER_n_PING_PONG(j);
}
for (i = 0; i < MSM_VFE_IMAGE_MASTERS_NUM; i++)
if (value0 & VFE_0_IRQ_STATUS_0_IMAGE_MASTER_n_PING_PONG(i))
vfe->isr_ops.wm_done(vfe, i);
return IRQ_HANDLED;
}
static void vfe_isr_read(struct vfe_device *vfe, u32 *value0, u32 *value1)
{
*value0 = readl_relaxed(vfe->base + VFE_0_IRQ_STATUS_0);
*value1 = readl_relaxed(vfe->base + VFE_0_IRQ_STATUS_1);
writel_relaxed(*value0, vfe->base + VFE_0_IRQ_CLEAR_0);
writel_relaxed(*value1, vfe->base + VFE_0_IRQ_CLEAR_1);
/* Enforce barrier between local & global IRQ clear */
wmb();
writel_relaxed(VFE_0_IRQ_CMD_GLOBAL_CLEAR, vfe->base + VFE_0_IRQ_CMD);
}
static void vfe_violation_read(struct vfe_device *vfe)
{
u32 violation = readl_relaxed(vfe->base + VFE_0_VIOLATION_STATUS);
pr_err_ratelimited("VFE: violation = 0x%08x\n", violation);
}
static const struct vfe_hw_ops_gen1 vfe_ops_gen1_4_7 = {
.bus_connect_wm_to_rdi = vfe_bus_connect_wm_to_rdi,
.bus_disconnect_wm_from_rdi = vfe_bus_disconnect_wm_from_rdi,
.bus_enable_wr_if = vfe_bus_enable_wr_if,
.bus_reload_wm = vfe_bus_reload_wm,
.camif_wait_for_stop = vfe_camif_wait_for_stop,
.enable_irq_common = vfe_enable_irq_common,
.enable_irq_pix_line = vfe_enable_irq_pix_line,
.enable_irq_wm_line = vfe_enable_irq_wm_line,
.get_ub_size = vfe_get_ub_size,
.halt_clear = vfe_halt_clear,
.halt_request = vfe_halt_request,
.set_camif_cfg = vfe_set_camif_cfg,
.set_camif_cmd = vfe_set_camif_cmd,
.set_cgc_override = vfe_set_cgc_override,
.set_clamp_cfg = vfe_set_clamp_cfg,
.set_crop_cfg = vfe_set_crop_cfg,
.set_demux_cfg = vfe_set_demux_cfg,
.set_ds = vfe_set_ds,
.set_module_cfg = vfe_set_module_cfg,
.set_qos = vfe_set_qos,
.set_rdi_cid = vfe_set_rdi_cid,
.set_realign_cfg = vfe_set_realign_cfg,
.set_scale_cfg = vfe_set_scale_cfg,
.set_xbar_cfg = vfe_set_xbar_cfg,
.wm_enable = vfe_wm_enable,
.wm_frame_based = vfe_wm_frame_based,
.wm_get_ping_pong_status = vfe_wm_get_ping_pong_status,
.wm_line_based = vfe_wm_line_based,
.wm_set_framedrop_pattern = vfe_wm_set_framedrop_pattern,
.wm_set_framedrop_period = vfe_wm_set_framedrop_period,
.wm_set_ping_addr = vfe_wm_set_ping_addr,
.wm_set_pong_addr = vfe_wm_set_pong_addr,
.wm_set_subsample = vfe_wm_set_subsample,
.wm_set_ub_cfg = vfe_wm_set_ub_cfg,
};
static void vfe_subdev_init(struct device *dev, struct vfe_device *vfe)
{
vfe->isr_ops = vfe_isr_ops_gen1;
vfe->ops_gen1 = &vfe_ops_gen1_4_7;
vfe->video_ops = vfe_video_ops_gen1;
}
const struct vfe_hw_ops vfe_ops_4_7 = {
.global_reset = vfe_global_reset,
.hw_version = vfe_hw_version,
.isr_read = vfe_isr_read,
.isr = vfe_isr,
.pm_domain_off = vfe_pm_domain_off,
.pm_domain_on = vfe_pm_domain_on,
.reg_update_clear = vfe_reg_update_clear,
.reg_update = vfe_reg_update,
.subdev_init = vfe_subdev_init,
.vfe_disable = vfe_gen1_disable,
.vfe_enable = vfe_gen1_enable,
Annotation
- Immediate include surface: `linux/device.h`, `linux/interrupt.h`, `linux/io.h`, `linux/iopoll.h`, `camss.h`, `camss-vfe.h`, `camss-vfe-gen1.h`.
- Detected declarations: `function Copyright`, `function vfe_reg_clr`, `function vfe_reg_set`, `function vfe_global_reset`, `function vfe_halt_request`, `function vfe_halt_clear`, `function vfe_wm_enable`, `function vfe_wm_frame_based`, `function vfe_word_per_line_by_pixel`, `function vfe_word_per_line_by_bytes`.
- 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.