1 // SPDX-License-Identifier: GPL-2.0
3 * Copyright (c) 2020 MediaTek Inc.
4 * Copyright (c) 2020 BayLibre, SAS
5 * Author: James Liao <jamesjj.liao@mediatek.com>
6 * Fabien Parent <fparent@baylibre.com>
9 #include <linux/clk-provider.h>
10 #include <linux/mod_devicetable.h>
11 #include <linux/platform_device.h>
16 #include <dt-bindings/clock/mt8167-clk.h>
18 static const struct mtk_gate_regs vdec0_cg_regs
= {
24 static const struct mtk_gate_regs vdec1_cg_regs
= {
30 #define GATE_VDEC0_I(_id, _name, _parent, _shift) \
31 GATE_MTK(_id, _name, _parent, &vdec0_cg_regs, _shift, &mtk_clk_gate_ops_setclr_inv)
33 #define GATE_VDEC1_I(_id, _name, _parent, _shift) \
34 GATE_MTK(_id, _name, _parent, &vdec1_cg_regs, _shift, &mtk_clk_gate_ops_setclr_inv)
36 static const struct mtk_gate vdec_clks
[] = {
38 GATE_VDEC0_I(CLK_VDEC_CKEN
, "vdec_cken", "rg_vdec", 0),
40 GATE_VDEC1_I(CLK_VDEC_LARB1_CKEN
, "vdec_larb1_cken", "smi_mm", 0),
43 static const struct mtk_clk_desc vdec_desc
= {
45 .num_clks
= ARRAY_SIZE(vdec_clks
),
48 static const struct of_device_id of_match_clk_mt8167_vdec
[] = {
49 { .compatible
= "mediatek,mt8167-vdecsys", .data
= &vdec_desc
},
52 MODULE_DEVICE_TABLE(of
, of_match_clk_mt8167_vdec
);
54 static struct platform_driver clk_mt8167_vdec_drv
= {
55 .probe
= mtk_clk_simple_probe
,
56 .remove
= mtk_clk_simple_remove
,
58 .name
= "clk-mt8167-vdecsys",
59 .of_match_table
= of_match_clk_mt8167_vdec
,
62 module_platform_driver(clk_mt8167_vdec_drv
);
64 MODULE_DESCRIPTION("MediaTek MT8167 Video Decoders clocks driver");
65 MODULE_LICENSE("GPL");