drivers/media/platform/qcom/camss/camss-vfe-4-1.c
Source file repositories/reference/linux-study-clean/drivers/media/platform/qcom/camss/camss-vfe-4-1.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/media/platform/qcom/camss/camss-vfe-4-1.c- Extension
.c- Size
- 31298 bytes
- Lines
- 1021
- 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.hlinux/io.hlinux/iopoll.hcamss.hcamss-vfe.hcamss-vfe-gen1.hcamss-vfe-vbif.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_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_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_camif_cfgfunction vfe_set_camif_cmdfunction vfe_set_module_cfgfunction vfe_camif_wait_for_stopfunction vfe_isr_readfunction vfe_violation_readfunction vfe_isrfunction vfe_4_1_pm_domain_offfunction vfe_4_1_pm_domain_onfunction vfe_subdev_init
Annotated Snippet
if (i == 0) {
reg = VFE_0_BUS_XBAR_CFG_x_M_SINGLE_STREAM_SEL_LUMA <<
VFE_0_BUS_XBAR_CFG_x_M_SINGLE_STREAM_SEL_SHIFT;
} else if (i == 1) {
reg = VFE_0_BUS_XBAR_CFG_x_M_PAIR_STREAM_EN;
if (p == V4L2_PIX_FMT_NV12 || p == V4L2_PIX_FMT_NV16)
reg |= VFE_0_BUS_XBAR_CFG_x_M_PAIR_STREAM_SWAP_INTER_INTRA;
} else {
/* On current devices output->wm_num is always <= 2 */
break;
}
if (output->wm_idx[i] % 2 == 1)
reg <<= 16;
if (enable)
vfe_reg_set(vfe,
VFE_0_BUS_XBAR_CFG_x(output->wm_idx[i]),
reg);
else
vfe_reg_clr(vfe,
VFE_0_BUS_XBAR_CFG_x(output->wm_idx[i]),
reg);
}
}
static void vfe_set_realign_cfg(struct vfe_device *vfe, struct vfe_line *line,
u8 enable)
{
/* empty */
}
static void vfe_set_rdi_cid(struct vfe_device *vfe, enum vfe_line_id id, u8 cid)
{
vfe_reg_clr(vfe, VFE_0_RDI_CFG_x(id),
VFE_0_RDI_CFG_x_RDI_M0_SEL_MASK);
vfe_reg_set(vfe, VFE_0_RDI_CFG_x(id),
cid << VFE_0_RDI_CFG_x_RDI_M0_SEL_SHIFT);
}
static void vfe_reg_update(struct vfe_device *vfe, enum vfe_line_id line_id)
{
vfe->reg_update |= VFE_0_REG_UPDATE_line_n(line_id);
wmb();
writel_relaxed(vfe->reg_update, vfe->base + VFE_0_REG_UPDATE);
wmb();
}
static inline void vfe_reg_update_clear(struct vfe_device *vfe,
enum vfe_line_id line_id)
{
vfe->reg_update &= ~VFE_0_REG_UPDATE_line_n(line_id);
}
static void vfe_enable_irq_wm_line(struct vfe_device *vfe, u8 wm,
enum vfe_line_id line_id, u8 enable)
{
u32 irq_en0 = VFE_0_IRQ_MASK_0_IMAGE_MASTER_n_PING_PONG(wm) |
VFE_0_IRQ_MASK_0_line_n_REG_UPDATE(line_id);
u32 irq_en1 = VFE_0_IRQ_MASK_1_IMAGE_MASTER_n_BUS_OVERFLOW(wm) |
VFE_0_IRQ_MASK_1_RDIn_SOF(line_id);
if (enable) {
vfe_reg_set(vfe, VFE_0_IRQ_MASK_0, irq_en0);
vfe_reg_set(vfe, VFE_0_IRQ_MASK_1, irq_en1);
} else {
vfe_reg_clr(vfe, VFE_0_IRQ_MASK_0, irq_en0);
vfe_reg_clr(vfe, VFE_0_IRQ_MASK_1, irq_en1);
}
}
static void vfe_enable_irq_pix_line(struct vfe_device *vfe, u8 comp,
enum vfe_line_id line_id, u8 enable)
{
struct vfe_output *output = &vfe->line[line_id].output;
unsigned int i;
u32 irq_en0;
u32 irq_en1;
u32 comp_mask = 0;
irq_en0 = VFE_0_IRQ_MASK_0_CAMIF_SOF;
irq_en0 |= VFE_0_IRQ_MASK_0_CAMIF_EOF;
irq_en0 |= VFE_0_IRQ_MASK_0_IMAGE_COMPOSITE_DONE_n(comp);
irq_en0 |= VFE_0_IRQ_MASK_0_line_n_REG_UPDATE(line_id);
irq_en1 = VFE_0_IRQ_MASK_1_CAMIF_ERROR;
for (i = 0; i < output->wm_num; i++) {
irq_en1 |= VFE_0_IRQ_MASK_1_IMAGE_MASTER_n_BUS_OVERFLOW(
output->wm_idx[i]);
comp_mask |= (1 << output->wm_idx[i]) << comp * 8;
}
Annotation
- Immediate include surface: `linux/interrupt.h`, `linux/io.h`, `linux/iopoll.h`, `camss.h`, `camss-vfe.h`, `camss-vfe-gen1.h`, `camss-vfe-vbif.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_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.