drivers/media/platform/qcom/iris/iris_vpu3x.c
Source file repositories/reference/linux-study-clean/drivers/media/platform/qcom/iris/iris_vpu3x.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/media/platform/qcom/iris/iris_vpu3x.c- Extension
.c- Size
- 8677 bytes
- Lines
- 284
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/iopoll.hlinux/reset.hiris_instance.hiris_vpu_common.hiris_vpu_register_defines.h
Detected Declarations
function Copyrightfunction iris_vpu3_power_off_hardwarefunction iris_vpu33_power_off_hardwarefunction iris_vpu33_power_off_controllerfunction iris_vpu35_power_on_hwfunction iris_vpu35_power_off_hw
Annotated Snippet
// SPDX-License-Identifier: GPL-2.0-only
/*
* Copyright (c) 2022-2024 Qualcomm Innovation Center, Inc. All rights reserved.
* Copyright (c) 2025 Linaro Ltd
*/
#include <linux/iopoll.h>
#include <linux/reset.h>
#include "iris_instance.h"
#include "iris_vpu_common.h"
#include "iris_vpu_register_defines.h"
#define AON_WRAPPER_MVP_NOC_CORE_SW_RESET (AON_BASE_OFFS + 0x18)
#define SW_RESET BIT(0)
#define AON_WRAPPER_MVP_NOC_CORE_CLK_CONTROL (AON_BASE_OFFS + 0x20)
#define NOC_HALT BIT(0)
#define AON_WRAPPER_SPARE (AON_BASE_OFFS + 0x28)
static bool iris_vpu3x_hw_power_collapsed(struct iris_core *core)
{
u32 value, pwr_status;
value = readl(core->reg_base + WRAPPER_CORE_POWER_STATUS);
pwr_status = value & BIT(1);
return pwr_status ? false : true;
}
static void iris_vpu3_power_off_hardware(struct iris_core *core)
{
u32 reg_val = 0, value, i;
int ret;
if (iris_vpu3x_hw_power_collapsed(core))
goto disable_power;
dev_err(core->dev, "video hw is power on\n");
value = readl(core->reg_base + WRAPPER_CORE_CLOCK_CONFIG);
if (value)
writel(CORE_CLK_RUN, core->reg_base + WRAPPER_CORE_CLOCK_CONFIG);
for (i = 0; i < core->iris_platform_data->num_vpp_pipe; i++) {
ret = readl_poll_timeout(core->reg_base + VCODEC_SS_IDLE_STATUSN + 4 * i,
reg_val, reg_val & 0x400000, 2000, 20000);
if (ret)
goto disable_power;
}
writel(VIDEO_NOC_RESET_REQ, core->reg_base + AON_WRAPPER_MVP_NOC_RESET_REQ);
ret = readl_poll_timeout(core->reg_base + AON_WRAPPER_MVP_NOC_RESET_ACK,
reg_val, reg_val & 0x3, 200, 2000);
if (ret)
goto disable_power;
writel(0x0, core->reg_base + AON_WRAPPER_MVP_NOC_RESET_REQ);
ret = readl_poll_timeout(core->reg_base + AON_WRAPPER_MVP_NOC_RESET_ACK,
reg_val, !(reg_val & 0x3), 200, 2000);
if (ret)
goto disable_power;
writel(CORE_BRIDGE_SW_RESET | CORE_BRIDGE_HW_RESET_DISABLE,
core->reg_base + CPU_CS_AHB_BRIDGE_SYNC_RESET);
writel(CORE_BRIDGE_HW_RESET_DISABLE, core->reg_base + CPU_CS_AHB_BRIDGE_SYNC_RESET);
writel(0x0, core->reg_base + CPU_CS_AHB_BRIDGE_SYNC_RESET);
disable_power:
iris_vpu_power_off_hw(core);
}
static void iris_vpu33_power_off_hardware(struct iris_core *core)
{
bool handshake_done = false, handshake_busy = false;
u32 reg_val = 0, value, i;
u32 count = 0;
int ret;
if (iris_vpu3x_hw_power_collapsed(core))
goto disable_power;
dev_err(core->dev, "video hw is power on\n");
value = readl(core->reg_base + WRAPPER_CORE_CLOCK_CONFIG);
if (value)
writel(CORE_CLK_RUN, core->reg_base + WRAPPER_CORE_CLOCK_CONFIG);
for (i = 0; i < core->iris_platform_data->num_vpp_pipe; i++) {
Annotation
- Immediate include surface: `linux/iopoll.h`, `linux/reset.h`, `iris_instance.h`, `iris_vpu_common.h`, `iris_vpu_register_defines.h`.
- Detected declarations: `function Copyright`, `function iris_vpu3_power_off_hardware`, `function iris_vpu33_power_off_hardware`, `function iris_vpu33_power_off_controller`, `function iris_vpu35_power_on_hw`, `function iris_vpu35_power_off_hw`.
- Atlas domain: Driver Families / drivers/media.
- Implementation status: source implementation candidate.
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.