Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 10290030 authored by Prashant Gaikwad's avatar Prashant Gaikwad Committed by Mike Turquette
Browse files

clk: zynq: Use common of_clk_init() function



Use common of_clk_init() function for clock initialization.

Signed-off-by: default avatarPrashant Gaikwad <pgaikwad@nvidia.com>
Reviewed-by: default avatarJosh Cartwright <josh.cartwright@ni.com>
Tested-by: default avatarJosh Cartwright <josh.cartwright@ni.com>
Signed-off-by: default avatarMike Turquette <mturquette@linaro.org>
parent 5b6e0adb
Loading
Loading
Loading
Loading
+4 −10
Original line number Original line Diff line number Diff line
@@ -81,6 +81,7 @@ static void __init zynq_pll_clk_setup(struct device_node *np)
	if (WARN_ON(ret))
	if (WARN_ON(ret))
		return;
		return;
}
}
CLK_OF_DECLARE(zynq_pll, "xlnx,zynq-pll", zynq_pll_clk_setup);


struct zynq_periph_clk {
struct zynq_periph_clk {
	struct clk_hw		hw;
	struct clk_hw		hw;
@@ -187,6 +188,7 @@ static void __init zynq_periph_clk_setup(struct device_node *np)
	if (WARN_ON(err))
	if (WARN_ON(err))
		return;
		return;
}
}
CLK_OF_DECLARE(zynq_periph, "xlnx,zynq-periph-clock", zynq_periph_clk_setup);


/* CPU Clock domain is modelled as a mux with 4 children subclks, whose
/* CPU Clock domain is modelled as a mux with 4 children subclks, whose
 * derivative rates depend on CLK_621_TRUE
 * derivative rates depend on CLK_621_TRUE
@@ -366,18 +368,10 @@ static void __init zynq_cpu_clk_setup(struct device_node *np)
	if (WARN_ON(err))
	if (WARN_ON(err))
		return;
		return;
}
}

CLK_OF_DECLARE(zynq_cpu, "xlnx,zynq-cpu-clock", zynq_cpu_clk_setup);
static const __initconst struct of_device_id zynq_clk_match[] = {
	{ .compatible = "fixed-clock", .data = of_fixed_clk_setup, },
	{ .compatible = "xlnx,zynq-pll", .data = zynq_pll_clk_setup, },
	{ .compatible = "xlnx,zynq-periph-clock",
		.data = zynq_periph_clk_setup, },
	{ .compatible = "xlnx,zynq-cpu-clock", .data = zynq_cpu_clk_setup, },
	{}
};


void __init xilinx_zynq_clocks_init(void __iomem *slcr)
void __init xilinx_zynq_clocks_init(void __iomem *slcr)
{
{
	slcr_base = slcr;
	slcr_base = slcr;
	of_clk_init(zynq_clk_match);
	of_clk_init(NULL);
}
}