1 // SPDX-License-Identifier: GPL-2.0
3 * Copyright (c) 2019 MediaTek Inc.
4 * Author: Wendell Lin <wendell.lin@mediatek.com>
7 #include <linux/module.h>
8 #include <linux/clk-provider.h>
9 #include <linux/platform_device.h>
10 #include <dt-bindings/clock/mt6779-clk.h>
15 static const struct mtk_gate_regs ipe_cg_regs
= {
21 #define GATE_IPE(_id, _name, _parent, _shift) \
22 GATE_MTK(_id, _name, _parent, &ipe_cg_regs, _shift, \
23 &mtk_clk_gate_ops_setclr)
25 static const struct mtk_gate ipe_clks
[] = {
26 GATE_IPE(CLK_IPE_LARB7
, "ipe_larb7", "ipe_sel", 0),
27 GATE_IPE(CLK_IPE_LARB8
, "ipe_larb8", "ipe_sel", 1),
28 GATE_IPE(CLK_IPE_SMI_SUBCOM
, "ipe_smi_subcom", "ipe_sel", 2),
29 GATE_IPE(CLK_IPE_FD
, "ipe_fd", "ipe_sel", 3),
30 GATE_IPE(CLK_IPE_FE
, "ipe_fe", "ipe_sel", 4),
31 GATE_IPE(CLK_IPE_RSC
, "ipe_rsc", "ipe_sel", 5),
32 GATE_IPE(CLK_IPE_DPE
, "ipe_dpe", "ipe_sel", 6),
35 static const struct mtk_clk_desc ipe_desc
= {
37 .num_clks
= ARRAY_SIZE(ipe_clks
),
40 static const struct of_device_id of_match_clk_mt6779_ipe
[] = {
42 .compatible
= "mediatek,mt6779-ipesys",
48 MODULE_DEVICE_TABLE(of
, of_match_clk_mt6779_ipe
);
50 static struct platform_driver clk_mt6779_ipe_drv
= {
51 .probe
= mtk_clk_simple_probe
,
52 .remove
= mtk_clk_simple_remove
,
54 .name
= "clk-mt6779-ipe",
55 .of_match_table
= of_match_clk_mt6779_ipe
,
59 module_platform_driver(clk_mt6779_ipe_drv
);
61 MODULE_DESCRIPTION("MediaTek MT6779 Image Processing Engine clocks driver");
62 MODULE_LICENSE("GPL");