struct pass_hotplug *hotplug = policy->hotplug;
int curr_level = policy->curr_level;
int limit_max_freq;
+ int limit_min_freq;
int limit_max_cpu;
int online;
int ret;
return 0;
/*
- * Get maximum CPU frequency/the maximum number of online CPU
+ * Get the max/min frequency and the number of max online
* according to PASS level.
*/
limit_max_freq = table[new_level].limit_max_freq;
+ limit_min_freq = table[new_level].limit_min_freq;
limit_max_cpu = table[new_level].limit_max_cpu;
policy->prev_level = policy->curr_level;
pass_hotplug_set_online(policy, online);
}
- /* Set maximum CPU frequency */
- ret = pass_set_max_freq(pass_res, limit_max_freq);
- if (ret < 0) {
- _E("cannot set the maximum frequency of %s", cdata->res_name);
- return -EINVAL;
+ /* Set maximum frequency */
+ if (limit_max_freq) {
+ ret = pass_set_max_freq(pass_res, limit_max_freq);
+ if (ret < 0) {
+ _E("cannot set the maximum frequency of %s",
+ cdata->res_name);
+ return -EINVAL;
+ }
+ }
+
+ /* Set minimum frequency */
+ if (limit_min_freq) {
+ ret = pass_set_min_freq(pass_res, limit_min_freq);
+ if (ret < 0) {
+ _E("cannot set the minimum frequency of %s",
+ cdata->res_name);
+ return -EINVAL;
+ }
}
/*
- _I("[PASS %s] Level %4s '%d->%d' : '%d'Hz/'%d'Core\n",
+ _I("[PASS %s] Level %4s '%d->%d' : 'max %d | min %d'Hz/'%d'Core\n",
pass_res->cdata.res_name,
(curr_level > new_level ? "DOWN" : "UP"),
- curr_level, new_level, limit_max_freq, limit_max_cpu);
+ curr_level, new_level,
+ limit_max_freq, limit_min_freq, limit_max_cpu);
*/
return 0;
if (MATCH(result->name, "limit_max_freq"))
policy->pass_table[level].limit_max_freq = atoi(result->value);
+ else if (MATCH(result->name, "limit_min_freq"))
+ policy->pass_table[level].limit_min_freq = atoi(result->value);
else if (MATCH(result->name, "limit_max_cpu"))
policy->pass_table[level].limit_max_cpu = atoi(result->value);
_I("%s| policy->pass_table[%d].limit_max_freq : %d\n",
pass_res->cdata.res_name, level,
policy->pass_table[level].limit_max_freq);
+ if (policy->pass_table[level].limit_min_freq)
+ _I("%s| policy->pass_table[%d].limit_min_freq : %d\n",
+ pass_res->cdata.res_name, level,
+ policy->pass_table[level].limit_min_freq);
if (policy->pass_table[level].limit_max_cpu)
_I("%s| policy->pass_table[%d].limit_max_cpu : %d\n",
pass_res->cdata.res_name, level,