aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>2014-06-03 17:13:20 -0400
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2014-06-03 17:13:20 -0400
commit057beb1de54d33ecfd3397ed219b1f4518e3b470 (patch)
tree7c67e9d8c88093a3d551111e56401826a964ffba /arch
parent42a09284fab8abc15c8554f2e2aa2368161c77c6 (diff)
parent5ece2399181a5abaf42a4cb607463770686778e6 (diff)
Merge branch 'pm-cpufreq'
* pm-cpufreq: (28 commits) cpufreq: handle calls to ->target_index() in separate routine cpufreq: s5pv210: drop check for CONFIG_PM_VERBOSE cpufreq: intel_pstate: Remove unused member name of cpudata cpufreq: Break out early when frequency equals target_freq cpufreq: Tegra: drop wrapper around tegra_update_cpu_speed() cpufreq: imx6q: Remove unused include cpufreq: imx6q: Drop devm_clk/regulator_get usage cpufreq: powernow-k8: Suppress checkpatch warnings cpufreq: powernv: make local function static cpufreq: Enable big.LITTLE cpufreq driver on arm64 cpufreq: nforce2: remove DEFINE_PCI_DEVICE_TABLE macro intel_pstate: Add CPU IDs for Broadwell processors cpufreq: Fix build error on some platforms that use cpufreq_for_each_* PM / OPP: Move cpufreq specific OPP functions out of generic OPP library PM / OPP: Remove cpufreq wrapper dependency on internal data organization cpufreq: Catch double invocations of cpufreq_freq_transition_begin/end intel_pstate: Remove sample parameter in intel_pstate_calc_busy cpufreq: Kconfig: Fix spelling errors cpufreq: Make linux-pm@vger.kernel.org official mailing list cpufreq: exynos: Use dev_err/info function instead of pr_err/info ...
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/mach-davinci/da850.c9
-rw-r--r--arch/mips/loongson/lemote-2f/clock.c17
2 files changed, 10 insertions, 16 deletions
diff --git a/arch/arm/mach-davinci/da850.c b/arch/arm/mach-davinci/da850.c
index 85399c98f84a..45ce065e7170 100644
--- a/arch/arm/mach-davinci/da850.c
+++ b/arch/arm/mach-davinci/da850.c
@@ -1092,20 +1092,21 @@ int da850_register_cpufreq(char *async_clk)
1092 1092
1093static int da850_round_armrate(struct clk *clk, unsigned long rate) 1093static int da850_round_armrate(struct clk *clk, unsigned long rate)
1094{ 1094{
1095 int i, ret = 0, diff; 1095 int ret = 0, diff;
1096 unsigned int best = (unsigned int) -1; 1096 unsigned int best = (unsigned int) -1;
1097 struct cpufreq_frequency_table *table = cpufreq_info.freq_table; 1097 struct cpufreq_frequency_table *table = cpufreq_info.freq_table;
1098 struct cpufreq_frequency_table *pos;
1098 1099
1099 rate /= 1000; /* convert to kHz */ 1100 rate /= 1000; /* convert to kHz */
1100 1101
1101 for (i = 0; table[i].frequency != CPUFREQ_TABLE_END; i++) { 1102 cpufreq_for_each_entry(pos, table) {
1102 diff = table[i].frequency - rate; 1103 diff = pos->frequency - rate;
1103 if (diff < 0) 1104 if (diff < 0)
1104 diff = -diff; 1105 diff = -diff;
1105 1106
1106 if (diff < best) { 1107 if (diff < best) {
1107 best = diff; 1108 best = diff;
1108 ret = table[i].frequency; 1109 ret = pos->frequency;
1109 } 1110 }
1110 } 1111 }
1111 1112
diff --git a/arch/mips/loongson/lemote-2f/clock.c b/arch/mips/loongson/lemote-2f/clock.c
index 67dd94ef28e6..1eed38e28b1e 100644
--- a/arch/mips/loongson/lemote-2f/clock.c
+++ b/arch/mips/loongson/lemote-2f/clock.c
@@ -91,10 +91,9 @@ EXPORT_SYMBOL(clk_put);
91 91
92int clk_set_rate(struct clk *clk, unsigned long rate) 92int clk_set_rate(struct clk *clk, unsigned long rate)
93{ 93{
94 unsigned int rate_khz = rate / 1000; 94 struct cpufreq_frequency_table *pos;
95 int ret = 0; 95 int ret = 0;
96 int regval; 96 int regval;
97 int i;
98 97
99 if (likely(clk->ops && clk->ops->set_rate)) { 98 if (likely(clk->ops && clk->ops->set_rate)) {
100 unsigned long flags; 99 unsigned long flags;
@@ -107,22 +106,16 @@ int clk_set_rate(struct clk *clk, unsigned long rate)
107 if (unlikely(clk->flags & CLK_RATE_PROPAGATES)) 106 if (unlikely(clk->flags & CLK_RATE_PROPAGATES))
108 propagate_rate(clk); 107 propagate_rate(clk);
109 108
110 for (i = 0; loongson2_clockmod_table[i].frequency != CPUFREQ_TABLE_END; 109 cpufreq_for_each_valid_entry(pos, loongson2_clockmod_table)
111 i++) { 110 if (rate == pos->frequency)
112 if (loongson2_clockmod_table[i].frequency ==
113 CPUFREQ_ENTRY_INVALID)
114 continue;
115 if (rate_khz == loongson2_clockmod_table[i].frequency)
116 break; 111 break;
117 } 112 if (rate != pos->frequency)
118 if (rate_khz != loongson2_clockmod_table[i].frequency)
119 return -ENOTSUPP; 113 return -ENOTSUPP;
120 114
121 clk->rate = rate; 115 clk->rate = rate;
122 116
123 regval = LOONGSON_CHIPCFG0; 117 regval = LOONGSON_CHIPCFG0;
124 regval = (regval & ~0x7) | 118 regval = (regval & ~0x7) | (pos->driver_data - 1);
125 (loongson2_clockmod_table[i].driver_data - 1);
126 LOONGSON_CHIPCFG0 = regval; 119 LOONGSON_CHIPCFG0 = regval;
127 120
128 return ret; 121 return ret;