sh: div4 reparent workaround
authorMagnus Damm <damm@opensource.se>
Tue, 11 May 2010 07:05:09 +0000 (07:05 +0000)
committerPaul Mundt <lethal@linux-sh.org>
Thu, 13 May 2010 08:34:10 +0000 (17:34 +0900)
Update the div4 set_parent() callback to use the
flags instead of name to determine parent index.

Signed-off-by: Magnus Damm <damm@opensource.se>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
arch/sh/kernel/cpu/clock-cpg.c

index 17a73ad7a20d558f65f41f768ea9f35aeb071e4c..0b165f6ae08c12da8c56968fa6d5462537785d44 100644 (file)
@@ -168,7 +168,12 @@ static int sh_clk_div4_set_parent(struct clk *clk, struct clk *parent)
        u32 value;
        int ret;
 
-       if (!strcmp("pll_clk", parent->name))
+       /* we really need a better way to determine parent index, but for
+        * now assume internal parent comes with CLK_ENABLE_ON_INIT set,
+        * no CLK_ENABLE_ON_INIT means external clock...
+        */
+
+       if (parent->flags & CLK_ENABLE_ON_INIT)
                value = __raw_readl(clk->enable_reg) & ~(1 << 7);
        else
                value = __raw_readl(clk->enable_reg) | (1 << 7);