Merge tag 'trace-printf-v6.13' of git://git.kernel.org/pub/scm/linux/kernel/git/trace...
[drm/drm-misc.git] / drivers / clk / mediatek / clk-mt6779-ipe.c
blobc2314654f43ab2a270e27129bd9146ec3cc04d1f
1 // SPDX-License-Identifier: GPL-2.0
2 /*
3 * Copyright (c) 2019 MediaTek Inc.
4 * Author: Wendell Lin <wendell.lin@mediatek.com>
5 */
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>
12 #include "clk-mtk.h"
13 #include "clk-gate.h"
15 static const struct mtk_gate_regs ipe_cg_regs = {
16 .set_ofs = 0x0004,
17 .clr_ofs = 0x0008,
18 .sta_ofs = 0x0000,
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 = {
36 .clks = ipe_clks,
37 .num_clks = ARRAY_SIZE(ipe_clks),
40 static const struct of_device_id of_match_clk_mt6779_ipe[] = {
42 .compatible = "mediatek,mt6779-ipesys",
43 .data = &ipe_desc,
44 }, {
45 /* sentinel */
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,
53 .driver = {
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");