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

Merge branches 'clk-simplify', 'clk-ti', 'clk-tegra', 'clk-rockchip' and 'clk-mediatek' into clk-next

- Small non-critical fixes for TI clk driver
- Support Mediatek MT8167 clks

* clk-simplify:
clk: mediatek: fix platform_no_drv_owner.cocci warnings
clk: mediatek: mt7629: simplify the return expression of mtk_infrasys_init
clk: mediatek: mt6797: simplify the return expression of mtk_infrasys_init

* clk-ti:
clk: ti: dra7: add missing clkctrl register for SHA2 instance
clk: ti: clockdomain: fix static checker warning
clk: ti: autoidle: add checks against NULL pointer reference
clk: keystone: sci-clk: add 10% slack to set_rate
clk: keystone: sci-clk: cache results of last query rate operation
clk: keystone: sci-clk: fix parsing assigned-clock data during probe

* clk-tegra:
clk: tegra: Drop !provider check in tegra210_clk_emc_set_rate()

* clk-rockchip:
clk: rockchip: Initialize hw to error to avoid undefined behavior
clk: rockchip: rk3399: Support module build
clk: rockchip: fix the clk config to support module build
clk: rockchip: Export some clock common APIs for module drivers
clk: rockchip: Export rockchip_register_softrst()
clk: rockchip: Export rockchip_clk_register_ddrclk()
clk: rockchip: Use clk_hw_register_composite instead of clk_register_composite calls
clk: rockchip: rk3308: drop unused mux_timer_src_p

* clk-mediatek:
clk: mediatek: Add MT8167 clock support
dt-bindings: clock: mediatek: add bindings for MT8167 clocks
clk: mediatek: add UART0 clock support

+1914 -103
+1
Documentation/devicetree/bindings/arm/mediatek/mediatek,apmixedsys.txt
··· 15 15 - "mediatek,mt7623-apmixedsys", "mediatek,mt2701-apmixedsys" 16 16 - "mediatek,mt7629-apmixedsys" 17 17 - "mediatek,mt8135-apmixedsys" 18 + - "mediatek,mt8167-apmixedsys", "syscon" 18 19 - "mediatek,mt8173-apmixedsys" 19 20 - "mediatek,mt8183-apmixedsys", "syscon" 20 21 - "mediatek,mt8516-apmixedsys"
+1
Documentation/devicetree/bindings/arm/mediatek/mediatek,audsys.txt
··· 11 11 - "mediatek,mt6779-audio", "syscon" 12 12 - "mediatek,mt7622-audsys", "syscon" 13 13 - "mediatek,mt7623-audsys", "mediatek,mt2701-audsys", "syscon" 14 + - "mediatek,mt8167-audiosys", "syscon" 14 15 - "mediatek,mt8183-audiosys", "syscon" 15 16 - "mediatek,mt8516-audsys", "syscon" 16 17 - #clock-cells: Must be 1
+1
Documentation/devicetree/bindings/arm/mediatek/mediatek,imgsys.txt
··· 12 12 - "mediatek,mt6779-imgsys", "syscon" 13 13 - "mediatek,mt6797-imgsys", "syscon" 14 14 - "mediatek,mt7623-imgsys", "mediatek,mt2701-imgsys", "syscon" 15 + - "mediatek,mt8167-imgsys", "syscon" 15 16 - "mediatek,mt8173-imgsys", "syscon" 16 17 - "mediatek,mt8183-imgsys", "syscon" 17 18 - #clock-cells: Must be 1
+1
Documentation/devicetree/bindings/arm/mediatek/mediatek,infracfg.txt
··· 16 16 - "mediatek,mt7623-infracfg", "mediatek,mt2701-infracfg", "syscon" 17 17 - "mediatek,mt7629-infracfg", "syscon" 18 18 - "mediatek,mt8135-infracfg", "syscon" 19 + - "mediatek,mt8167-infracfg", "syscon" 19 20 - "mediatek,mt8173-infracfg", "syscon" 20 21 - "mediatek,mt8183-infracfg", "syscon" 21 22 - "mediatek,mt8516-infracfg", "syscon"
+1
Documentation/devicetree/bindings/arm/mediatek/mediatek,mfgcfg.txt
··· 8 8 - compatible: Should be one of: 9 9 - "mediatek,mt2712-mfgcfg", "syscon" 10 10 - "mediatek,mt6779-mfgcfg", "syscon" 11 + - "mediatek,mt8167-mfgcfg", "syscon" 11 12 - "mediatek,mt8183-mfgcfg", "syscon" 12 13 - #clock-cells: Must be 1 13 14
+1
Documentation/devicetree/bindings/arm/mediatek/mediatek,topckgen.txt
··· 15 15 - "mediatek,mt7623-topckgen", "mediatek,mt2701-topckgen" 16 16 - "mediatek,mt7629-topckgen" 17 17 - "mediatek,mt8135-topckgen" 18 + - "mediatek,mt8167-topckgen", "syscon" 18 19 - "mediatek,mt8173-topckgen" 19 20 - "mediatek,mt8183-topckgen", "syscon" 20 21 - "mediatek,mt8516-topckgen"
+1
Documentation/devicetree/bindings/arm/mediatek/mediatek,vdecsys.txt
··· 11 11 - "mediatek,mt6779-vdecsys", "syscon" 12 12 - "mediatek,mt6797-vdecsys", "syscon" 13 13 - "mediatek,mt7623-vdecsys", "mediatek,mt2701-vdecsys", "syscon" 14 + - "mediatek,mt8167-vdecsys", "syscon" 14 15 - "mediatek,mt8173-vdecsys", "syscon" 15 16 - "mediatek,mt8183-vdecsys", "syscon" 16 17 - #clock-cells: Must be 1
+1
drivers/clk/Kconfig
··· 373 373 source "drivers/clk/mvebu/Kconfig" 374 374 source "drivers/clk/qcom/Kconfig" 375 375 source "drivers/clk/renesas/Kconfig" 376 + source "drivers/clk/rockchip/Kconfig" 376 377 source "drivers/clk/samsung/Kconfig" 377 378 source "drivers/clk/sifive/Kconfig" 378 379 source "drivers/clk/sprd/Kconfig"
+17 -2
drivers/clk/keystone/sci-clk.c
··· 54 54 * @provider: Master clock provider 55 55 * @flags: Flags for the clock 56 56 * @node: Link for handling clocks probed via DT 57 + * @cached_req: Cached requested freq for determine rate calls 58 + * @cached_res: Cached result freq for determine rate calls 57 59 */ 58 60 struct sci_clk { 59 61 struct clk_hw hw; ··· 65 63 struct sci_clk_provider *provider; 66 64 u8 flags; 67 65 struct list_head node; 66 + unsigned long cached_req; 67 + unsigned long cached_res; 68 68 }; 69 69 70 70 #define to_sci_clk(_hw) container_of(_hw, struct sci_clk, hw) ··· 179 175 int ret; 180 176 u64 new_rate; 181 177 178 + if (clk->cached_req && clk->cached_req == req->rate) { 179 + req->rate = clk->cached_res; 180 + return 0; 181 + } 182 + 182 183 ret = clk->provider->ops->get_best_match_freq(clk->provider->sci, 183 184 clk->dev_id, 184 185 clk->clk_id, ··· 197 188 clk->dev_id, clk->clk_id, ret); 198 189 return ret; 199 190 } 191 + 192 + clk->cached_req = req->rate; 193 + clk->cached_res = new_rate; 200 194 201 195 req->rate = new_rate; 202 196 ··· 221 209 struct sci_clk *clk = to_sci_clk(hw); 222 210 223 211 return clk->provider->ops->set_freq(clk->provider->sci, clk->dev_id, 224 - clk->clk_id, rate, rate, rate); 212 + clk->clk_id, rate / 10 * 9, rate, 213 + rate / 10 * 11); 225 214 } 226 215 227 216 /** ··· 261 248 static int sci_clk_set_parent(struct clk_hw *hw, u8 index) 262 249 { 263 250 struct sci_clk *clk = to_sci_clk(hw); 251 + 252 + clk->cached_req = 0; 264 253 265 254 return clk->provider->ops->set_parent(clk->provider->sci, clk->dev_id, 266 255 clk->clk_id, ··· 537 522 np = of_find_node_with_property(np, *clk_name); 538 523 if (!np) { 539 524 clk_name++; 540 - break; 525 + continue; 541 526 } 542 527 543 528 if (!of_device_is_available(np))
+48
drivers/clk/mediatek/Kconfig
··· 352 352 help 353 353 This driver supports MediaTek MT8135 clocks. 354 354 355 + config COMMON_CLK_MT8167 356 + bool "Clock driver for MediaTek MT8167" 357 + depends on (ARCH_MEDIATEK && ARM64) || COMPILE_TEST 358 + select COMMON_CLK_MEDIATEK 359 + default ARCH_MEDIATEK 360 + help 361 + This driver supports MediaTek MT8167 basic clocks. 362 + 363 + config COMMON_CLK_MT8167_AUDSYS 364 + bool "Clock driver for MediaTek MT8167 audsys" 365 + depends on (ARCH_MEDIATEK && ARM64) || COMPILE_TEST 366 + select COMMON_CLK_MEDIATEK 367 + default ARCH_MEDIATEK 368 + help 369 + This driver supports MediaTek MT8167 audsys clocks. 370 + 371 + config COMMON_CLK_MT8167_IMGSYS 372 + bool "Clock driver for MediaTek MT8167 imgsys" 373 + depends on (ARCH_MEDIATEK && ARM64) || COMPILE_TEST 374 + select COMMON_CLK_MEDIATEK 375 + default ARCH_MEDIATEK 376 + help 377 + This driver supports MediaTek MT8167 imgsys clocks. 378 + 379 + config COMMON_CLK_MT8167_MFGCFG 380 + bool "Clock driver for MediaTek MT8167 mfgcfg" 381 + depends on (ARCH_MEDIATEK && ARM64) || COMPILE_TEST 382 + select COMMON_CLK_MEDIATEK 383 + default ARCH_MEDIATEK 384 + help 385 + This driver supports MediaTek MT8167 mfgcfg clocks. 386 + 387 + config COMMON_CLK_MT8167_MMSYS 388 + bool "Clock driver for MediaTek MT8167 mmsys" 389 + depends on (ARCH_MEDIATEK && ARM64) || COMPILE_TEST 390 + select COMMON_CLK_MEDIATEK 391 + default ARCH_MEDIATEK 392 + help 393 + This driver supports MediaTek MT8167 mmsys clocks. 394 + 395 + config COMMON_CLK_MT8167_VDECSYS 396 + bool "Clock driver for MediaTek MT8167 vdecsys" 397 + depends on (ARCH_MEDIATEK && ARM64) || COMPILE_TEST 398 + select COMMON_CLK_MEDIATEK 399 + default ARCH_MEDIATEK 400 + help 401 + This driver supports MediaTek MT8167 vdecsys clocks. 402 + 355 403 config COMMON_CLK_MT8173 356 404 bool "Clock driver for MediaTek MT8173" 357 405 depends on ARCH_MEDIATEK || COMPILE_TEST
+6
drivers/clk/mediatek/Makefile
··· 47 47 obj-$(CONFIG_COMMON_CLK_MT7629_ETHSYS) += clk-mt7629-eth.o 48 48 obj-$(CONFIG_COMMON_CLK_MT7629_HIFSYS) += clk-mt7629-hif.o 49 49 obj-$(CONFIG_COMMON_CLK_MT8135) += clk-mt8135.o 50 + obj-$(CONFIG_COMMON_CLK_MT8167) += clk-mt8167.o 51 + obj-$(CONFIG_COMMON_CLK_MT8167_AUDSYS) += clk-mt8167-aud.o 52 + obj-$(CONFIG_COMMON_CLK_MT8167_IMGSYS) += clk-mt8167-img.o 53 + obj-$(CONFIG_COMMON_CLK_MT8167_MFGCFG) += clk-mt8167-mfgcfg.o 54 + obj-$(CONFIG_COMMON_CLK_MT8167_MMSYS) += clk-mt8167-mm.o 55 + obj-$(CONFIG_COMMON_CLK_MT8167_VDECSYS) += clk-mt8167-vdec.o 50 56 obj-$(CONFIG_COMMON_CLK_MT8173) += clk-mt8173.o 51 57 obj-$(CONFIG_COMMON_CLK_MT8173_MMSYS) += clk-mt8173-mm.o 52 58 obj-$(CONFIG_COMMON_CLK_MT8183) += clk-mt8183.o
-1
drivers/clk/mediatek/clk-mt6765.c
··· 909 909 .probe = clk_mt6765_probe, 910 910 .driver = { 911 911 .name = "clk-mt6765", 912 - .owner = THIS_MODULE, 913 912 .of_match_table = of_match_clk_mt6765, 914 913 }, 915 914 };
+2
drivers/clk/mediatek/clk-mt6779.c
··· 919 919 "pwm_sel", 19), 920 920 GATE_INFRA0(CLK_INFRA_PWM, "infra_pwm", 921 921 "pwm_sel", 21), 922 + GATE_INFRA0(CLK_INFRA_UART0, "infra_uart0", 923 + "uart_sel", 22), 922 924 GATE_INFRA0(CLK_INFRA_UART1, "infra_uart1", 923 925 "uart_sel", 23), 924 926 GATE_INFRA0(CLK_INFRA_UART2, "infra_uart2",
+2 -6
drivers/clk/mediatek/clk-mt6797.c
··· 582 582 583 583 static int mtk_infrasys_init(struct platform_device *pdev) 584 584 { 585 - int r, i; 585 + int i; 586 586 struct device_node *node = pdev->dev.of_node; 587 587 588 588 if (!infra_clk_data) { ··· 599 599 mtk_clk_register_factors(infra_fixed_divs, ARRAY_SIZE(infra_fixed_divs), 600 600 infra_clk_data); 601 601 602 - r = of_clk_add_provider(node, of_clk_src_onecell_get, infra_clk_data); 603 - if (r) 604 - return r; 605 - 606 - return 0; 602 + return of_clk_add_provider(node, of_clk_src_onecell_get, infra_clk_data); 607 603 } 608 604 609 605 #define MT6797_PLL_FMAX (3000UL * MHZ)
+2 -7
drivers/clk/mediatek/clk-mt7629.c
··· 601 601 { 602 602 struct device_node *node = pdev->dev.of_node; 603 603 struct clk_onecell_data *clk_data; 604 - int r; 605 604 606 605 clk_data = mtk_alloc_clk_data(CLK_INFRA_NR_CLK); 607 606 ··· 610 611 mtk_clk_register_cpumuxes(node, infra_muxes, ARRAY_SIZE(infra_muxes), 611 612 clk_data); 612 613 613 - r = of_clk_add_provider(node, of_clk_src_onecell_get, 614 - clk_data); 615 - if (r) 616 - return r; 617 - 618 - return 0; 614 + return of_clk_add_provider(node, of_clk_src_onecell_get, 615 + clk_data); 619 616 } 620 617 621 618 static int mtk_pericfg_init(struct platform_device *pdev)
+66
drivers/clk/mediatek/clk-mt8167-aud.c
··· 1 + // SPDX-License-Identifier: GPL-2.0 2 + /* 3 + * Copyright (c) 2020 MediaTek Inc. 4 + * Copyright (c) 2020 BayLibre, SAS 5 + * Author: James Liao <jamesjj.liao@mediatek.com> 6 + * Fabien Parent <fparent@baylibre.com> 7 + */ 8 + 9 + #include <linux/clk-provider.h> 10 + #include <linux/of.h> 11 + #include <linux/of_address.h> 12 + #include <linux/of_device.h> 13 + #include <linux/platform_device.h> 14 + 15 + #include "clk-mtk.h" 16 + #include "clk-gate.h" 17 + 18 + #include <dt-bindings/clock/mt8167-clk.h> 19 + 20 + static const struct mtk_gate_regs aud_cg_regs = { 21 + .set_ofs = 0x0, 22 + .clr_ofs = 0x0, 23 + .sta_ofs = 0x0, 24 + }; 25 + 26 + #define GATE_AUD(_id, _name, _parent, _shift) { \ 27 + .id = _id, \ 28 + .name = _name, \ 29 + .parent_name = _parent, \ 30 + .regs = &aud_cg_regs, \ 31 + .shift = _shift, \ 32 + .ops = &mtk_clk_gate_ops_no_setclr, \ 33 + } 34 + 35 + static const struct mtk_gate aud_clks[] __initconst = { 36 + GATE_AUD(CLK_AUD_AFE, "aud_afe", "clk26m_ck", 2), 37 + GATE_AUD(CLK_AUD_I2S, "aud_i2s", "i2s_infra_bck", 6), 38 + GATE_AUD(CLK_AUD_22M, "aud_22m", "rg_aud_engen1", 8), 39 + GATE_AUD(CLK_AUD_24M, "aud_24m", "rg_aud_engen2", 9), 40 + GATE_AUD(CLK_AUD_INTDIR, "aud_intdir", "rg_aud_spdif_in", 15), 41 + GATE_AUD(CLK_AUD_APLL2_TUNER, "aud_apll2_tuner", "rg_aud_engen2", 18), 42 + GATE_AUD(CLK_AUD_APLL_TUNER, "aud_apll_tuner", "rg_aud_engen1", 19), 43 + GATE_AUD(CLK_AUD_HDMI, "aud_hdmi", "apll12_div4", 20), 44 + GATE_AUD(CLK_AUD_SPDF, "aud_spdf", "apll12_div6", 21), 45 + GATE_AUD(CLK_AUD_ADC, "aud_adc", "aud_afe", 24), 46 + GATE_AUD(CLK_AUD_DAC, "aud_dac", "aud_afe", 25), 47 + GATE_AUD(CLK_AUD_DAC_PREDIS, "aud_dac_predis", "aud_afe", 26), 48 + GATE_AUD(CLK_AUD_TML, "aud_tml", "aud_afe", 27), 49 + }; 50 + 51 + static void __init mtk_audsys_init(struct device_node *node) 52 + { 53 + struct clk_onecell_data *clk_data; 54 + int r; 55 + 56 + clk_data = mtk_alloc_clk_data(CLK_AUD_NR_CLK); 57 + 58 + mtk_clk_register_gates(node, aud_clks, ARRAY_SIZE(aud_clks), clk_data); 59 + 60 + r = of_clk_add_provider(node, of_clk_src_onecell_get, clk_data); 61 + if (r) 62 + pr_err("%s(): could not register clock provider: %d\n", 63 + __func__, r); 64 + 65 + } 66 + CLK_OF_DECLARE(mtk_audsys, "mediatek,mt8167-audsys", mtk_audsys_init);
+60
drivers/clk/mediatek/clk-mt8167-img.c
··· 1 + // SPDX-License-Identifier: GPL-2.0 2 + /* 3 + * Copyright (c) 2020 MediaTek Inc. 4 + * Copyright (c) 2020 BayLibre, SAS 5 + * Author: James Liao <jamesjj.liao@mediatek.com> 6 + * Fabien Parent <fparent@baylibre.com> 7 + */ 8 + 9 + #include <linux/clk-provider.h> 10 + #include <linux/of.h> 11 + #include <linux/of_address.h> 12 + #include <linux/of_device.h> 13 + #include <linux/platform_device.h> 14 + 15 + #include "clk-mtk.h" 16 + #include "clk-gate.h" 17 + 18 + #include <dt-bindings/clock/mt8167-clk.h> 19 + 20 + static const struct mtk_gate_regs img_cg_regs = { 21 + .set_ofs = 0x4, 22 + .clr_ofs = 0x8, 23 + .sta_ofs = 0x0, 24 + }; 25 + 26 + #define GATE_IMG(_id, _name, _parent, _shift) { \ 27 + .id = _id, \ 28 + .name = _name, \ 29 + .parent_name = _parent, \ 30 + .regs = &img_cg_regs, \ 31 + .shift = _shift, \ 32 + .ops = &mtk_clk_gate_ops_setclr, \ 33 + } 34 + 35 + static const struct mtk_gate img_clks[] __initconst = { 36 + GATE_IMG(CLK_IMG_LARB1_SMI, "img_larb1_smi", "smi_mm", 0), 37 + GATE_IMG(CLK_IMG_CAM_SMI, "img_cam_smi", "smi_mm", 5), 38 + GATE_IMG(CLK_IMG_CAM_CAM, "img_cam_cam", "smi_mm", 6), 39 + GATE_IMG(CLK_IMG_SEN_TG, "img_sen_tg", "cam_mm", 7), 40 + GATE_IMG(CLK_IMG_SEN_CAM, "img_sen_cam", "smi_mm", 8), 41 + GATE_IMG(CLK_IMG_VENC, "img_venc", "smi_mm", 9), 42 + }; 43 + 44 + static void __init mtk_imgsys_init(struct device_node *node) 45 + { 46 + struct clk_onecell_data *clk_data; 47 + int r; 48 + 49 + clk_data = mtk_alloc_clk_data(CLK_IMG_NR_CLK); 50 + 51 + mtk_clk_register_gates(node, img_clks, ARRAY_SIZE(img_clks), clk_data); 52 + 53 + r = of_clk_add_provider(node, of_clk_src_onecell_get, clk_data); 54 + 55 + if (r) 56 + pr_err("%s(): could not register clock provider: %d\n", 57 + __func__, r); 58 + 59 + } 60 + CLK_OF_DECLARE(mtk_imgsys, "mediatek,mt8167-imgsys", mtk_imgsys_init);
+58
drivers/clk/mediatek/clk-mt8167-mfgcfg.c
··· 1 + // SPDX-License-Identifier: GPL-2.0 2 + /* 3 + * Copyright (c) 2020 MediaTek Inc. 4 + * Copyright (c) 2020 BayLibre, SAS 5 + * Author: James Liao <jamesjj.liao@mediatek.com> 6 + * Fabien Parent <fparent@baylibre.com> 7 + */ 8 + 9 + #include <linux/clk-provider.h> 10 + #include <linux/of.h> 11 + #include <linux/of_address.h> 12 + #include <linux/of_device.h> 13 + #include <linux/platform_device.h> 14 + 15 + #include "clk-mtk.h" 16 + #include "clk-gate.h" 17 + 18 + #include <dt-bindings/clock/mt8167-clk.h> 19 + 20 + static const struct mtk_gate_regs mfg_cg_regs = { 21 + .set_ofs = 0x4, 22 + .clr_ofs = 0x8, 23 + .sta_ofs = 0x0, 24 + }; 25 + 26 + #define GATE_MFG(_id, _name, _parent, _shift) { \ 27 + .id = _id, \ 28 + .name = _name, \ 29 + .parent_name = _parent, \ 30 + .regs = &mfg_cg_regs, \ 31 + .shift = _shift, \ 32 + .ops = &mtk_clk_gate_ops_setclr, \ 33 + } 34 + 35 + static const struct mtk_gate mfg_clks[] __initconst = { 36 + GATE_MFG(CLK_MFG_BAXI, "mfg_baxi", "ahb_infra_sel", 0), 37 + GATE_MFG(CLK_MFG_BMEM, "mfg_bmem", "gfmux_emi1x_sel", 1), 38 + GATE_MFG(CLK_MFG_BG3D, "mfg_bg3d", "mfg_mm", 2), 39 + GATE_MFG(CLK_MFG_B26M, "mfg_b26m", "clk26m_ck", 3), 40 + }; 41 + 42 + static void __init mtk_mfgcfg_init(struct device_node *node) 43 + { 44 + struct clk_onecell_data *clk_data; 45 + int r; 46 + 47 + clk_data = mtk_alloc_clk_data(CLK_MFG_NR_CLK); 48 + 49 + mtk_clk_register_gates(node, mfg_clks, ARRAY_SIZE(mfg_clks), clk_data); 50 + 51 + r = of_clk_add_provider(node, of_clk_src_onecell_get, clk_data); 52 + 53 + if (r) 54 + pr_err("%s(): could not register clock provider: %d\n", 55 + __func__, r); 56 + 57 + } 58 + CLK_OF_DECLARE(mtk_mfgcfg, "mediatek,mt8167-mfgcfg", mtk_mfgcfg_init);
+132
drivers/clk/mediatek/clk-mt8167-mm.c
··· 1 + // SPDX-License-Identifier: GPL-2.0 2 + /* 3 + * Copyright (c) 2020 MediaTek Inc. 4 + * Copyright (c) 2020 BayLibre, SAS 5 + * Author: James Liao <jamesjj.liao@mediatek.com> 6 + * Fabien Parent <fparent@baylibre.com> 7 + */ 8 + 9 + #include <linux/clk-provider.h> 10 + #include <linux/of.h> 11 + #include <linux/of_address.h> 12 + #include <linux/of_device.h> 13 + #include <linux/platform_device.h> 14 + 15 + #include "clk-mtk.h" 16 + #include "clk-gate.h" 17 + 18 + #include <dt-bindings/clock/mt8167-clk.h> 19 + 20 + static const struct mtk_gate_regs mm0_cg_regs = { 21 + .set_ofs = 0x104, 22 + .clr_ofs = 0x108, 23 + .sta_ofs = 0x100, 24 + }; 25 + 26 + static const struct mtk_gate_regs mm1_cg_regs = { 27 + .set_ofs = 0x114, 28 + .clr_ofs = 0x118, 29 + .sta_ofs = 0x110, 30 + }; 31 + 32 + #define GATE_MM0(_id, _name, _parent, _shift) { \ 33 + .id = _id, \ 34 + .name = _name, \ 35 + .parent_name = _parent, \ 36 + .regs = &mm0_cg_regs, \ 37 + .shift = _shift, \ 38 + .ops = &mtk_clk_gate_ops_setclr, \ 39 + } 40 + 41 + #define GATE_MM1(_id, _name, _parent, _shift) { \ 42 + .id = _id, \ 43 + .name = _name, \ 44 + .parent_name = _parent, \ 45 + .regs = &mm1_cg_regs, \ 46 + .shift = _shift, \ 47 + .ops = &mtk_clk_gate_ops_setclr, \ 48 + } 49 + 50 + static const struct mtk_gate mm_clks[] = { 51 + /* MM0 */ 52 + GATE_MM0(CLK_MM_SMI_COMMON, "mm_smi_common", "smi_mm", 0), 53 + GATE_MM0(CLK_MM_SMI_LARB0, "mm_smi_larb0", "smi_mm", 1), 54 + GATE_MM0(CLK_MM_CAM_MDP, "mm_cam_mdp", "smi_mm", 2), 55 + GATE_MM0(CLK_MM_MDP_RDMA, "mm_mdp_rdma", "smi_mm", 3), 56 + GATE_MM0(CLK_MM_MDP_RSZ0, "mm_mdp_rsz0", "smi_mm", 4), 57 + GATE_MM0(CLK_MM_MDP_RSZ1, "mm_mdp_rsz1", "smi_mm", 5), 58 + GATE_MM0(CLK_MM_MDP_TDSHP, "mm_mdp_tdshp", "smi_mm", 6), 59 + GATE_MM0(CLK_MM_MDP_WDMA, "mm_mdp_wdma", "smi_mm", 7), 60 + GATE_MM0(CLK_MM_MDP_WROT, "mm_mdp_wrot", "smi_mm", 8), 61 + GATE_MM0(CLK_MM_FAKE_ENG, "mm_fake_eng", "smi_mm", 9), 62 + GATE_MM0(CLK_MM_DISP_OVL0, "mm_disp_ovl0", "smi_mm", 10), 63 + GATE_MM0(CLK_MM_DISP_RDMA0, "mm_disp_rdma0", "smi_mm", 11), 64 + GATE_MM0(CLK_MM_DISP_RDMA1, "mm_disp_rdma1", "smi_mm", 12), 65 + GATE_MM0(CLK_MM_DISP_WDMA, "mm_disp_wdma", "smi_mm", 13), 66 + GATE_MM0(CLK_MM_DISP_COLOR, "mm_disp_color", "smi_mm", 14), 67 + GATE_MM0(CLK_MM_DISP_CCORR, "mm_disp_ccorr", "smi_mm", 15), 68 + GATE_MM0(CLK_MM_DISP_AAL, "mm_disp_aal", "smi_mm", 16), 69 + GATE_MM0(CLK_MM_DISP_GAMMA, "mm_disp_gamma", "smi_mm", 17), 70 + GATE_MM0(CLK_MM_DISP_DITHER, "mm_disp_dither", "smi_mm", 18), 71 + GATE_MM0(CLK_MM_DISP_UFOE, "mm_disp_ufoe", "smi_mm", 19), 72 + /* MM1 */ 73 + GATE_MM1(CLK_MM_DISP_PWM_MM, "mm_disp_pwm_mm", "smi_mm", 0), 74 + GATE_MM1(CLK_MM_DISP_PWM_26M, "mm_disp_pwm_26m", "smi_mm", 1), 75 + GATE_MM1(CLK_MM_DSI_ENGINE, "mm_dsi_engine", "smi_mm", 2), 76 + GATE_MM1(CLK_MM_DSI_DIGITAL, "mm_dsi_digital", "dsi0_lntc_dsick", 3), 77 + GATE_MM1(CLK_MM_DPI0_ENGINE, "mm_dpi0_engine", "smi_mm", 4), 78 + GATE_MM1(CLK_MM_DPI0_PXL, "mm_dpi0_pxl", "rg_fdpi0", 5), 79 + GATE_MM1(CLK_MM_LVDS_PXL, "mm_lvds_pxl", "vpll_dpix", 14), 80 + GATE_MM1(CLK_MM_LVDS_CTS, "mm_lvds_cts", "lvdstx_dig_cts", 15), 81 + GATE_MM1(CLK_MM_DPI1_ENGINE, "mm_dpi1_engine", "smi_mm", 16), 82 + GATE_MM1(CLK_MM_DPI1_PXL, "mm_dpi1_pxl", "rg_fdpi1", 17), 83 + GATE_MM1(CLK_MM_HDMI_PXL, "mm_hdmi_pxl", "rg_fdpi1", 18), 84 + GATE_MM1(CLK_MM_HDMI_SPDIF, "mm_hdmi_spdif", "apll12_div6", 19), 85 + GATE_MM1(CLK_MM_HDMI_ADSP_BCK, "mm_hdmi_adsp_b", "apll12_div4b", 20), 86 + GATE_MM1(CLK_MM_HDMI_PLL, "mm_hdmi_pll", "hdmtx_dig_cts", 21), 87 + }; 88 + 89 + struct clk_mt8167_mm_driver_data { 90 + const struct mtk_gate *gates_clk; 91 + int gates_num; 92 + }; 93 + 94 + static const struct clk_mt8167_mm_driver_data mt8167_mmsys_driver_data = { 95 + .gates_clk = mm_clks, 96 + .gates_num = ARRAY_SIZE(mm_clks), 97 + }; 98 + 99 + static int clk_mt8167_mm_probe(struct platform_device *pdev) 100 + { 101 + struct device *dev = &pdev->dev; 102 + struct device_node *node = dev->parent->of_node; 103 + const struct clk_mt8167_mm_driver_data *data; 104 + struct clk_onecell_data *clk_data; 105 + int ret; 106 + 107 + clk_data = mtk_alloc_clk_data(CLK_MM_NR_CLK); 108 + if (!clk_data) 109 + return -ENOMEM; 110 + 111 + data = &mt8167_mmsys_driver_data; 112 + 113 + ret = mtk_clk_register_gates(node, data->gates_clk, data->gates_num, 114 + clk_data); 115 + if (ret) 116 + return ret; 117 + 118 + ret = of_clk_add_provider(node, of_clk_src_onecell_get, clk_data); 119 + if (ret) 120 + return ret; 121 + 122 + return 0; 123 + } 124 + 125 + static struct platform_driver clk_mt8173_mm_drv = { 126 + .driver = { 127 + .name = "clk-mt8167-mm", 128 + }, 129 + .probe = clk_mt8167_mm_probe, 130 + }; 131 + 132 + builtin_platform_driver(clk_mt8173_mm_drv);
+73
drivers/clk/mediatek/clk-mt8167-vdec.c
··· 1 + // SPDX-License-Identifier: GPL-2.0 2 + /* 3 + * Copyright (c) 2020 MediaTek Inc. 4 + * Copyright (c) 2020 BayLibre, SAS 5 + * Author: James Liao <jamesjj.liao@mediatek.com> 6 + * Fabien Parent <fparent@baylibre.com> 7 + */ 8 + 9 + #include <linux/clk-provider.h> 10 + #include <linux/of.h> 11 + #include <linux/of_address.h> 12 + #include <linux/of_device.h> 13 + #include <linux/platform_device.h> 14 + 15 + #include "clk-mtk.h" 16 + #include "clk-gate.h" 17 + 18 + #include <dt-bindings/clock/mt8167-clk.h> 19 + 20 + static const struct mtk_gate_regs vdec0_cg_regs = { 21 + .set_ofs = 0x0, 22 + .clr_ofs = 0x4, 23 + .sta_ofs = 0x0, 24 + }; 25 + 26 + static const struct mtk_gate_regs vdec1_cg_regs = { 27 + .set_ofs = 0x8, 28 + .clr_ofs = 0xc, 29 + .sta_ofs = 0x8, 30 + }; 31 + 32 + #define GATE_VDEC0_I(_id, _name, _parent, _shift) { \ 33 + .id = _id, \ 34 + .name = _name, \ 35 + .parent_name = _parent, \ 36 + .regs = &vdec0_cg_regs, \ 37 + .shift = _shift, \ 38 + .ops = &mtk_clk_gate_ops_setclr_inv, \ 39 + } 40 + 41 + #define GATE_VDEC1_I(_id, _name, _parent, _shift) { \ 42 + .id = _id, \ 43 + .name = _name, \ 44 + .parent_name = _parent, \ 45 + .regs = &vdec1_cg_regs, \ 46 + .shift = _shift, \ 47 + .ops = &mtk_clk_gate_ops_setclr_inv, \ 48 + } 49 + 50 + static const struct mtk_gate vdec_clks[] __initconst = { 51 + /* VDEC0 */ 52 + GATE_VDEC0_I(CLK_VDEC_CKEN, "vdec_cken", "rg_vdec", 0), 53 + /* VDEC1 */ 54 + GATE_VDEC1_I(CLK_VDEC_LARB1_CKEN, "vdec_larb1_cken", "smi_mm", 0), 55 + }; 56 + 57 + static void __init mtk_vdecsys_init(struct device_node *node) 58 + { 59 + struct clk_onecell_data *clk_data; 60 + int r; 61 + 62 + clk_data = mtk_alloc_clk_data(CLK_VDEC_NR_CLK); 63 + 64 + mtk_clk_register_gates(node, vdec_clks, ARRAY_SIZE(vdec_clks), clk_data); 65 + 66 + r = of_clk_add_provider(node, of_clk_src_onecell_get, clk_data); 67 + 68 + if (r) 69 + pr_err("%s(): could not register clock provider: %d\n", 70 + __func__, r); 71 + 72 + } 73 + CLK_OF_DECLARE(mtk_vdecsys, "mediatek,mt8167-vdecsys", mtk_vdecsys_init);
+1062
drivers/clk/mediatek/clk-mt8167.c
··· 1 + // SPDX-License-Identifier: GPL-2.0 2 + /* 3 + * Copyright (c) 2020 MediaTek Inc. 4 + * Copyright (c) 2020 BayLibre, SAS 5 + * Author: James Liao <jamesjj.liao@mediatek.com> 6 + * Fabien Parent <fparent@baylibre.com> 7 + */ 8 + 9 + #include <linux/delay.h> 10 + #include <linux/of.h> 11 + #include <linux/of_address.h> 12 + #include <linux/slab.h> 13 + #include <linux/mfd/syscon.h> 14 + 15 + #include "clk-mtk.h" 16 + #include "clk-gate.h" 17 + 18 + #include <dt-bindings/clock/mt8167-clk.h> 19 + 20 + static DEFINE_SPINLOCK(mt8167_clk_lock); 21 + 22 + static const struct mtk_fixed_clk fixed_clks[] __initconst = { 23 + FIXED_CLK(CLK_TOP_CLK_NULL, "clk_null", NULL, 0), 24 + FIXED_CLK(CLK_TOP_I2S_INFRA_BCK, "i2s_infra_bck", "clk_null", 26000000), 25 + FIXED_CLK(CLK_TOP_MEMPLL, "mempll", "clk26m", 800000000), 26 + FIXED_CLK(CLK_TOP_DSI0_LNTC_DSICK, "dsi0_lntc_dsick", "clk26m", 75000000), 27 + FIXED_CLK(CLK_TOP_VPLL_DPIX, "vpll_dpix", "clk26m", 75000000), 28 + FIXED_CLK(CLK_TOP_LVDSTX_CLKDIG_CTS, "lvdstx_dig_cts", "clk26m", 52500000), 29 + }; 30 + 31 + static const struct mtk_fixed_factor top_divs[] __initconst = { 32 + FACTOR(CLK_TOP_DMPLL, "dmpll_ck", "mempll", 1, 1), 33 + FACTOR(CLK_TOP_MAINPLL_D2, "mainpll_d2", "mainpll", 1, 2), 34 + FACTOR(CLK_TOP_MAINPLL_D4, "mainpll_d4", "mainpll", 1, 4), 35 + FACTOR(CLK_TOP_MAINPLL_D8, "mainpll_d8", "mainpll", 1, 8), 36 + FACTOR(CLK_TOP_MAINPLL_D16, "mainpll_d16", "mainpll", 1, 16), 37 + FACTOR(CLK_TOP_MAINPLL_D11, "mainpll_d11", "mainpll", 1, 11), 38 + FACTOR(CLK_TOP_MAINPLL_D22, "mainpll_d22", "mainpll", 1, 22), 39 + FACTOR(CLK_TOP_MAINPLL_D3, "mainpll_d3", "mainpll", 1, 3), 40 + FACTOR(CLK_TOP_MAINPLL_D6, "mainpll_d6", "mainpll", 1, 6), 41 + FACTOR(CLK_TOP_MAINPLL_D12, "mainpll_d12", "mainpll", 1, 12), 42 + FACTOR(CLK_TOP_MAINPLL_D5, "mainpll_d5", "mainpll", 1, 5), 43 + FACTOR(CLK_TOP_MAINPLL_D10, "mainpll_d10", "mainpll", 1, 10), 44 + FACTOR(CLK_TOP_MAINPLL_D20, "mainpll_d20", "mainpll", 1, 20), 45 + FACTOR(CLK_TOP_MAINPLL_D40, "mainpll_d40", "mainpll", 1, 40), 46 + FACTOR(CLK_TOP_MAINPLL_D7, "mainpll_d7", "mainpll", 1, 7), 47 + FACTOR(CLK_TOP_MAINPLL_D14, "mainpll_d14", "mainpll", 1, 14), 48 + FACTOR(CLK_TOP_UNIVPLL_D2, "univpll_d2", "univpll", 1, 2), 49 + FACTOR(CLK_TOP_UNIVPLL_D4, "univpll_d4", "univpll", 1, 4), 50 + FACTOR(CLK_TOP_UNIVPLL_D8, "univpll_d8", "univpll", 1, 8), 51 + FACTOR(CLK_TOP_UNIVPLL_D16, "univpll_d16", "univpll", 1, 16), 52 + FACTOR(CLK_TOP_UNIVPLL_D3, "univpll_d3", "univpll", 1, 3), 53 + FACTOR(CLK_TOP_UNIVPLL_D6, "univpll_d6", "univpll", 1, 6), 54 + FACTOR(CLK_TOP_UNIVPLL_D12, "univpll_d12", "univpll", 1, 12), 55 + FACTOR(CLK_TOP_UNIVPLL_D24, "univpll_d24", "univpll", 1, 24), 56 + FACTOR(CLK_TOP_UNIVPLL_D5, "univpll_d5", "univpll", 1, 5), 57 + FACTOR(CLK_TOP_UNIVPLL_D20, "univpll_d20", "univpll", 1, 20), 58 + FACTOR(CLK_TOP_MMPLL380M, "mmpll380m", "mmpll", 1, 1), 59 + FACTOR(CLK_TOP_MMPLL_D2, "mmpll_d2", "mmpll", 1, 2), 60 + FACTOR(CLK_TOP_MMPLL_200M, "mmpll_200m", "mmpll", 1, 3), 61 + FACTOR(CLK_TOP_LVDSPLL, "lvdspll_ck", "lvdspll", 1, 1), 62 + FACTOR(CLK_TOP_LVDSPLL_D2, "lvdspll_d2", "lvdspll", 1, 2), 63 + FACTOR(CLK_TOP_LVDSPLL_D4, "lvdspll_d4", "lvdspll", 1, 4), 64 + FACTOR(CLK_TOP_LVDSPLL_D8, "lvdspll_d8", "lvdspll", 1, 8), 65 + FACTOR(CLK_TOP_USB_PHY48M, "usb_phy48m_ck", "univpll", 1, 26), 66 + FACTOR(CLK_TOP_APLL1, "apll1_ck", "apll1", 1, 1), 67 + FACTOR(CLK_TOP_APLL1_D2, "apll1_d2", "apll1_ck", 1, 2), 68 + FACTOR(CLK_TOP_APLL1_D4, "apll1_d4", "rg_apll1_d2_en", 1, 2), 69 + FACTOR(CLK_TOP_APLL1_D8, "apll1_d8", "rg_apll1_d4_en", 1, 2), 70 + FACTOR(CLK_TOP_APLL2, "apll2_ck", "apll2", 1, 1), 71 + FACTOR(CLK_TOP_APLL2_D2, "apll2_d2", "apll2_ck", 1, 2), 72 + FACTOR(CLK_TOP_APLL2_D4, "apll2_d4", "rg_apll2_d2_en", 1, 2), 73 + FACTOR(CLK_TOP_APLL2_D8, "apll2_d8", "rg_apll2_d4_en", 1, 2), 74 + FACTOR(CLK_TOP_CLK26M, "clk26m_ck", "clk26m", 1, 1), 75 + FACTOR(CLK_TOP_CLK26M_D2, "clk26m_d2", "clk26m", 1, 2), 76 + FACTOR(CLK_TOP_MIPI_26M, "mipi_26m", "clk26m", 1, 1), 77 + FACTOR(CLK_TOP_TVDPLL, "tvdpll_ck", "tvdpll", 1, 1), 78 + FACTOR(CLK_TOP_TVDPLL_D2, "tvdpll_d2", "tvdpll_ck", 1, 2), 79 + FACTOR(CLK_TOP_TVDPLL_D4, "tvdpll_d4", "tvdpll_ck", 1, 4), 80 + FACTOR(CLK_TOP_TVDPLL_D8, "tvdpll_d8", "tvdpll_ck", 1, 8), 81 + FACTOR(CLK_TOP_TVDPLL_D16, "tvdpll_d16", "tvdpll_ck", 1, 16), 82 + FACTOR(CLK_TOP_AHB_INFRA_D2, "ahb_infra_d2", "ahb_infra_sel", 1, 2), 83 + FACTOR(CLK_TOP_NFI1X, "nfi1x_ck", "nfi2x_pad_sel", 1, 2), 84 + FACTOR(CLK_TOP_ETH_D2, "eth_d2_ck", "eth_sel", 1, 2), 85 + }; 86 + 87 + static const char * const uart0_parents[] __initconst = { 88 + "clk26m_ck", 89 + "univpll_d24" 90 + }; 91 + 92 + static const char * const gfmux_emi1x_parents[] __initconst = { 93 + "clk26m_ck", 94 + "dmpll_ck" 95 + }; 96 + 97 + static const char * const emi_ddrphy_parents[] __initconst = { 98 + "gfmux_emi1x_sel", 99 + "gfmux_emi1x_sel" 100 + }; 101 + 102 + static const char * const ahb_infra_parents[] __initconst = { 103 + "clk_null", 104 + "clk26m_ck", 105 + "mainpll_d11", 106 + "clk_null", 107 + "mainpll_d12", 108 + "clk_null", 109 + "clk_null", 110 + "clk_null", 111 + "clk_null", 112 + "clk_null", 113 + "clk_null", 114 + "clk_null", 115 + "mainpll_d10" 116 + }; 117 + 118 + static const char * const csw_mux_mfg_parents[] __initconst = { 119 + "clk_null", 120 + "clk_null", 121 + "univpll_d3", 122 + "univpll_d2", 123 + "clk26m_ck", 124 + "mainpll_d4", 125 + "univpll_d24", 126 + "mmpll380m" 127 + }; 128 + 129 + static const char * const msdc0_parents[] __initconst = { 130 + "clk26m_ck", 131 + "univpll_d6", 132 + "mainpll_d8", 133 + "univpll_d8", 134 + "mainpll_d16", 135 + "mmpll_200m", 136 + "mainpll_d12", 137 + "mmpll_d2" 138 + }; 139 + 140 + static const char * const camtg_mm_parents[] __initconst = { 141 + "clk_null", 142 + "clk26m_ck", 143 + "usb_phy48m_ck", 144 + "clk_null", 145 + "univpll_d6" 146 + }; 147 + 148 + static const char * const pwm_mm_parents[] __initconst = { 149 + "clk26m_ck", 150 + "univpll_d12" 151 + }; 152 + 153 + static const char * const uart1_parents[] __initconst = { 154 + "clk26m_ck", 155 + "univpll_d24" 156 + }; 157 + 158 + static const char * const msdc1_parents[] __initconst = { 159 + "clk26m_ck", 160 + "univpll_d6", 161 + "mainpll_d8", 162 + "univpll_d8", 163 + "mainpll_d16", 164 + "mmpll_200m", 165 + "mainpll_d12", 166 + "mmpll_d2" 167 + }; 168 + 169 + static const char * const spm_52m_parents[] __initconst = { 170 + "clk26m_ck", 171 + "univpll_d24" 172 + }; 173 + 174 + static const char * const pmicspi_parents[] __initconst = { 175 + "univpll_d20", 176 + "usb_phy48m_ck", 177 + "univpll_d16", 178 + "clk26m_ck" 179 + }; 180 + 181 + static const char * const qaxi_aud26m_parents[] __initconst = { 182 + "clk26m_ck", 183 + "ahb_infra_sel" 184 + }; 185 + 186 + static const char * const aud_intbus_parents[] __initconst = { 187 + "clk_null", 188 + "clk26m_ck", 189 + "mainpll_d22", 190 + "clk_null", 191 + "mainpll_d11" 192 + }; 193 + 194 + static const char * const nfi2x_pad_parents[] __initconst = { 195 + "clk_null", 196 + "clk_null", 197 + "clk_null", 198 + "clk_null", 199 + "clk_null", 200 + "clk_null", 201 + "clk_null", 202 + "clk_null", 203 + "clk26m_ck", 204 + "clk_null", 205 + "clk_null", 206 + "clk_null", 207 + "clk_null", 208 + "clk_null", 209 + "clk_null", 210 + "clk_null", 211 + "clk_null", 212 + "mainpll_d12", 213 + "mainpll_d8", 214 + "clk_null", 215 + "mainpll_d6", 216 + "clk_null", 217 + "clk_null", 218 + "clk_null", 219 + "clk_null", 220 + "clk_null", 221 + "clk_null", 222 + "clk_null", 223 + "clk_null", 224 + "clk_null", 225 + "clk_null", 226 + "clk_null", 227 + "mainpll_d4", 228 + "clk_null", 229 + "clk_null", 230 + "clk_null", 231 + "clk_null", 232 + "clk_null", 233 + "clk_null", 234 + "clk_null", 235 + "clk_null", 236 + "clk_null", 237 + "clk_null", 238 + "clk_null", 239 + "clk_null", 240 + "clk_null", 241 + "clk_null", 242 + "clk_null", 243 + "clk_null", 244 + "clk_null", 245 + "clk_null", 246 + "clk_null", 247 + "clk_null", 248 + "clk_null", 249 + "clk_null", 250 + "clk_null", 251 + "clk_null", 252 + "clk_null", 253 + "clk_null", 254 + "clk_null", 255 + "clk_null", 256 + "clk_null", 257 + "clk_null", 258 + "clk_null", 259 + "clk_null", 260 + "clk_null", 261 + "clk_null", 262 + "clk_null", 263 + "clk_null", 264 + "clk_null", 265 + "clk_null", 266 + "clk_null", 267 + "clk_null", 268 + "clk_null", 269 + "clk_null", 270 + "clk_null", 271 + "clk_null", 272 + "clk_null", 273 + "clk_null", 274 + "clk_null", 275 + "clk_null", 276 + "mainpll_d10", 277 + "mainpll_d7", 278 + "clk_null", 279 + "mainpll_d5" 280 + }; 281 + 282 + static const char * const nfi1x_pad_parents[] __initconst = { 283 + "ahb_infra_sel", 284 + "nfi1x_ck" 285 + }; 286 + 287 + static const char * const mfg_mm_parents[] __initconst = { 288 + "clk_null", 289 + "clk_null", 290 + "clk_null", 291 + "clk_null", 292 + "clk_null", 293 + "clk_null", 294 + "clk_null", 295 + "clk_null", 296 + "csw_mux_mfg_sel", 297 + "clk_null", 298 + "clk_null", 299 + "clk_null", 300 + "clk_null", 301 + "clk_null", 302 + "clk_null", 303 + "clk_null", 304 + "mainpll_d3", 305 + "clk_null", 306 + "clk_null", 307 + "clk_null", 308 + "clk_null", 309 + "clk_null", 310 + "clk_null", 311 + "clk_null", 312 + "clk_null", 313 + "clk_null", 314 + "clk_null", 315 + "clk_null", 316 + "clk_null", 317 + "clk_null", 318 + "clk_null", 319 + "clk_null", 320 + "clk_null", 321 + "mainpll_d5", 322 + "mainpll_d7", 323 + "clk_null", 324 + "mainpll_d14" 325 + }; 326 + 327 + static const char * const ddrphycfg_parents[] __initconst = { 328 + "clk26m_ck", 329 + "mainpll_d16" 330 + }; 331 + 332 + static const char * const smi_mm_parents[] __initconst = { 333 + "clk26m_ck", 334 + "clk_null", 335 + "clk_null", 336 + "clk_null", 337 + "clk_null", 338 + "clk_null", 339 + "clk_null", 340 + "clk_null", 341 + "clk_null", 342 + "univpll_d4", 343 + "mainpll_d7", 344 + "clk_null", 345 + "mainpll_d14" 346 + }; 347 + 348 + static const char * const usb_78m_parents[] __initconst = { 349 + "clk_null", 350 + "clk26m_ck", 351 + "univpll_d16", 352 + "clk_null", 353 + "mainpll_d20" 354 + }; 355 + 356 + static const char * const scam_mm_parents[] __initconst = { 357 + "clk_null", 358 + "clk26m_ck", 359 + "mainpll_d14", 360 + "clk_null", 361 + "mainpll_d12" 362 + }; 363 + 364 + static const char * const spinor_parents[] __initconst = { 365 + "clk26m_d2", 366 + "clk26m_ck", 367 + "mainpll_d40", 368 + "univpll_d24", 369 + "univpll_d20", 370 + "mainpll_d20", 371 + "mainpll_d16", 372 + "univpll_d12" 373 + }; 374 + 375 + static const char * const msdc2_parents[] __initconst = { 376 + "clk26m_ck", 377 + "univpll_d6", 378 + "mainpll_d8", 379 + "univpll_d8", 380 + "mainpll_d16", 381 + "mmpll_200m", 382 + "mainpll_d12", 383 + "mmpll_d2" 384 + }; 385 + 386 + static const char * const eth_parents[] __initconst = { 387 + "clk26m_ck", 388 + "mainpll_d40", 389 + "univpll_d24", 390 + "univpll_d20", 391 + "mainpll_d20" 392 + }; 393 + 394 + static const char * const vdec_mm_parents[] __initconst = { 395 + "clk26m_ck", 396 + "univpll_d4", 397 + "mainpll_d4", 398 + "univpll_d5", 399 + "univpll_d6", 400 + "mainpll_d6" 401 + }; 402 + 403 + static const char * const dpi0_mm_parents[] __initconst = { 404 + "clk26m_ck", 405 + "lvdspll_ck", 406 + "lvdspll_d2", 407 + "lvdspll_d4", 408 + "lvdspll_d8" 409 + }; 410 + 411 + static const char * const dpi1_mm_parents[] __initconst = { 412 + "clk26m_ck", 413 + "tvdpll_d2", 414 + "tvdpll_d4", 415 + "tvdpll_d8", 416 + "tvdpll_d16" 417 + }; 418 + 419 + static const char * const axi_mfg_in_parents[] __initconst = { 420 + "clk26m_ck", 421 + "mainpll_d11", 422 + "univpll_d24", 423 + "mmpll380m" 424 + }; 425 + 426 + static const char * const slow_mfg_parents[] __initconst = { 427 + "clk26m_ck", 428 + "univpll_d12", 429 + "univpll_d24" 430 + }; 431 + 432 + static const char * const aud1_parents[] __initconst = { 433 + "clk26m_ck", 434 + "apll1_ck" 435 + }; 436 + 437 + static const char * const aud2_parents[] __initconst = { 438 + "clk26m_ck", 439 + "apll2_ck" 440 + }; 441 + 442 + static const char * const aud_engen1_parents[] __initconst = { 443 + "clk26m_ck", 444 + "rg_apll1_d2_en", 445 + "rg_apll1_d4_en", 446 + "rg_apll1_d8_en" 447 + }; 448 + 449 + static const char * const aud_engen2_parents[] __initconst = { 450 + "clk26m_ck", 451 + "rg_apll2_d2_en", 452 + "rg_apll2_d4_en", 453 + "rg_apll2_d8_en" 454 + }; 455 + 456 + static const char * const i2c_parents[] __initconst = { 457 + "clk26m_ck", 458 + "univpll_d20", 459 + "univpll_d16", 460 + "univpll_d12" 461 + }; 462 + 463 + static const char * const aud_i2s0_m_parents[] __initconst = { 464 + "rg_aud1", 465 + "rg_aud2" 466 + }; 467 + 468 + static const char * const pwm_parents[] __initconst = { 469 + "clk26m_ck", 470 + "univpll_d12" 471 + }; 472 + 473 + static const char * const spi_parents[] __initconst = { 474 + "clk26m_ck", 475 + "univpll_d12", 476 + "univpll_d8", 477 + "univpll_d6" 478 + }; 479 + 480 + static const char * const aud_spdifin_parents[] __initconst = { 481 + "clk26m_ck", 482 + "univpll_d2" 483 + }; 484 + 485 + static const char * const uart2_parents[] __initconst = { 486 + "clk26m_ck", 487 + "univpll_d24" 488 + }; 489 + 490 + static const char * const bsi_parents[] __initconst = { 491 + "clk26m_ck", 492 + "mainpll_d10", 493 + "mainpll_d12", 494 + "mainpll_d20" 495 + }; 496 + 497 + static const char * const dbg_atclk_parents[] __initconst = { 498 + "clk_null", 499 + "clk26m_ck", 500 + "mainpll_d5", 501 + "clk_null", 502 + "univpll_d5" 503 + }; 504 + 505 + static const char * const csw_nfiecc_parents[] __initconst = { 506 + "clk_null", 507 + "mainpll_d7", 508 + "mainpll_d6", 509 + "clk_null", 510 + "mainpll_d5" 511 + }; 512 + 513 + static const char * const nfiecc_parents[] __initconst = { 514 + "clk_null", 515 + "nfi2x_pad_sel", 516 + "mainpll_d4", 517 + "clk_null", 518 + "csw_nfiecc_sel" 519 + }; 520 + 521 + static struct mtk_composite top_muxes[] __initdata = { 522 + /* CLK_MUX_SEL0 */ 523 + MUX(CLK_TOP_UART0_SEL, "uart0_sel", uart0_parents, 524 + 0x000, 0, 1), 525 + MUX(CLK_TOP_GFMUX_EMI1X_SEL, "gfmux_emi1x_sel", gfmux_emi1x_parents, 526 + 0x000, 1, 1), 527 + MUX(CLK_TOP_EMI_DDRPHY_SEL, "emi_ddrphy_sel", emi_ddrphy_parents, 528 + 0x000, 2, 1), 529 + MUX(CLK_TOP_AHB_INFRA_SEL, "ahb_infra_sel", ahb_infra_parents, 530 + 0x000, 4, 4), 531 + MUX(CLK_TOP_CSW_MUX_MFG_SEL, "csw_mux_mfg_sel", csw_mux_mfg_parents, 532 + 0x000, 8, 3), 533 + MUX(CLK_TOP_MSDC0_SEL, "msdc0_sel", msdc0_parents, 534 + 0x000, 11, 3), 535 + MUX(CLK_TOP_CAMTG_MM_SEL, "camtg_mm_sel", camtg_mm_parents, 536 + 0x000, 15, 3), 537 + MUX(CLK_TOP_PWM_MM_SEL, "pwm_mm_sel", pwm_mm_parents, 538 + 0x000, 18, 1), 539 + MUX(CLK_TOP_UART1_SEL, "uart1_sel", uart1_parents, 540 + 0x000, 19, 1), 541 + MUX(CLK_TOP_MSDC1_SEL, "msdc1_sel", msdc1_parents, 542 + 0x000, 20, 3), 543 + MUX(CLK_TOP_SPM_52M_SEL, "spm_52m_sel", spm_52m_parents, 544 + 0x000, 23, 1), 545 + MUX(CLK_TOP_PMICSPI_SEL, "pmicspi_sel", pmicspi_parents, 546 + 0x000, 24, 2), 547 + MUX(CLK_TOP_QAXI_AUD26M_SEL, "qaxi_aud26m_sel", qaxi_aud26m_parents, 548 + 0x000, 26, 1), 549 + MUX(CLK_TOP_AUD_INTBUS_SEL, "aud_intbus_sel", aud_intbus_parents, 550 + 0x000, 27, 3), 551 + /* CLK_MUX_SEL1 */ 552 + MUX(CLK_TOP_NFI2X_PAD_SEL, "nfi2x_pad_sel", nfi2x_pad_parents, 553 + 0x004, 0, 7), 554 + MUX(CLK_TOP_NFI1X_PAD_SEL, "nfi1x_pad_sel", nfi1x_pad_parents, 555 + 0x004, 7, 1), 556 + MUX(CLK_TOP_MFG_MM_SEL, "mfg_mm_sel", mfg_mm_parents, 557 + 0x004, 8, 6), 558 + MUX(CLK_TOP_DDRPHYCFG_SEL, "ddrphycfg_sel", ddrphycfg_parents, 559 + 0x004, 15, 1), 560 + MUX(CLK_TOP_SMI_MM_SEL, "smi_mm_sel", smi_mm_parents, 561 + 0x004, 16, 4), 562 + MUX(CLK_TOP_USB_78M_SEL, "usb_78m_sel", usb_78m_parents, 563 + 0x004, 20, 3), 564 + MUX(CLK_TOP_SCAM_MM_SEL, "scam_mm_sel", scam_mm_parents, 565 + 0x004, 23, 3), 566 + /* CLK_MUX_SEL8 */ 567 + MUX(CLK_TOP_SPINOR_SEL, "spinor_sel", spinor_parents, 568 + 0x040, 0, 3), 569 + MUX(CLK_TOP_MSDC2_SEL, "msdc2_sel", msdc2_parents, 570 + 0x040, 3, 3), 571 + MUX(CLK_TOP_ETH_SEL, "eth_sel", eth_parents, 572 + 0x040, 6, 3), 573 + MUX(CLK_TOP_VDEC_MM_SEL, "vdec_mm_sel", vdec_mm_parents, 574 + 0x040, 9, 3), 575 + MUX(CLK_TOP_DPI0_MM_SEL, "dpi0_mm_sel", dpi0_mm_parents, 576 + 0x040, 12, 3), 577 + MUX(CLK_TOP_DPI1_MM_SEL, "dpi1_mm_sel", dpi1_mm_parents, 578 + 0x040, 15, 3), 579 + MUX(CLK_TOP_AXI_MFG_IN_SEL, "axi_mfg_in_sel", axi_mfg_in_parents, 580 + 0x040, 18, 2), 581 + MUX(CLK_TOP_SLOW_MFG_SEL, "slow_mfg_sel", slow_mfg_parents, 582 + 0x040, 20, 2), 583 + MUX(CLK_TOP_AUD1_SEL, "aud1_sel", aud1_parents, 584 + 0x040, 22, 1), 585 + MUX(CLK_TOP_AUD2_SEL, "aud2_sel", aud2_parents, 586 + 0x040, 23, 1), 587 + MUX(CLK_TOP_AUD_ENGEN1_SEL, "aud_engen1_sel", aud_engen1_parents, 588 + 0x040, 24, 2), 589 + MUX(CLK_TOP_AUD_ENGEN2_SEL, "aud_engen2_sel", aud_engen2_parents, 590 + 0x040, 26, 2), 591 + MUX(CLK_TOP_I2C_SEL, "i2c_sel", i2c_parents, 592 + 0x040, 28, 2), 593 + /* CLK_SEL_9 */ 594 + MUX(CLK_TOP_AUD_I2S0_M_SEL, "aud_i2s0_m_sel", aud_i2s0_m_parents, 595 + 0x044, 12, 1), 596 + MUX(CLK_TOP_AUD_I2S1_M_SEL, "aud_i2s1_m_sel", aud_i2s0_m_parents, 597 + 0x044, 13, 1), 598 + MUX(CLK_TOP_AUD_I2S2_M_SEL, "aud_i2s2_m_sel", aud_i2s0_m_parents, 599 + 0x044, 14, 1), 600 + MUX(CLK_TOP_AUD_I2S3_M_SEL, "aud_i2s3_m_sel", aud_i2s0_m_parents, 601 + 0x044, 15, 1), 602 + MUX(CLK_TOP_AUD_I2S4_M_SEL, "aud_i2s4_m_sel", aud_i2s0_m_parents, 603 + 0x044, 16, 1), 604 + MUX(CLK_TOP_AUD_I2S5_M_SEL, "aud_i2s5_m_sel", aud_i2s0_m_parents, 605 + 0x044, 17, 1), 606 + MUX(CLK_TOP_AUD_SPDIF_B_SEL, "aud_spdif_b_sel", aud_i2s0_m_parents, 607 + 0x044, 18, 1), 608 + /* CLK_MUX_SEL13 */ 609 + MUX(CLK_TOP_PWM_SEL, "pwm_sel", pwm_parents, 610 + 0x07c, 0, 1), 611 + MUX(CLK_TOP_SPI_SEL, "spi_sel", spi_parents, 612 + 0x07c, 1, 2), 613 + MUX(CLK_TOP_AUD_SPDIFIN_SEL, "aud_spdifin_sel", aud_spdifin_parents, 614 + 0x07c, 3, 1), 615 + MUX(CLK_TOP_UART2_SEL, "uart2_sel", uart2_parents, 616 + 0x07c, 4, 1), 617 + MUX(CLK_TOP_BSI_SEL, "bsi_sel", bsi_parents, 618 + 0x07c, 5, 2), 619 + MUX(CLK_TOP_DBG_ATCLK_SEL, "dbg_atclk_sel", dbg_atclk_parents, 620 + 0x07c, 7, 3), 621 + MUX(CLK_TOP_CSW_NFIECC_SEL, "csw_nfiecc_sel", csw_nfiecc_parents, 622 + 0x07c, 10, 3), 623 + MUX(CLK_TOP_NFIECC_SEL, "nfiecc_sel", nfiecc_parents, 624 + 0x07c, 13, 3), 625 + }; 626 + 627 + static const char * const ifr_mux1_parents[] __initconst = { 628 + "clk26m_ck", 629 + "armpll", 630 + "univpll", 631 + "mainpll_d2" 632 + }; 633 + 634 + static const char * const ifr_eth_25m_parents[] __initconst = { 635 + "eth_d2_ck", 636 + "rg_eth" 637 + }; 638 + 639 + static const char * const ifr_i2c0_parents[] __initconst = { 640 + "ahb_infra_d2", 641 + "rg_i2c" 642 + }; 643 + 644 + static const struct mtk_composite ifr_muxes[] __initconst = { 645 + MUX(CLK_IFR_MUX1_SEL, "ifr_mux1_sel", ifr_mux1_parents, 0x000, 646 + 2, 2), 647 + MUX(CLK_IFR_ETH_25M_SEL, "ifr_eth_25m_sel", ifr_eth_25m_parents, 0x080, 648 + 0, 1), 649 + MUX(CLK_IFR_I2C0_SEL, "ifr_i2c0_sel", ifr_i2c0_parents, 0x080, 650 + 1, 1), 651 + MUX(CLK_IFR_I2C1_SEL, "ifr_i2c1_sel", ifr_i2c0_parents, 0x080, 652 + 2, 1), 653 + MUX(CLK_IFR_I2C2_SEL, "ifr_i2c2_sel", ifr_i2c0_parents, 0x080, 654 + 3, 1), 655 + }; 656 + 657 + #define DIV_ADJ(_id, _name, _parent, _reg, _shift, _width) { \ 658 + .id = _id, \ 659 + .name = _name, \ 660 + .parent_name = _parent, \ 661 + .div_reg = _reg, \ 662 + .div_shift = _shift, \ 663 + .div_width = _width, \ 664 + } 665 + 666 + static const struct mtk_clk_divider top_adj_divs[] = { 667 + DIV_ADJ(CLK_TOP_APLL12_CK_DIV0, "apll12_ck_div0", "aud_i2s0_m_sel", 668 + 0x0048, 0, 8), 669 + DIV_ADJ(CLK_TOP_APLL12_CK_DIV1, "apll12_ck_div1", "aud_i2s1_m_sel", 670 + 0x0048, 8, 8), 671 + DIV_ADJ(CLK_TOP_APLL12_CK_DIV2, "apll12_ck_div2", "aud_i2s2_m_sel", 672 + 0x0048, 16, 8), 673 + DIV_ADJ(CLK_TOP_APLL12_CK_DIV3, "apll12_ck_div3", "aud_i2s3_m_sel", 674 + 0x0048, 24, 8), 675 + DIV_ADJ(CLK_TOP_APLL12_CK_DIV4, "apll12_ck_div4", "aud_i2s4_m_sel", 676 + 0x004c, 0, 8), 677 + DIV_ADJ(CLK_TOP_APLL12_CK_DIV4B, "apll12_ck_div4b", "apll12_div4", 678 + 0x004c, 8, 8), 679 + DIV_ADJ(CLK_TOP_APLL12_CK_DIV5, "apll12_ck_div5", "aud_i2s5_m_sel", 680 + 0x004c, 16, 8), 681 + DIV_ADJ(CLK_TOP_APLL12_CK_DIV5B, "apll12_ck_div5b", "apll12_div5", 682 + 0x004c, 24, 8), 683 + DIV_ADJ(CLK_TOP_APLL12_CK_DIV6, "apll12_ck_div6", "aud_spdif_b_sel", 684 + 0x0078, 0, 8), 685 + }; 686 + 687 + #define DIV_ADJ_FLAG(_id, _name, _parent, _reg, _shift, _width, _flag) { \ 688 + .id = _id, \ 689 + .name = _name, \ 690 + .parent_name = _parent, \ 691 + .div_reg = _reg, \ 692 + .div_shift = _shift, \ 693 + .div_width = _width, \ 694 + .clk_divider_flags = _flag, \ 695 + } 696 + 697 + static const struct mtk_clk_divider apmixed_adj_divs[] = { 698 + DIV_ADJ_FLAG(CLK_APMIXED_HDMI_REF, "hdmi_ref", "tvdpll", 699 + 0x1c4, 24, 3, CLK_DIVIDER_POWER_OF_TWO), 700 + }; 701 + 702 + static const struct mtk_gate_regs top0_cg_regs = { 703 + .set_ofs = 0x50, 704 + .clr_ofs = 0x80, 705 + .sta_ofs = 0x20, 706 + }; 707 + 708 + static const struct mtk_gate_regs top1_cg_regs = { 709 + .set_ofs = 0x54, 710 + .clr_ofs = 0x84, 711 + .sta_ofs = 0x24, 712 + }; 713 + 714 + static const struct mtk_gate_regs top2_cg_regs = { 715 + .set_ofs = 0x6c, 716 + .clr_ofs = 0x9c, 717 + .sta_ofs = 0x3c, 718 + }; 719 + 720 + static const struct mtk_gate_regs top3_cg_regs = { 721 + .set_ofs = 0xa0, 722 + .clr_ofs = 0xb0, 723 + .sta_ofs = 0x70, 724 + }; 725 + 726 + static const struct mtk_gate_regs top4_cg_regs = { 727 + .set_ofs = 0xa4, 728 + .clr_ofs = 0xb4, 729 + .sta_ofs = 0x74, 730 + }; 731 + 732 + static const struct mtk_gate_regs top5_cg_regs = { 733 + .set_ofs = 0x44, 734 + .clr_ofs = 0x44, 735 + .sta_ofs = 0x44, 736 + }; 737 + 738 + #define GATE_TOP0(_id, _name, _parent, _shift) { \ 739 + .id = _id, \ 740 + .name = _name, \ 741 + .parent_name = _parent, \ 742 + .regs = &top0_cg_regs, \ 743 + .shift = _shift, \ 744 + .ops = &mtk_clk_gate_ops_setclr, \ 745 + } 746 + 747 + #define GATE_TOP0_I(_id, _name, _parent, _shift) { \ 748 + .id = _id, \ 749 + .name = _name, \ 750 + .parent_name = _parent, \ 751 + .regs = &top0_cg_regs, \ 752 + .shift = _shift, \ 753 + .ops = &mtk_clk_gate_ops_setclr_inv, \ 754 + } 755 + 756 + #define GATE_TOP1(_id, _name, _parent, _shift) { \ 757 + .id = _id, \ 758 + .name = _name, \ 759 + .parent_name = _parent, \ 760 + .regs = &top1_cg_regs, \ 761 + .shift = _shift, \ 762 + .ops = &mtk_clk_gate_ops_setclr, \ 763 + } 764 + 765 + #define GATE_TOP2(_id, _name, _parent, _shift) { \ 766 + .id = _id, \ 767 + .name = _name, \ 768 + .parent_name = _parent, \ 769 + .regs = &top2_cg_regs, \ 770 + .shift = _shift, \ 771 + .ops = &mtk_clk_gate_ops_setclr, \ 772 + } 773 + 774 + #define GATE_TOP2_I(_id, _name, _parent, _shift) { \ 775 + .id = _id, \ 776 + .name = _name, \ 777 + .parent_name = _parent, \ 778 + .regs = &top2_cg_regs, \ 779 + .shift = _shift, \ 780 + .ops = &mtk_clk_gate_ops_setclr_inv, \ 781 + } 782 + 783 + #define GATE_TOP3(_id, _name, _parent, _shift) { \ 784 + .id = _id, \ 785 + .name = _name, \ 786 + .parent_name = _parent, \ 787 + .regs = &top3_cg_regs, \ 788 + .shift = _shift, \ 789 + .ops = &mtk_clk_gate_ops_setclr, \ 790 + } 791 + 792 + #define GATE_TOP4_I(_id, _name, _parent, _shift) { \ 793 + .id = _id, \ 794 + .name = _name, \ 795 + .parent_name = _parent, \ 796 + .regs = &top4_cg_regs, \ 797 + .shift = _shift, \ 798 + .ops = &mtk_clk_gate_ops_setclr_inv, \ 799 + } 800 + 801 + #define GATE_TOP5(_id, _name, _parent, _shift) { \ 802 + .id = _id, \ 803 + .name = _name, \ 804 + .parent_name = _parent, \ 805 + .regs = &top5_cg_regs, \ 806 + .shift = _shift, \ 807 + .ops = &mtk_clk_gate_ops_no_setclr, \ 808 + } 809 + 810 + static const struct mtk_gate top_clks[] __initconst = { 811 + /* TOP0 */ 812 + GATE_TOP0(CLK_TOP_PWM_MM, "pwm_mm", "pwm_mm_sel", 0), 813 + GATE_TOP0(CLK_TOP_CAM_MM, "cam_mm", "camtg_mm_sel", 1), 814 + GATE_TOP0(CLK_TOP_MFG_MM, "mfg_mm", "mfg_mm_sel", 2), 815 + GATE_TOP0(CLK_TOP_SPM_52M, "spm_52m", "spm_52m_sel", 3), 816 + GATE_TOP0_I(CLK_TOP_MIPI_26M_DBG, "mipi_26m_dbg", "mipi_26m", 4), 817 + GATE_TOP0(CLK_TOP_SCAM_MM, "scam_mm", "scam_mm_sel", 5), 818 + GATE_TOP0(CLK_TOP_SMI_MM, "smi_mm", "smi_mm_sel", 9), 819 + /* TOP1 */ 820 + GATE_TOP1(CLK_TOP_THEM, "them", "ahb_infra_sel", 1), 821 + GATE_TOP1(CLK_TOP_APDMA, "apdma", "ahb_infra_sel", 2), 822 + GATE_TOP1(CLK_TOP_I2C0, "i2c0", "ifr_i2c0_sel", 3), 823 + GATE_TOP1(CLK_TOP_I2C1, "i2c1", "ifr_i2c1_sel", 4), 824 + GATE_TOP1(CLK_TOP_AUXADC1, "auxadc1", "ahb_infra_sel", 5), 825 + GATE_TOP1(CLK_TOP_NFI, "nfi", "nfi1x_pad_sel", 6), 826 + GATE_TOP1(CLK_TOP_NFIECC, "nfiecc", "rg_nfiecc", 7), 827 + GATE_TOP1(CLK_TOP_DEBUGSYS, "debugsys", "rg_dbg_atclk", 8), 828 + GATE_TOP1(CLK_TOP_PWM, "pwm", "ahb_infra_sel", 9), 829 + GATE_TOP1(CLK_TOP_UART0, "uart0", "uart0_sel", 10), 830 + GATE_TOP1(CLK_TOP_UART1, "uart1", "uart1_sel", 11), 831 + GATE_TOP1(CLK_TOP_BTIF, "btif", "ahb_infra_sel", 12), 832 + GATE_TOP1(CLK_TOP_USB, "usb", "usb_78m", 13), 833 + GATE_TOP1(CLK_TOP_FLASHIF_26M, "flashif_26m", "clk26m_ck", 14), 834 + GATE_TOP1(CLK_TOP_AUXADC2, "auxadc2", "ahb_infra_sel", 15), 835 + GATE_TOP1(CLK_TOP_I2C2, "i2c2", "ifr_i2c2_sel", 16), 836 + GATE_TOP1(CLK_TOP_MSDC0, "msdc0", "msdc0_sel", 17), 837 + GATE_TOP1(CLK_TOP_MSDC1, "msdc1", "msdc1_sel", 18), 838 + GATE_TOP1(CLK_TOP_NFI2X, "nfi2x", "nfi2x_pad_sel", 19), 839 + GATE_TOP1(CLK_TOP_PMICWRAP_AP, "pwrap_ap", "clk26m_ck", 20), 840 + GATE_TOP1(CLK_TOP_SEJ, "sej", "ahb_infra_sel", 21), 841 + GATE_TOP1(CLK_TOP_MEMSLP_DLYER, "memslp_dlyer", "clk26m_ck", 22), 842 + GATE_TOP1(CLK_TOP_SPI, "spi", "spi_sel", 23), 843 + GATE_TOP1(CLK_TOP_APXGPT, "apxgpt", "clk26m_ck", 24), 844 + GATE_TOP1(CLK_TOP_AUDIO, "audio", "clk26m_ck", 25), 845 + GATE_TOP1(CLK_TOP_PMICWRAP_MD, "pwrap_md", "clk26m_ck", 27), 846 + GATE_TOP1(CLK_TOP_PMICWRAP_CONN, "pwrap_conn", "clk26m_ck", 28), 847 + GATE_TOP1(CLK_TOP_PMICWRAP_26M, "pwrap_26m", "clk26m_ck", 29), 848 + GATE_TOP1(CLK_TOP_AUX_ADC, "aux_adc", "clk26m_ck", 30), 849 + GATE_TOP1(CLK_TOP_AUX_TP, "aux_tp", "clk26m_ck", 31), 850 + /* TOP2 */ 851 + GATE_TOP2(CLK_TOP_MSDC2, "msdc2", "ahb_infra_sel", 0), 852 + GATE_TOP2(CLK_TOP_RBIST, "rbist", "univpll_d12", 1), 853 + GATE_TOP2(CLK_TOP_NFI_BUS, "nfi_bus", "ahb_infra_sel", 2), 854 + GATE_TOP2(CLK_TOP_GCE, "gce", "ahb_infra_sel", 4), 855 + GATE_TOP2(CLK_TOP_TRNG, "trng", "ahb_infra_sel", 5), 856 + GATE_TOP2(CLK_TOP_SEJ_13M, "sej_13m", "clk26m_ck", 6), 857 + GATE_TOP2(CLK_TOP_AES, "aes", "ahb_infra_sel", 7), 858 + GATE_TOP2(CLK_TOP_PWM_B, "pwm_b", "rg_pwm_infra", 8), 859 + GATE_TOP2(CLK_TOP_PWM1_FB, "pwm1_fb", "rg_pwm_infra", 9), 860 + GATE_TOP2(CLK_TOP_PWM2_FB, "pwm2_fb", "rg_pwm_infra", 10), 861 + GATE_TOP2(CLK_TOP_PWM3_FB, "pwm3_fb", "rg_pwm_infra", 11), 862 + GATE_TOP2(CLK_TOP_PWM4_FB, "pwm4_fb", "rg_pwm_infra", 12), 863 + GATE_TOP2(CLK_TOP_PWM5_FB, "pwm5_fb", "rg_pwm_infra", 13), 864 + GATE_TOP2(CLK_TOP_USB_1P, "usb_1p", "usb_78m", 14), 865 + GATE_TOP2(CLK_TOP_FLASHIF_FREERUN, "flashif_freerun", "ahb_infra_sel", 866 + 15), 867 + GATE_TOP2(CLK_TOP_26M_HDMI_SIFM, "hdmi_sifm_26m", "clk26m_ck", 16), 868 + GATE_TOP2(CLK_TOP_26M_CEC, "cec_26m", "clk26m_ck", 17), 869 + GATE_TOP2(CLK_TOP_32K_CEC, "cec_32k", "clk32k", 18), 870 + GATE_TOP2(CLK_TOP_66M_ETH, "eth_66m", "ahb_infra_d2", 19), 871 + GATE_TOP2(CLK_TOP_133M_ETH, "eth_133m", "ahb_infra_sel", 20), 872 + GATE_TOP2(CLK_TOP_FETH_25M, "feth_25m", "ifr_eth_25m_sel", 21), 873 + GATE_TOP2(CLK_TOP_FETH_50M, "feth_50m", "rg_eth", 22), 874 + GATE_TOP2(CLK_TOP_FLASHIF_AXI, "flashif_axi", "ahb_infra_sel", 23), 875 + GATE_TOP2(CLK_TOP_USBIF, "usbif", "ahb_infra_sel", 24), 876 + GATE_TOP2(CLK_TOP_UART2, "uart2", "rg_uart2", 25), 877 + GATE_TOP2(CLK_TOP_BSI, "bsi", "ahb_infra_sel", 26), 878 + GATE_TOP2(CLK_TOP_GCPU_B, "gcpu_b", "ahb_infra_sel", 27), 879 + GATE_TOP2_I(CLK_TOP_MSDC0_INFRA, "msdc0_infra", "msdc0", 28), 880 + GATE_TOP2_I(CLK_TOP_MSDC1_INFRA, "msdc1_infra", "msdc1", 29), 881 + GATE_TOP2_I(CLK_TOP_MSDC2_INFRA, "msdc2_infra", "rg_msdc2", 30), 882 + GATE_TOP2(CLK_TOP_USB_78M, "usb_78m", "usb_78m_sel", 31), 883 + /* TOP3 */ 884 + GATE_TOP3(CLK_TOP_RG_SPINOR, "rg_spinor", "spinor_sel", 0), 885 + GATE_TOP3(CLK_TOP_RG_MSDC2, "rg_msdc2", "msdc2_sel", 1), 886 + GATE_TOP3(CLK_TOP_RG_ETH, "rg_eth", "eth_sel", 2), 887 + GATE_TOP3(CLK_TOP_RG_VDEC, "rg_vdec", "vdec_mm_sel", 3), 888 + GATE_TOP3(CLK_TOP_RG_FDPI0, "rg_fdpi0", "dpi0_mm_sel", 4), 889 + GATE_TOP3(CLK_TOP_RG_FDPI1, "rg_fdpi1", "dpi1_mm_sel", 5), 890 + GATE_TOP3(CLK_TOP_RG_AXI_MFG, "rg_axi_mfg", "axi_mfg_in_sel", 6), 891 + GATE_TOP3(CLK_TOP_RG_SLOW_MFG, "rg_slow_mfg", "slow_mfg_sel", 7), 892 + GATE_TOP3(CLK_TOP_RG_AUD1, "rg_aud1", "aud1_sel", 8), 893 + GATE_TOP3(CLK_TOP_RG_AUD2, "rg_aud2", "aud2_sel", 9), 894 + GATE_TOP3(CLK_TOP_RG_AUD_ENGEN1, "rg_aud_engen1", "aud_engen1_sel", 10), 895 + GATE_TOP3(CLK_TOP_RG_AUD_ENGEN2, "rg_aud_engen2", "aud_engen2_sel", 11), 896 + GATE_TOP3(CLK_TOP_RG_I2C, "rg_i2c", "i2c_sel", 12), 897 + GATE_TOP3(CLK_TOP_RG_PWM_INFRA, "rg_pwm_infra", "pwm_sel", 13), 898 + GATE_TOP3(CLK_TOP_RG_AUD_SPDIF_IN, "rg_aud_spdif_in", "aud_spdifin_sel", 899 + 14), 900 + GATE_TOP3(CLK_TOP_RG_UART2, "rg_uart2", "uart2_sel", 15), 901 + GATE_TOP3(CLK_TOP_RG_BSI, "rg_bsi", "bsi_sel", 16), 902 + GATE_TOP3(CLK_TOP_RG_DBG_ATCLK, "rg_dbg_atclk", "dbg_atclk_sel", 17), 903 + GATE_TOP3(CLK_TOP_RG_NFIECC, "rg_nfiecc", "nfiecc_sel", 18), 904 + /* TOP4 */ 905 + GATE_TOP4_I(CLK_TOP_RG_APLL1_D2_EN, "rg_apll1_d2_en", "apll1_d2", 8), 906 + GATE_TOP4_I(CLK_TOP_RG_APLL1_D4_EN, "rg_apll1_d4_en", "apll1_d4", 9), 907 + GATE_TOP4_I(CLK_TOP_RG_APLL1_D8_EN, "rg_apll1_d8_en", "apll1_d8", 10), 908 + GATE_TOP4_I(CLK_TOP_RG_APLL2_D2_EN, "rg_apll2_d2_en", "apll2_d2", 11), 909 + GATE_TOP4_I(CLK_TOP_RG_APLL2_D4_EN, "rg_apll2_d4_en", "apll2_d4", 12), 910 + GATE_TOP4_I(CLK_TOP_RG_APLL2_D8_EN, "rg_apll2_d8_en", "apll2_d8", 13), 911 + /* TOP5 */ 912 + GATE_TOP5(CLK_TOP_APLL12_DIV0, "apll12_div0", "apll12_ck_div0", 0), 913 + GATE_TOP5(CLK_TOP_APLL12_DIV1, "apll12_div1", "apll12_ck_div1", 1), 914 + GATE_TOP5(CLK_TOP_APLL12_DIV2, "apll12_div2", "apll12_ck_div2", 2), 915 + GATE_TOP5(CLK_TOP_APLL12_DIV3, "apll12_div3", "apll12_ck_div3", 3), 916 + GATE_TOP5(CLK_TOP_APLL12_DIV4, "apll12_div4", "apll12_ck_div4", 4), 917 + GATE_TOP5(CLK_TOP_APLL12_DIV4B, "apll12_div4b", "apll12_ck_div4b", 5), 918 + GATE_TOP5(CLK_TOP_APLL12_DIV5, "apll12_div5", "apll12_ck_div5", 6), 919 + GATE_TOP5(CLK_TOP_APLL12_DIV5B, "apll12_div5b", "apll12_ck_div5b", 7), 920 + GATE_TOP5(CLK_TOP_APLL12_DIV6, "apll12_div6", "apll12_ck_div6", 8), 921 + }; 922 + 923 + static void __init mtk_topckgen_init(struct device_node *node) 924 + { 925 + struct clk_onecell_data *clk_data; 926 + int r; 927 + void __iomem *base; 928 + 929 + base = of_iomap(node, 0); 930 + if (!base) { 931 + pr_err("%s(): ioremap failed\n", __func__); 932 + return; 933 + } 934 + 935 + clk_data = mtk_alloc_clk_data(MT8167_CLK_TOP_NR_CLK); 936 + 937 + mtk_clk_register_fixed_clks(fixed_clks, ARRAY_SIZE(fixed_clks), 938 + clk_data); 939 + mtk_clk_register_gates(node, top_clks, ARRAY_SIZE(top_clks), clk_data); 940 + 941 + mtk_clk_register_factors(top_divs, ARRAY_SIZE(top_divs), clk_data); 942 + mtk_clk_register_composites(top_muxes, ARRAY_SIZE(top_muxes), base, 943 + &mt8167_clk_lock, clk_data); 944 + mtk_clk_register_dividers(top_adj_divs, ARRAY_SIZE(top_adj_divs), 945 + base, &mt8167_clk_lock, clk_data); 946 + 947 + r = of_clk_add_provider(node, of_clk_src_onecell_get, clk_data); 948 + if (r) 949 + pr_err("%s(): could not register clock provider: %d\n", 950 + __func__, r); 951 + } 952 + CLK_OF_DECLARE(mtk_topckgen, "mediatek,mt8167-topckgen", mtk_topckgen_init); 953 + 954 + static void __init mtk_infracfg_init(struct device_node *node) 955 + { 956 + struct clk_onecell_data *clk_data; 957 + int r; 958 + void __iomem *base; 959 + 960 + base = of_iomap(node, 0); 961 + if (!base) { 962 + pr_err("%s(): ioremap failed\n", __func__); 963 + return; 964 + } 965 + 966 + clk_data = mtk_alloc_clk_data(CLK_IFR_NR_CLK); 967 + 968 + mtk_clk_register_composites(ifr_muxes, ARRAY_SIZE(ifr_muxes), base, 969 + &mt8167_clk_lock, clk_data); 970 + 971 + r = of_clk_add_provider(node, of_clk_src_onecell_get, clk_data); 972 + if (r) 973 + pr_err("%s(): could not register clock provider: %d\n", 974 + __func__, r); 975 + } 976 + CLK_OF_DECLARE(mtk_infracfg, "mediatek,mt8167-infracfg", mtk_infracfg_init); 977 + 978 + #define MT8167_PLL_FMAX (2500UL * MHZ) 979 + 980 + #define CON0_MT8167_RST_BAR BIT(27) 981 + 982 + #define PLL_B(_id, _name, _reg, _pwr_reg, _en_mask, _flags, _pcwbits, \ 983 + _pd_reg, _pd_shift, _tuner_reg, _pcw_reg, \ 984 + _pcw_shift, _div_table) { \ 985 + .id = _id, \ 986 + .name = _name, \ 987 + .reg = _reg, \ 988 + .pwr_reg = _pwr_reg, \ 989 + .en_mask = _en_mask, \ 990 + .flags = _flags, \ 991 + .rst_bar_mask = CON0_MT8167_RST_BAR, \ 992 + .fmax = MT8167_PLL_FMAX, \ 993 + .pcwbits = _pcwbits, \ 994 + .pd_reg = _pd_reg, \ 995 + .pd_shift = _pd_shift, \ 996 + .tuner_reg = _tuner_reg, \ 997 + .pcw_reg = _pcw_reg, \ 998 + .pcw_shift = _pcw_shift, \ 999 + .div_table = _div_table, \ 1000 + } 1001 + 1002 + #define PLL(_id, _name, _reg, _pwr_reg, _en_mask, _flags, _pcwbits, \ 1003 + _pd_reg, _pd_shift, _tuner_reg, _pcw_reg, \ 1004 + _pcw_shift) \ 1005 + PLL_B(_id, _name, _reg, _pwr_reg, _en_mask, _flags, _pcwbits, \ 1006 + _pd_reg, _pd_shift, _tuner_reg, _pcw_reg, _pcw_shift, \ 1007 + NULL) 1008 + 1009 + static const struct mtk_pll_div_table mmpll_div_table[] = { 1010 + { .div = 0, .freq = MT8167_PLL_FMAX }, 1011 + { .div = 1, .freq = 1000000000 }, 1012 + { .div = 2, .freq = 604500000 }, 1013 + { .div = 3, .freq = 253500000 }, 1014 + { .div = 4, .freq = 126750000 }, 1015 + { } /* sentinel */ 1016 + }; 1017 + 1018 + static const struct mtk_pll_data plls[] = { 1019 + PLL(CLK_APMIXED_ARMPLL, "armpll", 0x0100, 0x0110, 0x00000001, 0, 1020 + 21, 0x0104, 24, 0, 0x0104, 0), 1021 + PLL(CLK_APMIXED_MAINPLL, "mainpll", 0x0120, 0x0130, 0x00000001, 1022 + HAVE_RST_BAR, 21, 0x0124, 24, 0, 0x0124, 0), 1023 + PLL(CLK_APMIXED_UNIVPLL, "univpll", 0x0140, 0x0150, 0x30000001, 1024 + HAVE_RST_BAR, 7, 0x0144, 24, 0, 0x0144, 0), 1025 + PLL_B(CLK_APMIXED_MMPLL, "mmpll", 0x0160, 0x0170, 0x00000001, 0, 1026 + 21, 0x0164, 24, 0, 0x0164, 0, mmpll_div_table), 1027 + PLL(CLK_APMIXED_APLL1, "apll1", 0x0180, 0x0190, 0x00000001, 0, 1028 + 31, 0x0180, 1, 0x0194, 0x0184, 0), 1029 + PLL(CLK_APMIXED_APLL2, "apll2", 0x01A0, 0x01B0, 0x00000001, 0, 1030 + 31, 0x01A0, 1, 0x01B4, 0x01A4, 0), 1031 + PLL(CLK_APMIXED_TVDPLL, "tvdpll", 0x01C0, 0x01D0, 0x00000001, 0, 1032 + 21, 0x01C4, 24, 0, 0x01C4, 0), 1033 + PLL(CLK_APMIXED_LVDSPLL, "lvdspll", 0x01E0, 0x01F0, 0x00000001, 0, 1034 + 21, 0x01E4, 24, 0, 0x01E4, 0), 1035 + }; 1036 + 1037 + static void __init mtk_apmixedsys_init(struct device_node *node) 1038 + { 1039 + struct clk_onecell_data *clk_data; 1040 + void __iomem *base; 1041 + int r; 1042 + 1043 + base = of_iomap(node, 0); 1044 + if (!base) { 1045 + pr_err("%s(): ioremap failed\n", __func__); 1046 + return; 1047 + } 1048 + 1049 + clk_data = mtk_alloc_clk_data(MT8167_CLK_APMIXED_NR_CLK); 1050 + 1051 + mtk_clk_register_plls(node, plls, ARRAY_SIZE(plls), clk_data); 1052 + mtk_clk_register_dividers(apmixed_adj_divs, ARRAY_SIZE(apmixed_adj_divs), 1053 + base, &mt8167_clk_lock, clk_data); 1054 + 1055 + r = of_clk_add_provider(node, of_clk_src_onecell_get, clk_data); 1056 + if (r) 1057 + pr_err("%s(): could not register clock provider: %d\n", 1058 + __func__, r); 1059 + 1060 + } 1061 + CLK_OF_DECLARE(mtk_apmixedsys, "mediatek,mt8167-apmixedsys", 1062 + mtk_apmixedsys_init);
+78
drivers/clk/rockchip/Kconfig
··· 1 + # SPDX-License-Identifier: GPL-2.0 2 + # common clock support for ROCKCHIP SoC family. 3 + 4 + config COMMON_CLK_ROCKCHIP 5 + bool "Rockchip clock controller common support" 6 + depends on ARCH_ROCKCHIP 7 + default ARCH_ROCKCHIP 8 + help 9 + Say y here to enable common clock controller for Rockchip platforms. 10 + 11 + if COMMON_CLK_ROCKCHIP 12 + config CLK_PX30 13 + bool "Rockchip PX30 clock controller support" 14 + default y 15 + help 16 + Build the driver for PX30 Clock Driver. 17 + 18 + config CLK_RV110X 19 + bool "Rockchip RV110x clock controller support" 20 + default y 21 + help 22 + Build the driver for RV110x Clock Driver. 23 + 24 + config CLK_RK3036 25 + bool "Rockchip RK3036 clock controller support" 26 + default y 27 + help 28 + Build the driver for RK3036 Clock Driver. 29 + 30 + config CLK_RK312X 31 + bool "Rockchip RK312x clock controller support" 32 + default y 33 + help 34 + Build the driver for RK312x Clock Driver. 35 + 36 + config CLK_RK3188 37 + bool "Rockchip RK3188 clock controller support" 38 + default y 39 + help 40 + Build the driver for RK3188 Clock Driver. 41 + 42 + config CLK_RK322X 43 + bool "Rockchip RK322x clock controller support" 44 + default y 45 + help 46 + Build the driver for RK322x Clock Driver. 47 + 48 + config CLK_RK3288 49 + bool "Rockchip RK3288 clock controller support" 50 + depends on ARM 51 + default y 52 + help 53 + Build the driver for RK3288 Clock Driver. 54 + 55 + config CLK_RK3308 56 + bool "Rockchip RK3308 clock controller support" 57 + default y 58 + help 59 + Build the driver for RK3308 Clock Driver. 60 + 61 + config CLK_RK3328 62 + bool "Rockchip RK3328 clock controller support" 63 + default y 64 + help 65 + Build the driver for RK3328 Clock Driver. 66 + 67 + config CLK_RK3368 68 + bool "Rockchip RK3368 clock controller support" 69 + default y 70 + help 71 + Build the driver for RK3368 Clock Driver. 72 + 73 + config CLK_RK3399 74 + tristate "Rockchip RK3399 clock controller support" 75 + default y 76 + help 77 + Build the driver for RK3399 Clock Driver. 78 + endif
+22 -20
drivers/clk/rockchip/Makefile
··· 3 3 # Rockchip Clock specific Makefile 4 4 # 5 5 6 - obj-y += clk.o 7 - obj-y += clk-pll.o 8 - obj-y += clk-cpu.o 9 - obj-y += clk-half-divider.o 10 - obj-y += clk-inverter.o 11 - obj-y += clk-mmc-phase.o 12 - obj-y += clk-muxgrf.o 13 - obj-y += clk-ddr.o 14 - obj-$(CONFIG_RESET_CONTROLLER) += softrst.o 6 + obj-$(CONFIG_COMMON_CLK_ROCKCHIP) += clk-rockchip.o 15 7 16 - obj-y += clk-px30.o 17 - obj-y += clk-rv1108.o 18 - obj-y += clk-rk3036.o 19 - obj-y += clk-rk3128.o 20 - obj-y += clk-rk3188.o 21 - obj-y += clk-rk3228.o 22 - obj-y += clk-rk3288.o 23 - obj-y += clk-rk3308.o 24 - obj-y += clk-rk3328.o 25 - obj-y += clk-rk3368.o 26 - obj-y += clk-rk3399.o 8 + clk-rockchip-y += clk.o 9 + clk-rockchip-y += clk-pll.o 10 + clk-rockchip-y += clk-cpu.o 11 + clk-rockchip-y += clk-half-divider.o 12 + clk-rockchip-y += clk-inverter.o 13 + clk-rockchip-y += clk-mmc-phase.o 14 + clk-rockchip-y += clk-muxgrf.o 15 + clk-rockchip-y += clk-ddr.o 16 + clk-rockchip-$(CONFIG_RESET_CONTROLLER) += softrst.o 17 + 18 + obj-$(CONFIG_CLK_PX30) += clk-px30.o 19 + obj-$(CONFIG_CLK_RV110X) += clk-rv1108.o 20 + obj-$(CONFIG_CLK_RK3036) += clk-rk3036.o 21 + obj-$(CONFIG_CLK_RK312X) += clk-rk3128.o 22 + obj-$(CONFIG_CLK_RK3188) += clk-rk3188.o 23 + obj-$(CONFIG_CLK_RK322X) += clk-rk3228.o 24 + obj-$(CONFIG_CLK_RK3288) += clk-rk3288.o 25 + obj-$(CONFIG_CLK_RK3308) += clk-rk3308.o 26 + obj-$(CONFIG_CLK_RK3328) += clk-rk3328.o 27 + obj-$(CONFIG_CLK_RK3368) += clk-rk3368.o 28 + obj-$(CONFIG_CLK_RK3399) += clk-rk3399.o
+1
drivers/clk/rockchip/clk-ddr.c
··· 136 136 137 137 return clk; 138 138 } 139 + EXPORT_SYMBOL_GPL(rockchip_clk_register_ddrclk);
+10 -8
drivers/clk/rockchip/clk-half-divider.c
··· 166 166 unsigned long flags, 167 167 spinlock_t *lock) 168 168 { 169 - struct clk *clk; 169 + struct clk_hw *hw = ERR_PTR(-ENOMEM); 170 170 struct clk_mux *mux = NULL; 171 171 struct clk_gate *gate = NULL; 172 172 struct clk_divider *div = NULL; ··· 212 212 div_ops = &clk_half_divider_ops; 213 213 } 214 214 215 - clk = clk_register_composite(NULL, name, parent_names, num_parents, 216 - mux ? &mux->hw : NULL, mux_ops, 217 - div ? &div->hw : NULL, div_ops, 218 - gate ? &gate->hw : NULL, gate_ops, 219 - flags); 215 + hw = clk_hw_register_composite(NULL, name, parent_names, num_parents, 216 + mux ? &mux->hw : NULL, mux_ops, 217 + div ? &div->hw : NULL, div_ops, 218 + gate ? &gate->hw : NULL, gate_ops, 219 + flags); 220 + if (IS_ERR(hw)) 221 + goto err_div; 220 222 221 - return clk; 223 + return hw->clk; 222 224 err_div: 223 225 kfree(gate); 224 226 err_gate: 225 227 kfree(mux); 226 - return ERR_PTR(-ENOMEM); 228 + return ERR_CAST(hw); 227 229 }
-1
drivers/clk/rockchip/clk-rk3308.c
··· 133 133 PNAME(mux_uart2_p) = { "clk_uart2_src", "dummy", "clk_uart2_frac" }; 134 134 PNAME(mux_uart3_p) = { "clk_uart3_src", "dummy", "clk_uart3_frac" }; 135 135 PNAME(mux_uart4_p) = { "clk_uart4_src", "dummy", "clk_uart4_frac" }; 136 - PNAME(mux_timer_src_p) = { "xin24m", "clk_rtc32k" }; 137 136 PNAME(mux_dclk_vop_p) = { "dclk_vop_src", "dclk_vop_frac", "xin24m" }; 138 137 PNAME(mux_nandc_p) = { "clk_nandc_div", "clk_nandc_div50" }; 139 138 PNAME(mux_sdmmc_p) = { "clk_sdmmc_div", "clk_sdmmc_div50" };
+56
drivers/clk/rockchip/clk-rk3399.c
··· 5 5 */ 6 6 7 7 #include <linux/clk-provider.h> 8 + #include <linux/module.h> 8 9 #include <linux/io.h> 9 10 #include <linux/of.h> 10 11 #include <linux/of_address.h> 12 + #include <linux/of_device.h> 11 13 #include <linux/platform_device.h> 12 14 #include <linux/regmap.h> 13 15 #include <dt-bindings/clock/rk3399-cru.h> ··· 1602 1600 rockchip_clk_of_add_provider(np, ctx); 1603 1601 } 1604 1602 CLK_OF_DECLARE(rk3399_cru_pmu, "rockchip,rk3399-pmucru", rk3399_pmu_clk_init); 1603 + 1604 + struct clk_rk3399_inits { 1605 + void (*inits)(struct device_node *np); 1606 + }; 1607 + 1608 + static const struct clk_rk3399_inits clk_rk3399_pmucru_init = { 1609 + .inits = rk3399_pmu_clk_init, 1610 + }; 1611 + 1612 + static const struct clk_rk3399_inits clk_rk3399_cru_init = { 1613 + .inits = rk3399_clk_init, 1614 + }; 1615 + 1616 + static const struct of_device_id clk_rk3399_match_table[] = { 1617 + { 1618 + .compatible = "rockchip,rk3399-cru", 1619 + .data = &clk_rk3399_cru_init, 1620 + }, { 1621 + .compatible = "rockchip,rk3399-pmucru", 1622 + .data = &clk_rk3399_pmucru_init, 1623 + }, 1624 + { } 1625 + }; 1626 + MODULE_DEVICE_TABLE(of, clk_rk3399_match_table); 1627 + 1628 + static int __init clk_rk3399_probe(struct platform_device *pdev) 1629 + { 1630 + struct device_node *np = pdev->dev.of_node; 1631 + const struct of_device_id *match; 1632 + const struct clk_rk3399_inits *init_data; 1633 + 1634 + match = of_match_device(clk_rk3399_match_table, &pdev->dev); 1635 + if (!match || !match->data) 1636 + return -EINVAL; 1637 + 1638 + init_data = match->data; 1639 + if (init_data->inits) 1640 + init_data->inits(np); 1641 + 1642 + return 0; 1643 + } 1644 + 1645 + static struct platform_driver clk_rk3399_driver = { 1646 + .driver = { 1647 + .name = "clk-rk3399", 1648 + .of_match_table = clk_rk3399_match_table, 1649 + .suppress_bind_attrs = true, 1650 + }, 1651 + }; 1652 + builtin_platform_driver_probe(clk_rk3399_driver, clk_rk3399_probe); 1653 + 1654 + MODULE_DESCRIPTION("Rockchip RK3399 Clock Driver"); 1655 + MODULE_LICENSE("GPL"); 1656 + MODULE_ALIAS("platform:clk-rk3399");
+59 -52
drivers/clk/rockchip/clk.c
··· 43 43 u8 gate_shift, u8 gate_flags, unsigned long flags, 44 44 spinlock_t *lock) 45 45 { 46 - struct clk *clk; 46 + struct clk_hw *hw; 47 47 struct clk_mux *mux = NULL; 48 48 struct clk_gate *gate = NULL; 49 49 struct clk_divider *div = NULL; ··· 100 100 : &clk_divider_ops; 101 101 } 102 102 103 - clk = clk_register_composite(NULL, name, parent_names, num_parents, 104 - mux ? &mux->hw : NULL, mux_ops, 105 - div ? &div->hw : NULL, div_ops, 106 - gate ? &gate->hw : NULL, gate_ops, 107 - flags); 108 - 109 - if (IS_ERR(clk)) { 110 - ret = PTR_ERR(clk); 111 - goto err_composite; 103 + hw = clk_hw_register_composite(NULL, name, parent_names, num_parents, 104 + mux ? &mux->hw : NULL, mux_ops, 105 + div ? &div->hw : NULL, div_ops, 106 + gate ? &gate->hw : NULL, gate_ops, 107 + flags); 108 + if (IS_ERR(hw)) { 109 + kfree(div); 110 + kfree(gate); 111 + return ERR_CAST(hw); 112 112 } 113 113 114 - return clk; 115 - err_composite: 116 - kfree(div); 114 + return hw->clk; 117 115 err_div: 118 116 kfree(gate); 119 117 err_gate: ··· 212 214 unsigned long flags, struct rockchip_clk_branch *child, 213 215 spinlock_t *lock) 214 216 { 217 + struct clk_hw *hw; 215 218 struct rockchip_clk_frac *frac; 216 - struct clk *clk; 217 219 struct clk_gate *gate = NULL; 218 220 struct clk_fractional_divider *div = NULL; 219 221 const struct clk_ops *div_ops = NULL, *gate_ops = NULL; ··· 253 255 div->approximation = rockchip_fractional_approximation; 254 256 div_ops = &clk_fractional_divider_ops; 255 257 256 - clk = clk_register_composite(NULL, name, parent_names, num_parents, 257 - NULL, NULL, 258 - &div->hw, div_ops, 259 - gate ? &gate->hw : NULL, gate_ops, 260 - flags | CLK_SET_RATE_UNGATE); 261 - if (IS_ERR(clk)) { 258 + hw = clk_hw_register_composite(NULL, name, parent_names, num_parents, 259 + NULL, NULL, 260 + &div->hw, div_ops, 261 + gate ? &gate->hw : NULL, gate_ops, 262 + flags | CLK_SET_RATE_UNGATE); 263 + if (IS_ERR(hw)) { 262 264 kfree(frac); 263 - return clk; 265 + return ERR_CAST(hw); 264 266 } 265 267 266 268 if (child) { ··· 290 292 mux_clk = clk_register(NULL, &frac_mux->hw); 291 293 if (IS_ERR(mux_clk)) { 292 294 kfree(frac); 293 - return clk; 295 + return mux_clk; 294 296 } 295 297 296 298 rockchip_clk_add_lookup(ctx, mux_clk, child->id); ··· 299 301 if (frac->mux_frac_idx >= 0) { 300 302 pr_debug("%s: found fractional parent in mux at pos %d\n", 301 303 __func__, frac->mux_frac_idx); 302 - ret = clk_notifier_register(clk, &frac->clk_nb); 304 + ret = clk_notifier_register(hw->clk, &frac->clk_nb); 303 305 if (ret) 304 306 pr_err("%s: failed to register clock notifier for %s\n", 305 307 __func__, name); ··· 309 311 } 310 312 } 311 313 312 - return clk; 314 + return hw->clk; 313 315 } 314 316 315 317 static struct clk *rockchip_clk_register_factor_branch(const char *name, ··· 318 320 int gate_offset, u8 gate_shift, u8 gate_flags, 319 321 unsigned long flags, spinlock_t *lock) 320 322 { 321 - struct clk *clk; 323 + struct clk_hw *hw; 322 324 struct clk_gate *gate = NULL; 323 325 struct clk_fixed_factor *fix = NULL; 324 326 ··· 347 349 fix->mult = mult; 348 350 fix->div = div; 349 351 350 - clk = clk_register_composite(NULL, name, parent_names, num_parents, 351 - NULL, NULL, 352 - &fix->hw, &clk_fixed_factor_ops, 353 - &gate->hw, &clk_gate_ops, flags); 354 - if (IS_ERR(clk)) { 352 + hw = clk_hw_register_composite(NULL, name, parent_names, num_parents, 353 + NULL, NULL, 354 + &fix->hw, &clk_fixed_factor_ops, 355 + &gate->hw, &clk_gate_ops, flags); 356 + if (IS_ERR(hw)) { 355 357 kfree(fix); 356 358 kfree(gate); 359 + return ERR_CAST(hw); 357 360 } 358 361 359 - return clk; 362 + return hw->clk; 360 363 } 361 364 362 - struct rockchip_clk_provider * __init rockchip_clk_init(struct device_node *np, 363 - void __iomem *base, unsigned long nr_clks) 365 + struct rockchip_clk_provider *rockchip_clk_init(struct device_node *np, 366 + void __iomem *base, 367 + unsigned long nr_clks) 364 368 { 365 369 struct rockchip_clk_provider *ctx; 366 370 struct clk **clk_table; ··· 394 394 kfree(ctx); 395 395 return ERR_PTR(-ENOMEM); 396 396 } 397 + EXPORT_SYMBOL_GPL(rockchip_clk_init); 397 398 398 - void __init rockchip_clk_of_add_provider(struct device_node *np, 399 - struct rockchip_clk_provider *ctx) 399 + void rockchip_clk_of_add_provider(struct device_node *np, 400 + struct rockchip_clk_provider *ctx) 400 401 { 401 402 if (of_clk_add_provider(np, of_clk_src_onecell_get, 402 403 &ctx->clk_data)) 403 404 pr_err("%s: could not register clk provider\n", __func__); 404 405 } 406 + EXPORT_SYMBOL_GPL(rockchip_clk_of_add_provider); 405 407 406 408 void rockchip_clk_add_lookup(struct rockchip_clk_provider *ctx, 407 409 struct clk *clk, unsigned int id) ··· 411 409 if (ctx->clk_data.clks && id) 412 410 ctx->clk_data.clks[id] = clk; 413 411 } 412 + EXPORT_SYMBOL_GPL(rockchip_clk_add_lookup); 414 413 415 - void __init rockchip_clk_register_plls(struct rockchip_clk_provider *ctx, 414 + void rockchip_clk_register_plls(struct rockchip_clk_provider *ctx, 416 415 struct rockchip_pll_clock *list, 417 416 unsigned int nr_pll, int grf_lock_offset) 418 417 { ··· 436 433 rockchip_clk_add_lookup(ctx, clk, list->id); 437 434 } 438 435 } 436 + EXPORT_SYMBOL_GPL(rockchip_clk_register_plls); 439 437 440 - void __init rockchip_clk_register_branches( 441 - struct rockchip_clk_provider *ctx, 442 - struct rockchip_clk_branch *list, 443 - unsigned int nr_clk) 438 + void rockchip_clk_register_branches(struct rockchip_clk_provider *ctx, 439 + struct rockchip_clk_branch *list, 440 + unsigned int nr_clk) 444 441 { 445 442 struct clk *clk = NULL; 446 443 unsigned int idx; ··· 569 566 rockchip_clk_add_lookup(ctx, clk, list->id); 570 567 } 571 568 } 569 + EXPORT_SYMBOL_GPL(rockchip_clk_register_branches); 572 570 573 - void __init rockchip_clk_register_armclk(struct rockchip_clk_provider *ctx, 574 - unsigned int lookup_id, 575 - const char *name, const char *const *parent_names, 576 - u8 num_parents, 577 - const struct rockchip_cpuclk_reg_data *reg_data, 578 - const struct rockchip_cpuclk_rate_table *rates, 579 - int nrates) 571 + void rockchip_clk_register_armclk(struct rockchip_clk_provider *ctx, 572 + unsigned int lookup_id, 573 + const char *name, const char *const *parent_names, 574 + u8 num_parents, 575 + const struct rockchip_cpuclk_reg_data *reg_data, 576 + const struct rockchip_cpuclk_rate_table *rates, 577 + int nrates) 580 578 { 581 579 struct clk *clk; 582 580 ··· 592 588 593 589 rockchip_clk_add_lookup(ctx, clk, lookup_id); 594 590 } 591 + EXPORT_SYMBOL_GPL(rockchip_clk_register_armclk); 595 592 596 - void __init rockchip_clk_protect_critical(const char *const clocks[], 597 - int nclocks) 593 + void rockchip_clk_protect_critical(const char *const clocks[], 594 + int nclocks) 598 595 { 599 596 int i; 600 597 ··· 607 602 clk_prepare_enable(clk); 608 603 } 609 604 } 605 + EXPORT_SYMBOL_GPL(rockchip_clk_protect_critical); 610 606 611 607 static void __iomem *rst_base; 612 608 static unsigned int reg_restart; ··· 627 621 .priority = 128, 628 622 }; 629 623 630 - void __init 624 + void 631 625 rockchip_register_restart_notifier(struct rockchip_clk_provider *ctx, 632 - unsigned int reg, 633 - void (*cb)(void)) 626 + unsigned int reg, 627 + void (*cb)(void)) 634 628 { 635 629 int ret; 636 630 ··· 642 636 pr_err("%s: cannot register restart handler, %d\n", 643 637 __func__, ret); 644 638 } 639 + EXPORT_SYMBOL_GPL(rockchip_register_restart_notifier);
+4 -3
drivers/clk/rockchip/softrst.c
··· 77 77 .deassert = rockchip_softrst_deassert, 78 78 }; 79 79 80 - void __init rockchip_register_softrst(struct device_node *np, 81 - unsigned int num_regs, 82 - void __iomem *base, u8 flags) 80 + void rockchip_register_softrst(struct device_node *np, 81 + unsigned int num_regs, 82 + void __iomem *base, u8 flags) 83 83 { 84 84 struct rockchip_softrst *softrst; 85 85 int ret; ··· 107 107 kfree(softrst); 108 108 } 109 109 }; 110 + EXPORT_SYMBOL_GPL(rockchip_register_softrst);
+1 -1
drivers/clk/tegra/clk-tegra210-emc.c
··· 126 126 unsigned int i; 127 127 int err; 128 128 129 - if (!provider || !provider->configs || provider->num_configs == 0) 129 + if (!provider->configs || provider->num_configs == 0) 130 130 return -EINVAL; 131 131 132 132 for (i = 0; i < provider->num_configs; i++) {
+12 -2
drivers/clk/ti/autoidle.c
··· 82 82 */ 83 83 int omap2_clk_deny_idle(struct clk *clk) 84 84 { 85 - struct clk_hw *hw = __clk_get_hw(clk); 85 + struct clk_hw *hw; 86 + 87 + if (!clk) 88 + return -EINVAL; 89 + 90 + hw = __clk_get_hw(clk); 86 91 87 92 if (omap2_clk_is_hw_omap(hw)) { 88 93 struct clk_hw_omap *c = to_clk_hw_omap(hw); ··· 106 101 */ 107 102 int omap2_clk_allow_idle(struct clk *clk) 108 103 { 109 - struct clk_hw *hw = __clk_get_hw(clk); 104 + struct clk_hw *hw; 105 + 106 + if (!clk) 107 + return -EINVAL; 108 + 109 + hw = __clk_get_hw(clk); 110 110 111 111 if (omap2_clk_is_hw_omap(hw)) { 112 112 struct clk_hw_omap *c = to_clk_hw_omap(hw);
+1
drivers/clk/ti/clk-7xx.c
··· 637 637 { DRA7_L4SEC_DES_CLKCTRL, NULL, CLKF_HW_SUP, "l3_iclk_div" }, 638 638 { DRA7_L4SEC_RNG_CLKCTRL, NULL, CLKF_HW_SUP | CLKF_SOC_NONSEC, "l4_root_clk_div" }, 639 639 { DRA7_L4SEC_SHAM_CLKCTRL, NULL, CLKF_HW_SUP, "l3_iclk_div" }, 640 + { DRA7_L4SEC_SHAM2_CLKCTRL, NULL, CLKF_HW_SUP, "l3_iclk_div" }, 640 641 { 0 }, 641 642 }; 642 643
+2
drivers/clk/ti/clockdomain.c
··· 148 148 if (!omap2_clk_is_hw_omap(clk_hw)) { 149 149 pr_warn("can't setup clkdm for basic clk %s\n", 150 150 __clk_get_name(clk)); 151 + clk_put(clk); 151 152 continue; 152 153 } 153 154 to_clk_hw_omap(clk_hw)->clkdm_name = clkdm_name; 154 155 omap2_init_clk_clkdm(clk_hw); 156 + clk_put(clk); 155 157 } 156 158 } 157 159
+1
include/dt-bindings/clock/dra7.h
··· 332 332 #define DRA7_L4SEC_DES_CLKCTRL DRA7_L4SEC_CLKCTRL_INDEX(0x1b0) 333 333 #define DRA7_L4SEC_RNG_CLKCTRL DRA7_L4SEC_CLKCTRL_INDEX(0x1c0) 334 334 #define DRA7_L4SEC_SHAM_CLKCTRL DRA7_L4SEC_CLKCTRL_INDEX(0x1c8) 335 + #define DRA7_L4SEC_SHAM2_CLKCTRL DRA7_L4SEC_CLKCTRL_INDEX(0x1f8) 335 336 336 337 /* l4per2 clocks */ 337 338 #define DRA7_L4PER2_CLKCTRL_OFFSET 0xc
+131
include/dt-bindings/clock/mt8167-clk.h
··· 1 + /* SPDX-License-Identifier: GPL-2.0 */ 2 + /* 3 + * Copyright (c) 2020 MediaTek Inc. 4 + * Copyright (c) 2020 BayLibre, SAS. 5 + * Author: James Liao <jamesjj.liao@mediatek.com> 6 + * Fabien Parent <fparent@baylibre.com> 7 + */ 8 + 9 + #ifndef _DT_BINDINGS_CLK_MT8167_H 10 + #define _DT_BINDINGS_CLK_MT8167_H 11 + 12 + /* MT8167 is based on MT8516 */ 13 + #include <dt-bindings/clock/mt8516-clk.h> 14 + 15 + /* APMIXEDSYS */ 16 + 17 + #define CLK_APMIXED_TVDPLL (CLK_APMIXED_NR_CLK + 0) 18 + #define CLK_APMIXED_LVDSPLL (CLK_APMIXED_NR_CLK + 1) 19 + #define CLK_APMIXED_HDMI_REF (CLK_APMIXED_NR_CLK + 2) 20 + #define MT8167_CLK_APMIXED_NR_CLK (CLK_APMIXED_NR_CLK + 3) 21 + 22 + /* TOPCKGEN */ 23 + 24 + #define CLK_TOP_DSI0_LNTC_DSICK (CLK_TOP_NR_CLK + 0) 25 + #define CLK_TOP_VPLL_DPIX (CLK_TOP_NR_CLK + 1) 26 + #define CLK_TOP_LVDSTX_CLKDIG_CTS (CLK_TOP_NR_CLK + 2) 27 + #define CLK_TOP_HDMTX_CLKDIG_CTS (CLK_TOP_NR_CLK + 3) 28 + #define CLK_TOP_LVDSPLL (CLK_TOP_NR_CLK + 4) 29 + #define CLK_TOP_LVDSPLL_D2 (CLK_TOP_NR_CLK + 5) 30 + #define CLK_TOP_LVDSPLL_D4 (CLK_TOP_NR_CLK + 6) 31 + #define CLK_TOP_LVDSPLL_D8 (CLK_TOP_NR_CLK + 7) 32 + #define CLK_TOP_MIPI_26M (CLK_TOP_NR_CLK + 8) 33 + #define CLK_TOP_TVDPLL (CLK_TOP_NR_CLK + 9) 34 + #define CLK_TOP_TVDPLL_D2 (CLK_TOP_NR_CLK + 10) 35 + #define CLK_TOP_TVDPLL_D4 (CLK_TOP_NR_CLK + 11) 36 + #define CLK_TOP_TVDPLL_D8 (CLK_TOP_NR_CLK + 12) 37 + #define CLK_TOP_TVDPLL_D16 (CLK_TOP_NR_CLK + 13) 38 + #define CLK_TOP_PWM_MM (CLK_TOP_NR_CLK + 14) 39 + #define CLK_TOP_CAM_MM (CLK_TOP_NR_CLK + 15) 40 + #define CLK_TOP_MFG_MM (CLK_TOP_NR_CLK + 16) 41 + #define CLK_TOP_SPM_52M (CLK_TOP_NR_CLK + 17) 42 + #define CLK_TOP_MIPI_26M_DBG (CLK_TOP_NR_CLK + 18) 43 + #define CLK_TOP_SCAM_MM (CLK_TOP_NR_CLK + 19) 44 + #define CLK_TOP_SMI_MM (CLK_TOP_NR_CLK + 20) 45 + #define CLK_TOP_26M_HDMI_SIFM (CLK_TOP_NR_CLK + 21) 46 + #define CLK_TOP_26M_CEC (CLK_TOP_NR_CLK + 22) 47 + #define CLK_TOP_32K_CEC (CLK_TOP_NR_CLK + 23) 48 + #define CLK_TOP_GCPU_B (CLK_TOP_NR_CLK + 24) 49 + #define CLK_TOP_RG_VDEC (CLK_TOP_NR_CLK + 25) 50 + #define CLK_TOP_RG_FDPI0 (CLK_TOP_NR_CLK + 26) 51 + #define CLK_TOP_RG_FDPI1 (CLK_TOP_NR_CLK + 27) 52 + #define CLK_TOP_RG_AXI_MFG (CLK_TOP_NR_CLK + 28) 53 + #define CLK_TOP_RG_SLOW_MFG (CLK_TOP_NR_CLK + 29) 54 + #define CLK_TOP_GFMUX_EMI1X_SEL (CLK_TOP_NR_CLK + 30) 55 + #define CLK_TOP_CSW_MUX_MFG_SEL (CLK_TOP_NR_CLK + 31) 56 + #define CLK_TOP_CAMTG_MM_SEL (CLK_TOP_NR_CLK + 32) 57 + #define CLK_TOP_PWM_MM_SEL (CLK_TOP_NR_CLK + 33) 58 + #define CLK_TOP_SPM_52M_SEL (CLK_TOP_NR_CLK + 34) 59 + #define CLK_TOP_MFG_MM_SEL (CLK_TOP_NR_CLK + 35) 60 + #define CLK_TOP_SMI_MM_SEL (CLK_TOP_NR_CLK + 36) 61 + #define CLK_TOP_SCAM_MM_SEL (CLK_TOP_NR_CLK + 37) 62 + #define CLK_TOP_VDEC_MM_SEL (CLK_TOP_NR_CLK + 38) 63 + #define CLK_TOP_DPI0_MM_SEL (CLK_TOP_NR_CLK + 39) 64 + #define CLK_TOP_DPI1_MM_SEL (CLK_TOP_NR_CLK + 40) 65 + #define CLK_TOP_AXI_MFG_IN_SEL (CLK_TOP_NR_CLK + 41) 66 + #define CLK_TOP_SLOW_MFG_SEL (CLK_TOP_NR_CLK + 42) 67 + #define MT8167_CLK_TOP_NR_CLK (CLK_TOP_NR_CLK + 43) 68 + 69 + /* MFGCFG */ 70 + 71 + #define CLK_MFG_BAXI 0 72 + #define CLK_MFG_BMEM 1 73 + #define CLK_MFG_BG3D 2 74 + #define CLK_MFG_B26M 3 75 + #define CLK_MFG_NR_CLK 4 76 + 77 + /* MMSYS */ 78 + 79 + #define CLK_MM_SMI_COMMON 0 80 + #define CLK_MM_SMI_LARB0 1 81 + #define CLK_MM_CAM_MDP 2 82 + #define CLK_MM_MDP_RDMA 3 83 + #define CLK_MM_MDP_RSZ0 4 84 + #define CLK_MM_MDP_RSZ1 5 85 + #define CLK_MM_MDP_TDSHP 6 86 + #define CLK_MM_MDP_WDMA 7 87 + #define CLK_MM_MDP_WROT 8 88 + #define CLK_MM_FAKE_ENG 9 89 + #define CLK_MM_DISP_OVL0 10 90 + #define CLK_MM_DISP_RDMA0 11 91 + #define CLK_MM_DISP_RDMA1 12 92 + #define CLK_MM_DISP_WDMA 13 93 + #define CLK_MM_DISP_COLOR 14 94 + #define CLK_MM_DISP_CCORR 15 95 + #define CLK_MM_DISP_AAL 16 96 + #define CLK_MM_DISP_GAMMA 17 97 + #define CLK_MM_DISP_DITHER 18 98 + #define CLK_MM_DISP_UFOE 19 99 + #define CLK_MM_DISP_PWM_MM 20 100 + #define CLK_MM_DISP_PWM_26M 21 101 + #define CLK_MM_DSI_ENGINE 22 102 + #define CLK_MM_DSI_DIGITAL 23 103 + #define CLK_MM_DPI0_ENGINE 24 104 + #define CLK_MM_DPI0_PXL 25 105 + #define CLK_MM_LVDS_PXL 26 106 + #define CLK_MM_LVDS_CTS 27 107 + #define CLK_MM_DPI1_ENGINE 28 108 + #define CLK_MM_DPI1_PXL 29 109 + #define CLK_MM_HDMI_PXL 30 110 + #define CLK_MM_HDMI_SPDIF 31 111 + #define CLK_MM_HDMI_ADSP_BCK 32 112 + #define CLK_MM_HDMI_PLL 33 113 + #define CLK_MM_NR_CLK 34 114 + 115 + /* IMGSYS */ 116 + 117 + #define CLK_IMG_LARB1_SMI 0 118 + #define CLK_IMG_CAM_SMI 1 119 + #define CLK_IMG_CAM_CAM 2 120 + #define CLK_IMG_SEN_TG 3 121 + #define CLK_IMG_SEN_CAM 4 122 + #define CLK_IMG_VENC 5 123 + #define CLK_IMG_NR_CLK 6 124 + 125 + /* VDECSYS */ 126 + 127 + #define CLK_VDEC_CKEN 0 128 + #define CLK_VDEC_LARB1_CKEN 1 129 + #define CLK_VDEC_NR_CLK 2 130 + 131 + #endif /* _DT_BINDINGS_CLK_MT8167_H */