blob: a47937f4efe5a91289a3d2427ed5cacbcf176dbf [file] [log] [blame]
Owen Chen1aca9932020-02-21 17:52:22 +08001// SPDX-License-Identifier: GPL-2.0
2/*
3 * Copyright (c) 2018 MediaTek Inc.
4 * Author: Owen Chen <owen.chen@mediatek.com>
5 */
6
7#include <linux/clk-provider.h>
8#include <linux/platform_device.h>
9
10#include "clk-mtk.h"
11#include "clk-gate.h"
12
13#include <dt-bindings/clock/mt6765-clk.h>
14
15static const struct mtk_gate_regs mipi0a_cg_regs = {
16 .set_ofs = 0x80,
17 .clr_ofs = 0x80,
18 .sta_ofs = 0x80,
19};
20
AngeloGioacchino Del Regno4c85e202023-03-06 15:05:11 +010021#define GATE_MIPI0A(_id, _name, _parent, _shift) \
22 GATE_MTK(_id, _name, _parent, &mipi0a_cg_regs, _shift, &mtk_clk_gate_ops_no_setclr_inv)
Owen Chen1aca9932020-02-21 17:52:22 +080023
24static const struct mtk_gate mipi0a_clks[] = {
25 GATE_MIPI0A(CLK_MIPI0A_CSR_CSI_EN_0A,
26 "mipi0a_csr_0a", "f_fseninf_ck", 1),
27};
28
Miles Chen2b74c1f2022-09-22 17:18:31 +080029static const struct mtk_clk_desc mipi0a_desc = {
30 .clks = mipi0a_clks,
31 .num_clks = ARRAY_SIZE(mipi0a_clks),
32};
Owen Chen1aca9932020-02-21 17:52:22 +080033
34static const struct of_device_id of_match_clk_mt6765_mipi0a[] = {
Miles Chen2b74c1f2022-09-22 17:18:31 +080035 {
36 .compatible = "mediatek,mt6765-mipi0a",
37 .data = &mipi0a_desc,
38 }, {
39 /* sentinel */
40 }
Owen Chen1aca9932020-02-21 17:52:22 +080041};
AngeloGioacchino Del Regno65c9ad72023-03-06 15:05:38 +010042MODULE_DEVICE_TABLE(of, of_match_clk_mt6765_mipi0a);
Owen Chen1aca9932020-02-21 17:52:22 +080043
44static struct platform_driver clk_mt6765_mipi0a_drv = {
Miles Chen2b74c1f2022-09-22 17:18:31 +080045 .probe = mtk_clk_simple_probe,
46 .remove = mtk_clk_simple_remove,
Owen Chen1aca9932020-02-21 17:52:22 +080047 .driver = {
48 .name = "clk-mt6765-mipi0a",
49 .of_match_table = of_match_clk_mt6765_mipi0a,
50 },
51};
AngeloGioacchino Del Regno164d2402023-03-06 15:05:25 +010052module_platform_driver(clk_mt6765_mipi0a_drv);
AngeloGioacchino Del Regnoa451da82023-03-06 15:05:26 +010053MODULE_LICENSE("GPL");