Пример #1
0
static void exynos5420_clk_sleep_init(void)
{
    exynos5x_save = samsung_clk_alloc_reg_dump(exynos5x_clk_regs,
                    ARRAY_SIZE(exynos5x_clk_regs));
    if (!exynos5x_save) {
        pr_warn("%s: failed to allocate sleep save data, no sleep support!\n",
                __func__);
        return;
    }

    if (exynos5x_soc == EXYNOS5800) {
        exynos5800_save =
            samsung_clk_alloc_reg_dump(exynos5800_clk_regs,
                                       ARRAY_SIZE(exynos5800_clk_regs));
        if (!exynos5800_save)
            goto err_soc;
    }

    register_syscore_ops(&exynos5420_clk_syscore_ops);
    return;
err_soc:
    kfree(exynos5x_save);
    pr_warn("%s: failed to allocate sleep save data, no sleep support!\n",
            __func__);
    return;
}
Пример #2
0
static void exynos4_clk_sleep_init(void)
{
	exynos4_save_common = samsung_clk_alloc_reg_dump(exynos4_clk_regs,
					ARRAY_SIZE(exynos4_clk_regs));
	if (!exynos4_save_common)
		goto err_warn;

	if (exynos4_soc == EXYNOS4210)
		exynos4_save_soc = samsung_clk_alloc_reg_dump(
					exynos4210_clk_save,
					ARRAY_SIZE(exynos4210_clk_save));
	else
		exynos4_save_soc = samsung_clk_alloc_reg_dump(
					exynos4x12_clk_save,
					ARRAY_SIZE(exynos4x12_clk_save));
	if (!exynos4_save_soc)
		goto err_common;

	exynos4_save_pll = samsung_clk_alloc_reg_dump(exynos4_clk_pll_regs,
					ARRAY_SIZE(exynos4_clk_pll_regs));
	if (!exynos4_save_pll)
		goto err_soc;

	register_syscore_ops(&exynos4_clk_syscore_ops);
	return;

err_soc:
	kfree(exynos4_save_soc);
err_common:
	kfree(exynos4_save_common);
err_warn:
	pr_warn("%s: failed to allocate sleep save data, no sleep support!\n",
		__func__);
}
Пример #3
0
static void s5pv210_clk_sleep_init(void)
{
	s5pv210_clk_dump =
		samsung_clk_alloc_reg_dump(s5pv210_clk_regs,
					   ARRAY_SIZE(s5pv210_clk_regs));
	if (!s5pv210_clk_dump) {
		pr_warn("%s: Failed to allocate sleep save data\n", __func__);
		return;
	}

	register_syscore_ops(&s5pv210_clk_syscore_ops);
}
Пример #4
0
static void exynos5250_clk_sleep_init(void)
{
	exynos5250_save = samsung_clk_alloc_reg_dump(exynos5250_clk_regs,
					ARRAY_SIZE(exynos5250_clk_regs));
	if (!exynos5250_save) {
		pr_warn("%s: failed to allocate sleep save data, no sleep support!\n",
			__func__);
		return;
	}

	register_syscore_ops(&exynos5250_clk_syscore_ops);
}
Пример #5
0
static void s3c64xx_clk_sleep_init(void)
{
	s3c64xx_save_common = samsung_clk_alloc_reg_dump(s3c64xx_clk_regs,
						ARRAY_SIZE(s3c64xx_clk_regs));
	if (!s3c64xx_save_common)
		goto err_warn;

	if (!is_s3c6400) {
		s3c64xx_save_soc = samsung_clk_alloc_reg_dump(s3c6410_clk_regs,
						ARRAY_SIZE(s3c6410_clk_regs));
		if (!s3c64xx_save_soc)
			goto err_soc;
	}

	register_syscore_ops(&s3c64xx_clk_syscore_ops);
	return;

err_soc:
	kfree(s3c64xx_save_common);
err_warn:
	pr_warn("%s: failed to allocate sleep save data, no sleep support!\n",
		__func__);
}
Пример #6
0
static void exynos3250_dmc_clk_sleep_init(void)
{
	exynos3250_dmc_clk_regs =
		samsung_clk_alloc_reg_dump(exynos3250_cmu_dmc_clk_regs,
				   ARRAY_SIZE(exynos3250_cmu_dmc_clk_regs));
	if (!exynos3250_dmc_clk_regs) {
		pr_warn("%s: Failed to allocate sleep save data\n", __func__);
		goto err;
	}

	register_syscore_ops(&exynos3250_dmc_clk_syscore_ops);
	return;
err:
	kfree(exynos3250_dmc_clk_regs);
}
Пример #7
0
static int __init exynos4x12_isp_clk_probe(struct platform_device *pdev)
{
	struct samsung_clk_provider *ctx;
	struct device *dev = &pdev->dev;
	struct device_node *np = dev->of_node;
	struct resource *res;
	void __iomem *reg_base;

	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
	reg_base = devm_ioremap_resource(dev, res);
	if (IS_ERR(reg_base)) {
		dev_err(dev, "failed to map registers\n");
		return PTR_ERR(reg_base);
	}

	exynos4x12_save_isp = samsung_clk_alloc_reg_dump(exynos4x12_clk_isp_save,
					ARRAY_SIZE(exynos4x12_clk_isp_save));
	if (!exynos4x12_save_isp)
		return -ENOMEM;

	ctx = samsung_clk_init(np, reg_base, CLK_NR_ISP_CLKS);
	ctx->dev = dev;

	platform_set_drvdata(pdev, ctx);

	pm_runtime_set_active(dev);
	pm_runtime_enable(dev);
	pm_runtime_get_sync(dev);

	samsung_clk_register_div(ctx, exynos4x12_isp_div_clks,
				 ARRAY_SIZE(exynos4x12_isp_div_clks));
	samsung_clk_register_gate(ctx, exynos4x12_isp_gate_clks,
				  ARRAY_SIZE(exynos4x12_isp_gate_clks));

	samsung_clk_of_add_provider(np, ctx);
	pm_runtime_put(dev);

	return 0;
}