1 // SPDX-License-Identifier: GPL-2.0-only
3 * Copyright (c) 2022 MediaTek Inc.
4 * Author: Garmin Chang <garmin.chang@mediatek.com>
7 #include <dt-bindings/clock/mediatek,mt8188-clk.h>
8 #include <linux/clk-provider.h>
9 #include <linux/platform_device.h>
14 static const struct mtk_gate_regs mfgcfg_cg_regs
= {
20 #define GATE_MFG(_id, _name, _parent, _shift) \
21 GATE_MTK_FLAGS(_id, _name, _parent, &mfgcfg_cg_regs, _shift, \
22 &mtk_clk_gate_ops_setclr, CLK_SET_RATE_PARENT)
24 static const struct mtk_gate mfgcfg_clks
[] = {
25 GATE_MFG(CLK_MFGCFG_BG3D
, "mfgcfg_bg3d", "mfg_ck_fast_ref", 0),
28 static const struct mtk_clk_desc mfgcfg_desc
= {
30 .num_clks
= ARRAY_SIZE(mfgcfg_clks
),
33 static const struct of_device_id of_match_clk_mt8188_mfgcfg
[] = {
34 { .compatible
= "mediatek,mt8188-mfgcfg", .data
= &mfgcfg_desc
},
37 MODULE_DEVICE_TABLE(of
, of_match_clk_mt8188_mfgcfg
);
39 static struct platform_driver clk_mt8188_mfgcfg_drv
= {
40 .probe
= mtk_clk_simple_probe
,
41 .remove
= mtk_clk_simple_remove
,
43 .name
= "clk-mt8188-mfgcfg",
44 .of_match_table
= of_match_clk_mt8188_mfgcfg
,
48 module_platform_driver(clk_mt8188_mfgcfg_drv
);
50 MODULE_DESCRIPTION("MediaTek MT8186 GPU mfg clocks driver");
51 MODULE_LICENSE("GPL");