1 // SPDX-License-Identifier: GPL-2.0-only
3 * Copyright (c) 2022 MediaTek Inc.
4 * Author: Garmin Chang <garmin.chang@mediatek.com>
7 #include <linux/clk-provider.h>
8 #include <linux/mod_devicetable.h>
9 #include <linux/platform_device.h>
11 #include <dt-bindings/clock/mediatek,mt8188-clk.h>
16 static const struct mtk_gate_regs venc1_cg_regs = {
22 #define GATE_VENC1(_id, _name, _parent, _shift) \
23 GATE_MTK(_id, _name, _parent, &venc1_cg_regs, _shift, &mtk_clk_gate_ops_setclr_inv)
25 static const struct mtk_gate venc1_clks[] = {
26 GATE_VENC1(CLK_VENC1_LARB, "venc1_larb", "top_venc", 0),
27 GATE_VENC1(CLK_VENC1_VENC, "venc1_venc", "top_venc", 4),
28 GATE_VENC1(CLK_VENC1_JPGENC, "venc1_jpgenc", "top_venc", 8),
29 GATE_VENC1(CLK_VENC1_JPGDEC, "venc1_jpgdec", "top_venc", 12),
30 GATE_VENC1(CLK_VENC1_JPGDEC_C1, "venc1_jpgdec_c1", "top_venc", 16),
31 GATE_VENC1(CLK_VENC1_GALS, "venc1_gals", "top_venc", 28),
32 GATE_VENC1(CLK_VENC1_GALS_SRAM, "venc1_gals_sram", "top_venc", 31),
35 static const struct mtk_clk_desc venc1_desc = {
37 .num_clks = ARRAY_SIZE(venc1_clks),
40 static const struct of_device_id of_match_clk_mt8188_venc1[] = {
41 { .compatible = "mediatek,mt8188-vencsys", .data = &venc1_desc },
44 MODULE_DEVICE_TABLE(of, of_match_clk_mt8188_venc1);
46 static struct platform_driver clk_mt8188_venc1_drv = {
47 .probe = mtk_clk_simple_probe,
48 .remove_new = mtk_clk_simple_remove,
50 .name = "clk-mt8188-venc1",
51 .of_match_table = of_match_clk_mt8188_venc1,
55 module_platform_driver(clk_mt8188_venc1_drv);
56 MODULE_LICENSE("GPL");