|policy->cur | The current operating frequency of |
| | this CPU (if appropriate) |
+-----------------------------------+--------------------------------------+
-|policy->min, | |
-|policy->max, | |
+|policy->min, | The min/max scaling frequency. |
+|policy->max | If set by the driver in ->init(), |
+| | used as the lower/upper bound for |
+| | policy frequency QoS requests; |
+| | otherwise, reflects the min/max |
+| | frequency the driver can set |
++-----------------------------------+--------------------------------------+
|policy->policy and, if necessary, | |
|policy->governor | must contain the "default policy" for|
| | this CPU. A few moments later, |
static int cpufreq_policy_init_qos(struct cpufreq_policy *policy)
{
+ unsigned int min_freq, max_freq;
int ret;
+ /* Use policy->min/max set by the driver as QoS requests. */
+ min_freq = max(FREQ_QOS_MIN_DEFAULT_VALUE, policy->min);
+ if (policy->max)
+ max_freq = min(FREQ_QOS_MAX_DEFAULT_VALUE, policy->max);
+ else
+ max_freq = FREQ_QOS_MAX_DEFAULT_VALUE;
+
if (policy->boost_supported) {
ret = freq_qos_add_request(&policy->constraints,
&policy->boost_freq_req,
}
ret = freq_qos_add_request(&policy->constraints, &policy->min_freq_req,
- FREQ_QOS_MIN, FREQ_QOS_MIN_DEFAULT_VALUE);
+ FREQ_QOS_MIN, min_freq);
if (ret < 0)
return ret;
ret = freq_qos_add_request(&policy->constraints, &policy->max_freq_req,
- FREQ_QOS_MAX, FREQ_QOS_MAX_DEFAULT_VALUE);
+ FREQ_QOS_MAX, max_freq);
if (ret < 0)
return ret;