Skip to contentSkip to conversation

sh: clock div6 helper code

PATCH New Magnus Damm 1 participant 1 message Jun 2, 2009 SuperH

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 sh: clock div6 helper code

From: Magnus Damm <[email protected]>

This patch adds div6 clock helper code. The div6 clocks are simply 6-bit divide-by-n modules where n is 1 to 64.

Needed for vclk on sh7722, sh7723, sh7343 and sh7366. sh7724 needs this even more for vclk, fclka, fclkb, irdaclk and spuclk.

---

 arch/sh/include/asm/clock.h    |   10 +++++
 arch/sh/kernel/cpu/clock-cpg.c |   71 ++++++++++++++++++++++++++++++++++++----
 2 files changed, 75 insertions(+), 6 deletions(-)
arch/sh/include/asm/clock.h +10 -0
@@ -145,4 +145,14 @@ int sh_clk_mstp32_register(struct clk *c
 int sh_clk_div4_register(struct clk *clks, int nr,
 			 struct clk_div_mult_table *table);
 
+#define SH_CLK_DIV6(_name, _parent, _reg, _flags)	\
+{							\
+	.name = _name,					\
+	.parent = _parent,				\
+	.enable_reg = (void __iomem *)_reg,		\
+	.flags = _flags,				\
+}
+
+int sh_clk_div6_register(struct clk *clks, int nr);
+
 #endif /* __ASM_SH_CLOCK_H */
arch/sh/kernel/cpu/clock-cpg.c +65 -6

85 lines not on this page · raw message