drivers/media/platform/qcom/camss/camss-vfe-4-8.c
Source file repositories/reference/linux-study-clean/drivers/media/platform/qcom/camss/camss-vfe-4-8.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/media/platform/qcom/camss/camss-vfe-4-8.c- Extension
.c- Size
- 36175 bytes
- Lines
- 1151
- 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_setfunction vfe_global_resetfunction vfe_halt_requestfunction vfe_halt_clearfunction 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_cgc_overridefunction vfe_set_camif_cmdfunction vfe_set_module_cfgfunction vfe_camif_wait_for_stopfunction vfe_isrfunction vfe_get_ub_sizefunction vfe_wm_enablefunction vfe_set_qosfunction vfe_set_dsfunction 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 u16 vfe_get_ub_size(u8 vfe_id)
{
/* On VFE4.8 the ub-size is the same on both instances */
return MSM_VFE_VFE0_UB_SIZE_RDI;
}
static void vfe_wm_enable(struct vfe_device *vfe, u8 wm, u8 enable)
{
if (enable)
writel_relaxed(2 << VFE_0_BUS_IMAGE_MASTER_n_SHIFT(wm),
vfe->base + VFE_0_BUS_IMAGE_MASTER_CMD);
else
writel_relaxed(1 << VFE_0_BUS_IMAGE_MASTER_n_SHIFT(wm),
vfe->base + VFE_0_BUS_IMAGE_MASTER_CMD);
/* The WM must be enabled before sending other commands */
wmb();
}
static void vfe_set_qos(struct vfe_device *vfe)
{
u32 val = VFE_0_BUS_BDG_QOS_CFG_0_CFG;
u32 val3 = VFE_0_BUS_BDG_QOS_CFG_3_CFG;
u32 val4 = VFE_0_BUS_BDG_QOS_CFG_4_CFG;
u32 val7 = VFE_0_BUS_BDG_QOS_CFG_7_CFG;
writel_relaxed(val, vfe->base + VFE_0_BUS_BDG_QOS_CFG_0);
writel_relaxed(val, vfe->base + VFE_0_BUS_BDG_QOS_CFG_1);
writel_relaxed(val, vfe->base + VFE_0_BUS_BDG_QOS_CFG_2);
writel_relaxed(val3, vfe->base + VFE_0_BUS_BDG_QOS_CFG_3);
writel_relaxed(val4, vfe->base + VFE_0_BUS_BDG_QOS_CFG_4);
writel_relaxed(val4, vfe->base + VFE_0_BUS_BDG_QOS_CFG_5);
writel_relaxed(val4, vfe->base + VFE_0_BUS_BDG_QOS_CFG_6);
writel_relaxed(val7, vfe->base + VFE_0_BUS_BDG_QOS_CFG_7);
}
static void vfe_set_ds(struct vfe_device *vfe)
{
u32 val = VFE_0_BUS_BDG_DS_CFG_0_CFG;
u32 val16 = VFE_0_BUS_BDG_DS_CFG_16_CFG;
writel_relaxed(val, vfe->base + VFE_0_BUS_BDG_DS_CFG_0);
writel_relaxed(val, vfe->base + VFE_0_BUS_BDG_DS_CFG_1);
writel_relaxed(val, vfe->base + VFE_0_BUS_BDG_DS_CFG_2);
writel_relaxed(val, vfe->base + VFE_0_BUS_BDG_DS_CFG_3);
writel_relaxed(val, vfe->base + VFE_0_BUS_BDG_DS_CFG_4);
writel_relaxed(val, vfe->base + VFE_0_BUS_BDG_DS_CFG_5);
writel_relaxed(val, vfe->base + VFE_0_BUS_BDG_DS_CFG_6);
writel_relaxed(val, vfe->base + VFE_0_BUS_BDG_DS_CFG_7);
writel_relaxed(val, vfe->base + VFE_0_BUS_BDG_DS_CFG_8);
writel_relaxed(val, vfe->base + VFE_0_BUS_BDG_DS_CFG_9);
writel_relaxed(val, vfe->base + VFE_0_BUS_BDG_DS_CFG_10);
writel_relaxed(val, vfe->base + VFE_0_BUS_BDG_DS_CFG_11);
writel_relaxed(val, vfe->base + VFE_0_BUS_BDG_DS_CFG_12);
writel_relaxed(val, vfe->base + VFE_0_BUS_BDG_DS_CFG_13);
writel_relaxed(val, vfe->base + VFE_0_BUS_BDG_DS_CFG_14);
writel_relaxed(val, vfe->base + VFE_0_BUS_BDG_DS_CFG_15);
writel_relaxed(val16, vfe->base + VFE_0_BUS_BDG_DS_CFG_16);
}
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);
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_set`, `function vfe_global_reset`, `function vfe_halt_request`, `function vfe_halt_clear`, `function vfe_wm_frame_based`, `function vfe_word_per_line_by_pixel`, `function vfe_word_per_line_by_bytes`, `function vfe_get_wm_sizes`, `function vfe_wm_line_based`.
- 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.