Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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 <chun-jie.chen@mediatek.com>
Reviewed-by: Chen-Yu Tsai <wenst@chromium.org>
Link: https://lore.kernel.org/r/20210914021633.26377-16-chun-jie.chen@mediatek.com
Signed-off-by: Stephen Boyd <sboyd@kernel.org>

authored by

Chun-Jie Chen and committed by
Stephen Boyd
24da2c24 35016f10

+48 -1
+1 -1
drivers/clk/mediatek/Makefile
··· 83 83 obj-$(CONFIG_COMMON_CLK_MT8195) += clk-mt8195-apmixedsys.o clk-mt8195-topckgen.o \ 84 84 clk-mt8195-peri_ao.o clk-mt8195-infra_ao.o \ 85 85 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 87 87 obj-$(CONFIG_COMMON_CLK_MT8516) += clk-mt8516.o 88 88 obj-$(CONFIG_COMMON_CLK_MT8516_AUDSYS) += clk-mt8516-aud.o
+47
drivers/clk/mediatek/clk-mt8195-scp_adsp.c
··· 1 + // SPDX-License-Identifier: GPL-2.0-only 2 + // 3 + // Copyright (c) 2021 MediaTek Inc. 4 + // Author: Chun-Jie Chen <chun-jie.chen@mediatek.com> 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);