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

clk: mediatek: export cpu multiplexer clock for MT8173 SoCs

The patch enables CPU multiplexer clock on MT8173 SoC which fixes up
cpufreq driver fails at acquiring intermediate clock source when driver
probe is called.

Signed-off-by: Pi-Cheng Chen <pi-cheng.chen@linaro.org>
Signed-off-by: Sean Wang <sean.wang@mediatek.com>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>

authored by

Sean Wang and committed by
Stephen Boyd
567bf2ed 43ed50ee

+26 -1
+23
drivers/clk/mediatek/clk-mt8173.c
··· 18 18 19 19 #include "clk-mtk.h" 20 20 #include "clk-gate.h" 21 + #include "clk-cpumux.h" 21 22 22 23 #include <dt-bindings/clock/mt8173-clk.h> 23 24 ··· 526 525 "apll2_div5" 527 526 }; 528 527 528 + static const char * const ca53_parents[] __initconst = { 529 + "clk26m", 530 + "armca7pll", 531 + "mainpll", 532 + "univpll" 533 + }; 534 + 535 + static const char * const ca57_parents[] __initconst = { 536 + "clk26m", 537 + "armca15pll", 538 + "mainpll", 539 + "univpll" 540 + }; 541 + 542 + static const struct mtk_composite cpu_muxes[] __initconst = { 543 + MUX(CLK_INFRA_CA53SEL, "infra_ca53_sel", ca53_parents, 0x0000, 0, 2), 544 + MUX(CLK_INFRA_CA57SEL, "infra_ca57_sel", ca57_parents, 0x0000, 2, 2), 545 + }; 546 + 529 547 static const struct mtk_composite top_muxes[] __initconst = { 530 548 /* CLK_CFG_0 */ 531 549 MUX(CLK_TOP_AXI_SEL, "axi_sel", axi_parents, 0x0040, 0, 3), ··· 967 947 mtk_clk_register_gates(node, infra_clks, ARRAY_SIZE(infra_clks), 968 948 clk_data); 969 949 mtk_clk_register_factors(infra_divs, ARRAY_SIZE(infra_divs), clk_data); 950 + 951 + mtk_clk_register_cpumuxes(node, cpu_muxes, ARRAY_SIZE(cpu_muxes), 952 + clk_data); 970 953 971 954 r = of_clk_add_provider(node, of_clk_src_onecell_get, clk_data); 972 955 if (r)
+3 -1
include/dt-bindings/clock/mt8173-clk.h
··· 193 193 #define CLK_INFRA_PMICSPI 10 194 194 #define CLK_INFRA_PMICWRAP 11 195 195 #define CLK_INFRA_CLK_13M 12 196 - #define CLK_INFRA_NR_CLK 13 196 + #define CLK_INFRA_CA53SEL 13 197 + #define CLK_INFRA_CA57SEL 14 198 + #define CLK_INFRA_NR_CLK 15 197 199 198 200 /* PERI_SYS */ 199 201