Skip to contentSkip to conversation

sh: div4 reparent workaround

PATCH New Magnus Damm 1 participant 1 message May 11, 2010 SuperH

lore
Share & tools
lore
#0 lore raw

PATCH 1/9 sh: div4 reparent workaround

From: Magnus Damm <[email protected]>

Update the div4 set_parent() callback to use the
flags instead of name to determine parent index.

---

 arch/sh/kernel/cpu/clock-cpg.c |    7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
arch/sh/kernel/cpu/clock-cpg.c +6 -1
@@ -168,7 +168,12 @@ static int sh_clk_div4_set_parent(struct
 	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);