1 // SPDX-License-Identifier: GPL-2.0
3 * Copyright (C) 2022 MediaTek Inc.
6 #include <dt-bindings/clock/mediatek,mt8365-clk.h>
7 #include <linux/clk-provider.h>
8 #include <linux/platform_device.h>
13 static const struct mtk_gate_regs mfg0_cg_regs = {
19 static const struct mtk_gate_regs mfg1_cg_regs = {
25 #define GATE_MFG0(_id, _name, _parent, _shift) \
26 GATE_MTK(_id, _name, _parent, &mfg0_cg_regs, _shift, \
27 &mtk_clk_gate_ops_setclr)
29 #define GATE_MFG1(_id, _name, _parent, _shift) \
30 GATE_MTK(_id, _name, _parent, &mfg1_cg_regs, _shift, \
31 &mtk_clk_gate_ops_no_setclr)
33 static const struct mtk_gate mfg_clks[] = {
35 GATE_MFG0(CLK_MFG_BG3D, "mfg_bg3d", "mfg_sel", 0),
37 GATE_MFG1(CLK_MFG_MBIST_DIAG, "mfg_mbist_diag", "mbist_diag_sel", 24),
40 static const struct mtk_clk_desc mfg_desc = {
42 .num_clks = ARRAY_SIZE(mfg_clks),
45 static const struct of_device_id of_match_clk_mt8365_mfg[] = {
47 .compatible = "mediatek,mt8365-mfgcfg",
54 static struct platform_driver clk_mt8365_mfg_drv = {
55 .probe = mtk_clk_simple_probe,
56 .remove = mtk_clk_simple_remove,
58 .name = "clk-mt8365-mfg",
59 .of_match_table = of_match_clk_mt8365_mfg,
62 builtin_platform_driver(clk_mt8365_mfg_drv);
63 MODULE_LICENSE("GPL");