diff options
| -rw-r--r-- | arch/arm/mach-omap2/clkt2xxx_virt_prcm_set.c | 17 |
1 files changed, 4 insertions, 13 deletions
diff --git a/arch/arm/mach-omap2/clkt2xxx_virt_prcm_set.c b/arch/arm/mach-omap2/clkt2xxx_virt_prcm_set.c index e60ca4e47bbd..aef62918aaf0 100644 --- a/arch/arm/mach-omap2/clkt2xxx_virt_prcm_set.c +++ b/arch/arm/mach-omap2/clkt2xxx_virt_prcm_set.c | |||
| @@ -68,16 +68,13 @@ long omap2_round_to_table_rate(struct clk *clk, unsigned long rate) | |||
| 68 | { | 68 | { |
| 69 | const struct prcm_config *ptr; | 69 | const struct prcm_config *ptr; |
| 70 | long highest_rate; | 70 | long highest_rate; |
| 71 | long sys_ck_rate; | ||
| 72 | |||
| 73 | sys_ck_rate = clk_get_rate(sclk); | ||
| 74 | 71 | ||
| 75 | highest_rate = -EINVAL; | 72 | highest_rate = -EINVAL; |
| 76 | 73 | ||
| 77 | for (ptr = rate_table; ptr->mpu_speed; ptr++) { | 74 | for (ptr = rate_table; ptr->mpu_speed; ptr++) { |
| 78 | if (!(ptr->flags & cpu_mask)) | 75 | if (!(ptr->flags & cpu_mask)) |
| 79 | continue; | 76 | continue; |
| 80 | if (ptr->xtal_speed != sys_ck_rate) | 77 | if (ptr->xtal_speed != sclk->rate) |
| 81 | continue; | 78 | continue; |
| 82 | 79 | ||
| 83 | highest_rate = ptr->mpu_speed; | 80 | highest_rate = ptr->mpu_speed; |
| @@ -96,15 +93,12 @@ int omap2_select_table_rate(struct clk *clk, unsigned long rate) | |||
| 96 | const struct prcm_config *prcm; | 93 | const struct prcm_config *prcm; |
| 97 | unsigned long found_speed = 0; | 94 | unsigned long found_speed = 0; |
| 98 | unsigned long flags; | 95 | unsigned long flags; |
| 99 | long sys_ck_rate; | ||
| 100 | |||
| 101 | sys_ck_rate = clk_get_rate(sclk); | ||
| 102 | 96 | ||
| 103 | for (prcm = rate_table; prcm->mpu_speed; prcm++) { | 97 | for (prcm = rate_table; prcm->mpu_speed; prcm++) { |
| 104 | if (!(prcm->flags & cpu_mask)) | 98 | if (!(prcm->flags & cpu_mask)) |
| 105 | continue; | 99 | continue; |
| 106 | 100 | ||
| 107 | if (prcm->xtal_speed != sys_ck_rate) | 101 | if (prcm->xtal_speed != sclk->rate) |
| 108 | continue; | 102 | continue; |
| 109 | 103 | ||
| 110 | if (prcm->mpu_speed <= rate) { | 104 | if (prcm->mpu_speed <= rate) { |
| @@ -181,19 +175,16 @@ static struct cpufreq_frequency_table *freq_table; | |||
| 181 | void omap2_clk_init_cpufreq_table(struct cpufreq_frequency_table **table) | 175 | void omap2_clk_init_cpufreq_table(struct cpufreq_frequency_table **table) |
| 182 | { | 176 | { |
| 183 | const struct prcm_config *prcm; | 177 | const struct prcm_config *prcm; |
| 184 | long sys_ck_rate; | ||
| 185 | int i = 0; | 178 | int i = 0; |
| 186 | int tbl_sz = 0; | 179 | int tbl_sz = 0; |
| 187 | 180 | ||
| 188 | if (!cpu_is_omap24xx()) | 181 | if (!cpu_is_omap24xx()) |
| 189 | return; | 182 | return; |
| 190 | 183 | ||
| 191 | sys_ck_rate = clk_get_rate(sclk); | ||
| 192 | |||
| 193 | for (prcm = rate_table; prcm->mpu_speed; prcm++) { | 184 | for (prcm = rate_table; prcm->mpu_speed; prcm++) { |
| 194 | if (!(prcm->flags & cpu_mask)) | 185 | if (!(prcm->flags & cpu_mask)) |
| 195 | continue; | 186 | continue; |
| 196 | if (prcm->xtal_speed != sys_ck_rate) | 187 | if (prcm->xtal_speed != sclk->rate) |
| 197 | continue; | 188 | continue; |
| 198 | 189 | ||
| 199 | /* don't put bypass rates in table */ | 190 | /* don't put bypass rates in table */ |
| @@ -226,7 +217,7 @@ void omap2_clk_init_cpufreq_table(struct cpufreq_frequency_table **table) | |||
| 226 | for (prcm = rate_table; prcm->mpu_speed; prcm++) { | 217 | for (prcm = rate_table; prcm->mpu_speed; prcm++) { |
| 227 | if (!(prcm->flags & cpu_mask)) | 218 | if (!(prcm->flags & cpu_mask)) |
| 228 | continue; | 219 | continue; |
| 229 | if (prcm->xtal_speed != sys_ck_rate) | 220 | if (prcm->xtal_speed != sclk->rate) |
| 230 | continue; | 221 | continue; |
| 231 | 222 | ||
| 232 | /* don't put bypass rates in table */ | 223 | /* don't put bypass rates in table */ |
