drivers/media/platform/qcom/camss/camss-vfe-gen3.c
Source file repositories/reference/linux-study-clean/drivers/media/platform/qcom/camss/camss-vfe-gen3.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/media/platform/qcom/camss/camss-vfe-gen3.c- Extension
.c- Size
- 5960 bytes
- Lines
- 194
- 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.h
Detected Declarations
function Copyrightfunction vfe_wm_stopfunction vfe_wm_updatefunction vfe_reg_updatefunction vfe_reg_update_clearfunction vfe_subdev_initfunction vfe_global_resetfunction vfe_isrfunction vfe_halt
Annotated Snippet
// SPDX-License-Identifier: GPL-2.0
/*
* Qualcomm MSM Camera Subsystem - VFE (Video Front End) Module gen3
*
* Copyright (c) 2024 Qualcomm Technologies, Inc.
*/
#include <linux/interrupt.h>
#include <linux/io.h>
#include <linux/iopoll.h>
#include "camss.h"
#include "camss-vfe.h"
#define IS_VFE_690(vfe) \
((vfe->camss->res->version == CAMSS_8775P) \
|| (vfe->camss->res->version == CAMSS_8300))
#define BUS_REG_BASE_690 \
(vfe_is_lite(vfe) ? 0x480 : 0x400)
#define BUS_REG_BASE_780 \
(vfe_is_lite(vfe) ? 0x200 : 0xC00)
#define BUS_REG_BASE \
(IS_VFE_690(vfe) ? BUS_REG_BASE_690 : BUS_REG_BASE_780)
#define VFE_TOP_CORE_CFG (0x24)
#define VFE_DISABLE_DSCALING_DS4 BIT(21)
#define VFE_DISABLE_DSCALING_DS16 BIT(22)
#define VFE_BUS_WM_TEST_BUS_CTRL_690 (BUS_REG_BASE + 0xFC)
#define VFE_BUS_WM_TEST_BUS_CTRL_780 (BUS_REG_BASE + 0xDC)
#define VFE_BUS_WM_TEST_BUS_CTRL \
(IS_VFE_690(vfe) ? VFE_BUS_WM_TEST_BUS_CTRL_690 \
: VFE_BUS_WM_TEST_BUS_CTRL_780)
/*
* Bus client mapping:
*
* Full VFE:
* VFE_690: 16 = RDI0, 17 = RDI1, 18 = RDI2
* VFE_780: 23 = RDI0, 24 = RDI1, 25 = RDI2
*
* VFE LITE:
* VFE_690 : 0 = RDI0, 1 = RDI1, 2 = RDI2, 3 = RDI3, 4 = RDI4, 5 = RDI5
* VFE_780 : 0 = RDI0, 1 = RDI1, 2 = RDI2, 3 = RDI3, 4 = RDI4
*/
#define RDI_WM_690(n) ((vfe_is_lite(vfe) ? 0x0 : 0x10) + (n))
#define RDI_WM_780(n) ((vfe_is_lite(vfe) ? 0x0 : 0x17) + (n))
#define RDI_WM(n) (IS_VFE_690(vfe) ? RDI_WM_690(n) : RDI_WM_780(n))
#define VFE_BUS_WM_CGC_OVERRIDE (BUS_REG_BASE + 0x08)
#define WM_CGC_OVERRIDE_ALL (0x7FFFFFF)
#define VFE_BUS_WM_CFG(n) (BUS_REG_BASE + 0x200 + (n) * 0x100)
#define WM_CFG_EN BIT(0)
#define WM_VIR_FRM_EN BIT(1)
#define WM_CFG_MODE BIT(16)
#define VFE_BUS_WM_IMAGE_ADDR(n) (BUS_REG_BASE + 0x204 + (n) * 0x100)
#define VFE_BUS_WM_FRAME_INCR(n) (BUS_REG_BASE + 0x208 + (n) * 0x100)
#define VFE_BUS_WM_IMAGE_CFG_0(n) (BUS_REG_BASE + 0x20c + (n) * 0x100)
#define WM_IMAGE_CFG_0_DEFAULT_WIDTH (0xFFFF)
#define VFE_BUS_WM_IMAGE_CFG_2(n) (BUS_REG_BASE + 0x214 + (n) * 0x100)
#define WM_IMAGE_CFG_2_DEFAULT_STRIDE (0xFFFF)
#define VFE_BUS_WM_PACKER_CFG(n) (BUS_REG_BASE + 0x218 + (n) * 0x100)
#define VFE_BUS_WM_IRQ_SUBSAMPLE_PERIOD(n) (BUS_REG_BASE + 0x230 + (n) * 0x100)
#define VFE_BUS_WM_IRQ_SUBSAMPLE_PATTERN(n) (BUS_REG_BASE + 0x234 + (n) * 0x100)
#define VFE_BUS_WM_FRAMEDROP_PERIOD(n) (BUS_REG_BASE + 0x238 + (n) * 0x100)
#define VFE_BUS_WM_FRAMEDROP_PATTERN(n) (BUS_REG_BASE + 0x23c + (n) * 0x100)
#define VFE_BUS_WM_MMU_PREFETCH_CFG(n) (BUS_REG_BASE + 0x260 + (n) * 0x100)
#define VFE_BUS_WM_MMU_PREFETCH_MAX_OFFSET(n) (BUS_REG_BASE + 0x264 + (n) * 0x100)
static void vfe_wm_start(struct vfe_device *vfe, u8 wm, struct vfe_line *line)
{
struct v4l2_pix_format_mplane *pix =
&line->video_out.active_fmt.fmt.pix_mp;
wm = RDI_WM(wm);
/* no clock gating at bus input */
writel(WM_CGC_OVERRIDE_ALL, vfe->base + VFE_BUS_WM_CGC_OVERRIDE);
writel(0x0, vfe->base + VFE_BUS_WM_TEST_BUS_CTRL);
if (IS_VFE_690(vfe))
writel(ALIGN(pix->plane_fmt[0].bytesperline, 16) * pix->height,
vfe->base + VFE_BUS_WM_FRAME_INCR(wm));
else
writel(ALIGN(pix->plane_fmt[0].bytesperline, 16) * pix->height >> 8,
vfe->base + VFE_BUS_WM_FRAME_INCR(wm));
Annotation
- Immediate include surface: `linux/interrupt.h`, `linux/io.h`, `linux/iopoll.h`, `camss.h`, `camss-vfe.h`.
- Detected declarations: `function Copyright`, `function vfe_wm_stop`, `function vfe_wm_update`, `function vfe_reg_update`, `function vfe_reg_update_clear`, `function vfe_subdev_init`, `function vfe_global_reset`, `function vfe_isr`, `function vfe_halt`.
- 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.