Lines Matching +full:exynos5433 +full:- +full:cmu +full:- +full:isp

1 // SPDX-License-Identifier: GPL-2.0-only
6 * Common Clock Framework support for Exynos5433 SoC.
10 #include <linux/clk-provider.h>
18 #include <dt-bindings/clock/exynos5433.h>
21 #include "clk-cpu.h"
22 #include "clk-pll.h"
183 /* ISP PLL has to be enabled for suspend: reset value + ENABLE bit */
185 /* ISP PLL has to be enabled for suspend: reset value + ENABLE bit */
769 PLL_36XX_RATE(24 * MHZ, 393216003U, 197, 3, 2, -25690),
771 PLL_36XX_RATE(24 * MHZ, 368639991U, 246, 4, 2, -15729),
772 PLL_36XX_RATE(24 * MHZ, 361507202U, 181, 3, 2, -16148),
773 PLL_36XX_RATE(24 * MHZ, 338687988U, 113, 2, 2, -6816),
777 PLL_36XX_RATE(24 * MHZ, 196608001U, 197, 3, 3, -25690),
812 CLK_OF_DECLARE(exynos5433_cmu_top, "samsung,exynos5433-cmu-top",
891 CLK_OF_DECLARE(exynos5433_cmu_cpif, "samsung,exynos5433-cmu-cpif",
1543 CLK_OF_DECLARE(exynos5433_cmu_mif, "samsung,exynos5433-cmu-mif",
1571 /* pclk: sci, pmu, sysreg, gpio_{finger, ese, touch, nfc}, uart2-0 */
1573 /* sclk: uart2-0 */
1745 CLK_OF_DECLARE(exynos5433_cmu_peric, "samsung,exynos5433-cmu-peric",
1937 CLK_OF_DECLARE(exynos5433_cmu_peris, "samsung,exynos5433-cmu-peris",
2739 GATE(CLK_ACLK_BTS_DECON_TV_M0, "aclk-bts_decon_tv_m0",
3220 "samsung,exynos5433-cmu-bus"#id, \
3705 CLK_OF_DECLARE(exynos5433_cmu_apollo, "samsung,exynos5433-cmu-apollo",
3950 CLK_OF_DECLARE(exynos5433_cmu_atlas, "samsung,exynos5433-cmu-atlas",
4697 "mout_aclk-cam0_400_user", };
5326 GATE(CLK_ACLK_AHBDN_ISP5P, "aclk_aclk-shbdn_isp5p",
5500 samsung_clk_save(data->ctx.reg_base, data->clk_save, in exynos5433_cmu_suspend()
5501 data->nr_clk_save); in exynos5433_cmu_suspend()
5503 for (i = 0; i < data->nr_pclks; i++) in exynos5433_cmu_suspend()
5504 clk_prepare_enable(data->pclks[i]); in exynos5433_cmu_suspend()
5507 samsung_clk_restore(data->ctx.reg_base, data->clk_suspend, in exynos5433_cmu_suspend()
5508 data->nr_clk_suspend); in exynos5433_cmu_suspend()
5510 for (i = 0; i < data->nr_pclks; i++) in exynos5433_cmu_suspend()
5511 clk_disable_unprepare(data->pclks[i]); in exynos5433_cmu_suspend()
5513 clk_disable_unprepare(data->clk); in exynos5433_cmu_suspend()
5523 clk_prepare_enable(data->clk); in exynos5433_cmu_resume()
5525 for (i = 0; i < data->nr_pclks; i++) in exynos5433_cmu_resume()
5526 clk_prepare_enable(data->pclks[i]); in exynos5433_cmu_resume()
5528 samsung_clk_restore(data->ctx.reg_base, data->clk_save, in exynos5433_cmu_resume()
5529 data->nr_clk_save); in exynos5433_cmu_resume()
5531 for (i = 0; i < data->nr_pclks; i++) in exynos5433_cmu_resume()
5532 clk_disable_unprepare(data->pclks[i]); in exynos5433_cmu_resume()
5542 struct device *dev = &pdev->dev; in exynos5433_cmu_probe()
5549 struct_size(data, ctx.clk_data.hws, info->nr_clk_ids), in exynos5433_cmu_probe()
5552 return -ENOMEM; in exynos5433_cmu_probe()
5553 ctx = &data->ctx; in exynos5433_cmu_probe()
5559 for (i = 0; i < info->nr_clk_ids; ++i) in exynos5433_cmu_probe()
5560 ctx->clk_data.hws[i] = ERR_PTR(-ENOENT); in exynos5433_cmu_probe()
5562 ctx->clk_data.num = info->nr_clk_ids; in exynos5433_cmu_probe()
5563 ctx->reg_base = reg_base; in exynos5433_cmu_probe()
5564 ctx->dev = dev; in exynos5433_cmu_probe()
5565 spin_lock_init(&ctx->lock); in exynos5433_cmu_probe()
5567 data->clk_save = samsung_clk_alloc_reg_dump(info->clk_regs, in exynos5433_cmu_probe()
5568 info->nr_clk_regs); in exynos5433_cmu_probe()
5569 if (!data->clk_save) in exynos5433_cmu_probe()
5570 return -ENOMEM; in exynos5433_cmu_probe()
5571 data->nr_clk_save = info->nr_clk_regs; in exynos5433_cmu_probe()
5572 data->clk_suspend = info->suspend_regs; in exynos5433_cmu_probe()
5573 data->nr_clk_suspend = info->nr_suspend_regs; in exynos5433_cmu_probe()
5574 data->nr_pclks = of_clk_get_parent_count(dev->of_node); in exynos5433_cmu_probe()
5576 if (data->nr_pclks > 0) { in exynos5433_cmu_probe()
5577 data->pclks = devm_kcalloc(dev, sizeof(struct clk *), in exynos5433_cmu_probe()
5578 data->nr_pclks, GFP_KERNEL); in exynos5433_cmu_probe()
5579 if (!data->pclks) { in exynos5433_cmu_probe()
5580 kfree(data->clk_save); in exynos5433_cmu_probe()
5581 return -ENOMEM; in exynos5433_cmu_probe()
5583 for (i = 0; i < data->nr_pclks; i++) { in exynos5433_cmu_probe()
5584 struct clk *clk = of_clk_get(dev->of_node, i); in exynos5433_cmu_probe()
5587 kfree(data->clk_save); in exynos5433_cmu_probe()
5588 while (--i >= 0) in exynos5433_cmu_probe()
5589 clk_put(data->pclks[i]); in exynos5433_cmu_probe()
5592 data->pclks[i] = clk; in exynos5433_cmu_probe()
5596 if (info->clk_name) in exynos5433_cmu_probe()
5597 data->clk = clk_get(dev, info->clk_name); in exynos5433_cmu_probe()
5598 clk_prepare_enable(data->clk); in exynos5433_cmu_probe()
5612 if (info->pll_clks) in exynos5433_cmu_probe()
5613 samsung_clk_register_pll(ctx, info->pll_clks, info->nr_pll_clks, in exynos5433_cmu_probe()
5615 if (info->mux_clks) in exynos5433_cmu_probe()
5616 samsung_clk_register_mux(ctx, info->mux_clks, in exynos5433_cmu_probe()
5617 info->nr_mux_clks); in exynos5433_cmu_probe()
5618 if (info->div_clks) in exynos5433_cmu_probe()
5619 samsung_clk_register_div(ctx, info->div_clks, in exynos5433_cmu_probe()
5620 info->nr_div_clks); in exynos5433_cmu_probe()
5621 if (info->gate_clks) in exynos5433_cmu_probe()
5622 samsung_clk_register_gate(ctx, info->gate_clks, in exynos5433_cmu_probe()
5623 info->nr_gate_clks); in exynos5433_cmu_probe()
5624 if (info->fixed_clks) in exynos5433_cmu_probe()
5625 samsung_clk_register_fixed_rate(ctx, info->fixed_clks, in exynos5433_cmu_probe()
5626 info->nr_fixed_clks); in exynos5433_cmu_probe()
5627 if (info->fixed_factor_clks) in exynos5433_cmu_probe()
5628 samsung_clk_register_fixed_factor(ctx, info->fixed_factor_clks, in exynos5433_cmu_probe()
5629 info->nr_fixed_factor_clks); in exynos5433_cmu_probe()
5631 samsung_clk_of_add_provider(dev->of_node, ctx); in exynos5433_cmu_probe()
5639 .compatible = "samsung,exynos5433-cmu-aud",
5642 .compatible = "samsung,exynos5433-cmu-cam0",
5645 .compatible = "samsung,exynos5433-cmu-cam1",
5648 .compatible = "samsung,exynos5433-cmu-disp",
5651 .compatible = "samsung,exynos5433-cmu-g2d",
5654 .compatible = "samsung,exynos5433-cmu-g3d",
5657 .compatible = "samsung,exynos5433-cmu-fsys",
5660 .compatible = "samsung,exynos5433-cmu-gscl",
5663 .compatible = "samsung,exynos5433-cmu-mfc",
5666 .compatible = "samsung,exynos5433-cmu-hevc",
5669 .compatible = "samsung,exynos5433-cmu-isp",
5672 .compatible = "samsung,exynos5433-cmu-mscl",
5675 .compatible = "samsung,exynos5433-cmu-imem",
5690 .name = "exynos5433-cmu",