forked from luck/tmp_suning_uos_patched
clk: mediatek: add pericfg clocks for MT8183
Add pericfg clocks for MT8183, it's used when support USB remote wakeup Cc: Weiyi Lu <weiyi.lu@mediatek.com> Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com> Link: https://lkml.kernel.org/r/1566980533-28282-2-git-send-email-chunfeng.yun@mediatek.com Acked-by: Rob Herring <robh@kernel.org> Signed-off-by: Stephen Boyd <sboyd@kernel.org>
This commit is contained in:
parent
5aa00ad3fd
commit
f9e55ac22c
|
@ -1002,6 +1002,20 @@ static const struct mtk_gate infra_clks[] = {
|
||||||
"msdc50_0_sel", 24),
|
"msdc50_0_sel", 24),
|
||||||
};
|
};
|
||||||
|
|
||||||
|
static const struct mtk_gate_regs peri_cg_regs = {
|
||||||
|
.set_ofs = 0x20c,
|
||||||
|
.clr_ofs = 0x20c,
|
||||||
|
.sta_ofs = 0x20c,
|
||||||
|
};
|
||||||
|
|
||||||
|
#define GATE_PERI(_id, _name, _parent, _shift) \
|
||||||
|
GATE_MTK(_id, _name, _parent, &peri_cg_regs, _shift, \
|
||||||
|
&mtk_clk_gate_ops_no_setclr_inv)
|
||||||
|
|
||||||
|
static const struct mtk_gate peri_clks[] = {
|
||||||
|
GATE_PERI(CLK_PERI_AXI, "peri_axi", "axi_sel", 31),
|
||||||
|
};
|
||||||
|
|
||||||
static const struct mtk_gate_regs apmixed_cg_regs = {
|
static const struct mtk_gate_regs apmixed_cg_regs = {
|
||||||
.set_ofs = 0x20,
|
.set_ofs = 0x20,
|
||||||
.clr_ofs = 0x20,
|
.clr_ofs = 0x20,
|
||||||
|
@ -1208,6 +1222,19 @@ static int clk_mt8183_infra_probe(struct platform_device *pdev)
|
||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int clk_mt8183_peri_probe(struct platform_device *pdev)
|
||||||
|
{
|
||||||
|
struct clk_onecell_data *clk_data;
|
||||||
|
struct device_node *node = pdev->dev.of_node;
|
||||||
|
|
||||||
|
clk_data = mtk_alloc_clk_data(CLK_PERI_NR_CLK);
|
||||||
|
|
||||||
|
mtk_clk_register_gates(node, peri_clks, ARRAY_SIZE(peri_clks),
|
||||||
|
clk_data);
|
||||||
|
|
||||||
|
return of_clk_add_provider(node, of_clk_src_onecell_get, clk_data);
|
||||||
|
}
|
||||||
|
|
||||||
static int clk_mt8183_mcu_probe(struct platform_device *pdev)
|
static int clk_mt8183_mcu_probe(struct platform_device *pdev)
|
||||||
{
|
{
|
||||||
struct clk_onecell_data *clk_data;
|
struct clk_onecell_data *clk_data;
|
||||||
|
@ -1237,6 +1264,9 @@ static const struct of_device_id of_match_clk_mt8183[] = {
|
||||||
}, {
|
}, {
|
||||||
.compatible = "mediatek,mt8183-infracfg",
|
.compatible = "mediatek,mt8183-infracfg",
|
||||||
.data = clk_mt8183_infra_probe,
|
.data = clk_mt8183_infra_probe,
|
||||||
|
}, {
|
||||||
|
.compatible = "mediatek,mt8183-pericfg",
|
||||||
|
.data = clk_mt8183_peri_probe,
|
||||||
}, {
|
}, {
|
||||||
.compatible = "mediatek,mt8183-mcucfg",
|
.compatible = "mediatek,mt8183-mcucfg",
|
||||||
.data = clk_mt8183_mcu_probe,
|
.data = clk_mt8183_mcu_probe,
|
||||||
|
|
|
@ -284,6 +284,10 @@
|
||||||
#define CLK_INFRA_FBIST2FPC 100
|
#define CLK_INFRA_FBIST2FPC 100
|
||||||
#define CLK_INFRA_NR_CLK 101
|
#define CLK_INFRA_NR_CLK 101
|
||||||
|
|
||||||
|
/* PERICFG */
|
||||||
|
#define CLK_PERI_AXI 0
|
||||||
|
#define CLK_PERI_NR_CLK 1
|
||||||
|
|
||||||
/* MFGCFG */
|
/* MFGCFG */
|
||||||
#define CLK_MFG_BG3D 0
|
#define CLK_MFG_BG3D 0
|
||||||
#define CLK_MFG_NR_CLK 1
|
#define CLK_MFG_NR_CLK 1
|
||||||
|
|
Loading…
Reference in New Issue
Block a user