summaryrefslogtreecommitdiffstats
path: root/drivers/clk/clk-u300.c
diff options
context:
space:
mode:
authorLinus Walleij <linus.walleij@linaro.org>2013-05-23 19:18:28 +0200
committerLinus Walleij <linus.walleij@linaro.org>2013-06-17 13:54:37 +0200
commit85fb28bed813469ba56706a7e48fba596f47c253 (patch)
tree25a229324358e68059010b070a43b8da37b908d6 /drivers/clk/clk-u300.c
parentARM: u300: move the gated system controller clocks to DT (diff)
downloadlinux-85fb28bed813469ba56706a7e48fba596f47c253.tar.xz
linux-85fb28bed813469ba56706a7e48fba596f47c253.zip
ARM: u300: convert MMC/SD clock to device tree
This converts the last of the U300 clocks to being probed from the device tree. Acked-by: Mike Turquette <mturquette@linaro.org> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'drivers/clk/clk-u300.c')
-rw-r--r--drivers/clk/clk-u300.c22
1 files changed, 17 insertions, 5 deletions
diff --git a/drivers/clk/clk-u300.c b/drivers/clk/clk-u300.c
index 5f234d37ccbe..8774e058cb6c 100644
--- a/drivers/clk/clk-u300.c
+++ b/drivers/clk/clk-u300.c
@@ -1139,6 +1139,18 @@ mclk_clk_register(struct device *dev, const char *name,
return clk;
}
+static void __init of_u300_syscon_mclk_init(struct device_node *np)
+{
+ struct clk *clk = ERR_PTR(-EINVAL);
+ const char *clk_name = np->name;
+ const char *parent_name;
+
+ parent_name = of_clk_get_parent_name(np, 0);
+ clk = mclk_clk_register(NULL, clk_name, parent_name, false);
+ if (!IS_ERR(clk))
+ of_clk_add_provider(np, of_clk_src_simple_get, clk);
+}
+
static const __initconst struct of_device_id u300_clk_match[] = {
{
.compatible = "fixed-clock",
@@ -1152,12 +1164,16 @@ static const __initconst struct of_device_id u300_clk_match[] = {
.compatible = "stericsson,u300-syscon-clk",
.data = of_u300_syscon_clk_init,
},
+ {
+ .compatible = "stericsson,u300-syscon-mclk",
+ .data = of_u300_syscon_mclk_init,
+ },
};
+
void __init u300_clk_init(void __iomem *base)
{
u16 val;
- struct clk *clk;
syscon_vbase = base;
@@ -1175,8 +1191,4 @@ void __init u300_clk_init(void __iomem *base)
writew(val, syscon_vbase + U300_SYSCON_PMCR);
of_clk_init(u300_clk_match);
-
- /* Then this special MMC/SD clock */
- clk = mclk_clk_register(NULL, "mmc_clk", "mmc_p_clk", false);
- clk_register_clkdev(clk, NULL, "mmci");
}