Skip to contentSkip to conversation

sh: add shared clock framework frequency table code

PATCH In review Magnus Damm 1 participant 1 message May 25, 2009 SuperH

lore
Share & tools
lore
#0 lore raw

PATCH 2/4 sh: add shared clock framework frequency table code

From: Magnus Damm <[email protected]>

Add SuperH-specific clock framework helper functions:
- clk_rate_table_build() - build cpufreq table from divisors/multipliers
- clk_rate_table_round() - use cpufreq table to find matching frequency

---

For the clkfwk topic branch.

 arch/sh/include/asm/clock.h |   18 ++++++++++
 arch/sh/kernel/cpu/clock.c  |   75 +++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 93 insertions(+)
arch/sh/include/asm/clock.h +18 -0
@@ -100,4 +100,22 @@ enum clk_sh_algo_id {
 	IP_N1,
 };
 
+struct clk_div_mult_table {
+	unsigned int *divisors;
+	unsigned int nr_divisors;
+	unsigned int *multipliers;
+	unsigned int nr_multipliers;
+};
+
+struct cpufreq_frequency_table;
+void clk_rate_table_build(struct clk *clk,
+			  struct cpufreq_frequency_table *freq_table,
+			  int nr_freqs,
+			  struct clk_div_mult_table *src_table,
+			  unsigned long *bitmap);
+
+long clk_rate_table_round(struct clk *clk,
+			  struct cpufreq_frequency_table *freq_table,
+			  unsigned long rate);
+
 #endif /* __ASM_SH_CLOCK_H */
arch/sh/kernel/cpu/clock.c +75 -0

87 lines not on this page · raw message