drivers/clk/mediatek/clk-mt8196-vdec.c
Source file repositories/reference/linux-study-clean/drivers/clk/mediatek/clk-mt8196-vdec.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/clk/mediatek/clk-mt8196-vdec.c- Extension
.c- Size
- 6828 bytes
- Lines
- 254
- Domain
- Driver Families
- Bucket
- drivers/clk
- 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
dt-bindings/clock/mediatek,mt8196-clock.hlinux/clk-provider.hlinux/module.hlinux/of_device.hlinux/platform_device.hclk-gate.hclk-mtk.h
Detected Declarations
- No top-level syscall, struct, function, initcall, or export declaration detected by the generator.
Annotated Snippet
// SPDX-License-Identifier: GPL-2.0-only
/*
* Copyright (c) 2025 MediaTek Inc.
* Guangjie Song <guangjie.song@mediatek.com>
* Copyright (c) 2025 Collabora Ltd.
* Laura Nao <laura.nao@collabora.com>
*/
#include <dt-bindings/clock/mediatek,mt8196-clock.h>
#include <linux/clk-provider.h>
#include <linux/module.h>
#include <linux/of_device.h>
#include <linux/platform_device.h>
#include "clk-gate.h"
#include "clk-mtk.h"
static const struct mtk_gate_regs vde20_cg_regs = {
.set_ofs = 0x0,
.clr_ofs = 0x4,
.sta_ofs = 0x0,
};
static const struct mtk_gate_regs vde20_hwv_regs = {
.set_ofs = 0x0088,
.clr_ofs = 0x008c,
.sta_ofs = 0x2c44,
};
static const struct mtk_gate_regs vde21_cg_regs = {
.set_ofs = 0x200,
.clr_ofs = 0x204,
.sta_ofs = 0x200,
};
static const struct mtk_gate_regs vde21_hwv_regs = {
.set_ofs = 0x0080,
.clr_ofs = 0x0084,
.sta_ofs = 0x2c40,
};
static const struct mtk_gate_regs vde22_cg_regs = {
.set_ofs = 0x8,
.clr_ofs = 0xc,
.sta_ofs = 0x8,
};
static const struct mtk_gate_regs vde22_hwv_regs = {
.set_ofs = 0x0078,
.clr_ofs = 0x007c,
.sta_ofs = 0x2c3c,
};
#define GATE_HWV_VDE20(_id, _name, _parent, _shift) { \
.id = _id, \
.name = _name, \
.parent_name = _parent, \
.regs = &vde20_cg_regs, \
.hwv_regs = &vde20_hwv_regs, \
.shift = _shift, \
.ops = &mtk_clk_gate_hwv_ops_setclr_inv,\
.flags = CLK_OPS_PARENT_ENABLE, \
}
#define GATE_HWV_VDE21(_id, _name, _parent, _shift) { \
.id = _id, \
.name = _name, \
.parent_name = _parent, \
.regs = &vde21_cg_regs, \
.hwv_regs = &vde21_hwv_regs, \
.shift = _shift, \
.ops = &mtk_clk_gate_hwv_ops_setclr_inv,\
.flags = CLK_OPS_PARENT_ENABLE, \
}
#define GATE_HWV_VDE22(_id, _name, _parent, _shift) { \
.id = _id, \
.name = _name, \
.parent_name = _parent, \
.regs = &vde22_cg_regs, \
.hwv_regs = &vde22_hwv_regs, \
.shift = _shift, \
.ops = &mtk_clk_gate_hwv_ops_setclr_inv,\
.flags = CLK_OPS_PARENT_ENABLE | \
CLK_IGNORE_UNUSED, \
}
static const struct mtk_gate vde2_clks[] = {
/* VDE20 */
GATE_HWV_VDE20(CLK_VDE2_VDEC_CKEN, "vde2_vdec_cken", "vdec", 0),
Annotation
- Immediate include surface: `dt-bindings/clock/mediatek,mt8196-clock.h`, `linux/clk-provider.h`, `linux/module.h`, `linux/of_device.h`, `linux/platform_device.h`, `clk-gate.h`, `clk-mtk.h`.
- Atlas domain: Driver Families / drivers/clk.
- 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.