Skip to content

Commit 24da2c2

Browse files
Chun-Jie Chenbebarino
authored andcommitted
clk: mediatek: Add MT8195 scp adsp clock support
Add MT8195 scp adsp clock controller which provides clock gate control for Audio DSP. Signed-off-by: Chun-Jie Chen <[email protected]> Reviewed-by: Chen-Yu Tsai <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Stephen Boyd <[email protected]>
1 parent 35016f1 commit 24da2c2

File tree

2 files changed

+48
-1
lines changed

2 files changed

+48
-1
lines changed

drivers/clk/mediatek/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,6 @@ obj-$(CONFIG_COMMON_CLK_MT8192_VENCSYS) += clk-mt8192-venc.o
8383
obj-$(CONFIG_COMMON_CLK_MT8195) += clk-mt8195-apmixedsys.o clk-mt8195-topckgen.o \
8484
clk-mt8195-peri_ao.o clk-mt8195-infra_ao.o \
8585
clk-mt8195-cam.o clk-mt8195-ccu.o clk-mt8195-img.o \
86-
clk-mt8195-ipe.o clk-mt8195-mfg.o
86+
clk-mt8195-ipe.o clk-mt8195-mfg.o clk-mt8195-scp_adsp.o
8787
obj-$(CONFIG_COMMON_CLK_MT8516) += clk-mt8516.o
8888
obj-$(CONFIG_COMMON_CLK_MT8516_AUDSYS) += clk-mt8516-aud.o
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
// SPDX-License-Identifier: GPL-2.0-only
2+
//
3+
// Copyright (c) 2021 MediaTek Inc.
4+
// Author: Chun-Jie Chen <[email protected]>
5+
6+
#include "clk-gate.h"
7+
#include "clk-mtk.h"
8+
9+
#include <dt-bindings/clock/mt8195-clk.h>
10+
#include <linux/clk-provider.h>
11+
#include <linux/platform_device.h>
12+
13+
static const struct mtk_gate_regs scp_adsp_cg_regs = {
14+
.set_ofs = 0x180,
15+
.clr_ofs = 0x180,
16+
.sta_ofs = 0x180,
17+
};
18+
19+
#define GATE_SCP_ADSP(_id, _name, _parent, _shift) \
20+
GATE_MTK(_id, _name, _parent, &scp_adsp_cg_regs, _shift, &mtk_clk_gate_ops_no_setclr)
21+
22+
static const struct mtk_gate scp_adsp_clks[] = {
23+
GATE_SCP_ADSP(CLK_SCP_ADSP_AUDIODSP, "scp_adsp_audiodsp", "top_adsp", 0),
24+
};
25+
26+
static const struct mtk_clk_desc scp_adsp_desc = {
27+
.clks = scp_adsp_clks,
28+
.num_clks = ARRAY_SIZE(scp_adsp_clks),
29+
};
30+
31+
static const struct of_device_id of_match_clk_mt8195_scp_adsp[] = {
32+
{
33+
.compatible = "mediatek,mt8195-scp_adsp",
34+
.data = &scp_adsp_desc,
35+
}, {
36+
/* sentinel */
37+
}
38+
};
39+
40+
static struct platform_driver clk_mt8195_scp_adsp_drv = {
41+
.probe = mtk_clk_simple_probe,
42+
.driver = {
43+
.name = "clk-mt8195-scp_adsp",
44+
.of_match_table = of_match_clk_mt8195_scp_adsp,
45+
},
46+
};
47+
builtin_platform_driver(clk_mt8195_scp_adsp_drv);

0 commit comments

Comments
 (0)