Skip to content

Commit e7eea04

Browse files
nbd168paulburton
authored andcommitted
MIPS: ath79: support setting up clock via DT on all SoC types
Use the same functions as the legacy code Signed-off-by: Felix Fietkau <nbd@nbd.name> Signed-off-by: John Crispin <john@phrozen.org> Signed-off-by: Paul Burton <paul.burton@mips.com> Cc: Ralf Baechle <ralf@linux-mips.org> Cc: James Hogan <jhogan@kernel.org> Cc: Rob Herring <robh+dt@kernel.org> Cc: Pengutronix Kernel Team <kernel@pengutronix.de> Cc: linux-mips@vger.kernel.org Cc: linux-kernel@vger.kernel.org Cc: devicetree@vger.kernel.org
1 parent 8e64175 commit e7eea04

File tree

1 file changed

+22
-17
lines changed

1 file changed

+22
-17
lines changed

arch/mips/ath79/clock.c

Lines changed: 22 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -668,16 +668,6 @@ ath79_get_sys_clk_rate(const char *id)
668668

669669
#ifdef CONFIG_OF
670670
static void __init ath79_clocks_init_dt(struct device_node *np)
671-
{
672-
of_clk_add_provider(np, of_clk_src_onecell_get, &clk_data);
673-
}
674-
675-
CLK_OF_DECLARE(ar7100, "qca,ar7100-pll", ath79_clocks_init_dt);
676-
CLK_OF_DECLARE(ar7240, "qca,ar7240-pll", ath79_clocks_init_dt);
677-
CLK_OF_DECLARE(ar9340, "qca,ar9340-pll", ath79_clocks_init_dt);
678-
CLK_OF_DECLARE(ar9550, "qca,qca9550-pll", ath79_clocks_init_dt);
679-
680-
static void __init ath79_clocks_init_dt_ng(struct device_node *np)
681671
{
682672
struct clk *ref_clk;
683673
void __iomem *pll_base;
@@ -692,14 +682,21 @@ static void __init ath79_clocks_init_dt_ng(struct device_node *np)
692682
goto err_clk;
693683
}
694684

695-
if (of_device_is_compatible(np, "qca,ar9130-pll"))
685+
if (of_device_is_compatible(np, "qca,ar7100-pll"))
686+
ar71xx_clocks_init(pll_base);
687+
else if (of_device_is_compatible(np, "qca,ar7240-pll") ||
688+
of_device_is_compatible(np, "qca,ar9130-pll"))
696689
ar724x_clocks_init(pll_base);
697690
else if (of_device_is_compatible(np, "qca,ar9330-pll"))
698691
ar933x_clocks_init(pll_base);
699-
else {
700-
pr_err("%pOF: could not find any appropriate clk_init()\n", np);
701-
goto err_iounmap;
702-
}
692+
else if (of_device_is_compatible(np, "qca,ar9340-pll"))
693+
ar934x_clocks_init(pll_base);
694+
else if (of_device_is_compatible(np, "qca,qca9530-pll"))
695+
qca953x_clocks_init(pll_base);
696+
else if (of_device_is_compatible(np, "qca,qca9550-pll"))
697+
qca955x_clocks_init(pll_base);
698+
else if (of_device_is_compatible(np, "qca,qca9560-pll"))
699+
qca956x_clocks_init(pll_base);
703700

704701
if (of_clk_add_provider(np, of_clk_src_onecell_get, &clk_data)) {
705702
pr_err("%pOF: could not register clk provider\n", np);
@@ -714,6 +711,14 @@ static void __init ath79_clocks_init_dt_ng(struct device_node *np)
714711
err_clk:
715712
clk_put(ref_clk);
716713
}
717-
CLK_OF_DECLARE(ar9130_clk, "qca,ar9130-pll", ath79_clocks_init_dt_ng);
718-
CLK_OF_DECLARE(ar9330_clk, "qca,ar9330-pll", ath79_clocks_init_dt_ng);
714+
715+
CLK_OF_DECLARE(ar7100_clk, "qca,ar7100-pll", ath79_clocks_init_dt);
716+
CLK_OF_DECLARE(ar7240_clk, "qca,ar7240-pll", ath79_clocks_init_dt);
717+
CLK_OF_DECLARE(ar9130_clk, "qca,ar9130-pll", ath79_clocks_init_dt);
718+
CLK_OF_DECLARE(ar9330_clk, "qca,ar9330-pll", ath79_clocks_init_dt);
719+
CLK_OF_DECLARE(ar9340_clk, "qca,ar9340-pll", ath79_clocks_init_dt);
720+
CLK_OF_DECLARE(ar9530_clk, "qca,qca9530-pll", ath79_clocks_init_dt);
721+
CLK_OF_DECLARE(ar9550_clk, "qca,qca9550-pll", ath79_clocks_init_dt);
722+
CLK_OF_DECLARE(ar9560_clk, "qca,qca9560-pll", ath79_clocks_init_dt);
723+
719724
#endif

0 commit comments

Comments
 (0)