diff options
author | Magnus Damm <damm@igel.co.jp> | 2009-05-25 04:10:28 -0400 |
---|---|---|
committer | Paul Mundt <lethal@linux-sh.org> | 2009-05-26 04:08:39 -0400 |
commit | c94a85746f7bdc13035acdf88c130d7b6fa41bde (patch) | |
tree | 8aff35100dcb0a62c82452357ea267f92376dc7a /arch/sh/include | |
parent | c9904dd15922f349b5f06839e34b1723d4a75940 (diff) |
sh: add shared clock framework frequency table code
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
Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'arch/sh/include')
-rw-r--r-- | arch/sh/include/asm/clock.h | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/arch/sh/include/asm/clock.h b/arch/sh/include/asm/clock.h index 64c93cb3d685..60d5d2bc714a 100644 --- a/arch/sh/include/asm/clock.h +++ b/arch/sh/include/asm/clock.h | |||
@@ -100,4 +100,22 @@ enum clk_sh_algo_id { | |||
100 | IP_N1, | 100 | IP_N1, |
101 | }; | 101 | }; |
102 | 102 | ||
103 | struct clk_div_mult_table { | ||
104 | unsigned int *divisors; | ||
105 | unsigned int nr_divisors; | ||
106 | unsigned int *multipliers; | ||
107 | unsigned int nr_multipliers; | ||
108 | }; | ||
109 | |||
110 | struct cpufreq_frequency_table; | ||
111 | void clk_rate_table_build(struct clk *clk, | ||
112 | struct cpufreq_frequency_table *freq_table, | ||
113 | int nr_freqs, | ||
114 | struct clk_div_mult_table *src_table, | ||
115 | unsigned long *bitmap); | ||
116 | |||
117 | long clk_rate_table_round(struct clk *clk, | ||
118 | struct cpufreq_frequency_table *freq_table, | ||
119 | unsigned long rate); | ||
120 | |||
103 | #endif /* __ASM_SH_CLOCK_H */ | 121 | #endif /* __ASM_SH_CLOCK_H */ |