Lines Matching refs:policy

136 /* For the default policy, we want at least some processing power
250 static void gx_set_cpuspeed(struct cpufreq_policy *policy, unsigned int khz)
264 cpufreq_freq_transition_begin(policy, &freqs);
313 cpufreq_freq_transition_end(policy, &freqs, 0);
331 static int cpufreq_gx_verify(struct cpufreq_policy_data *policy)
336 if (!stock_freq || !policy)
339 policy->cpu = 0;
340 cpufreq_verify_within_limits(policy, (stock_freq / max_duration),
344 * within policy->min and policy->max. If it is not, policy->max
346 * policy->min may not be decreased, though. This way we guarantee a
349 tmp_freq = gx_validate_speed(policy->min, &tmp1, &tmp2);
350 if (tmp_freq < policy->min)
352 policy->min = tmp_freq;
353 if (policy->min > policy->max)
354 policy->max = tmp_freq;
355 tmp_freq = gx_validate_speed(policy->max, &tmp1, &tmp2);
356 if (tmp_freq > policy->max)
358 policy->max = tmp_freq;
359 if (policy->max < policy->min)
360 policy->max = policy->min;
361 cpufreq_verify_within_limits(policy, (stock_freq / max_duration),
371 static int cpufreq_gx_target(struct cpufreq_policy *policy,
378 if (!stock_freq || !policy)
381 policy->cpu = 0;
384 while (tmp_freq < policy->min) {
388 while (tmp_freq > policy->max) {
393 gx_set_cpuspeed(policy, tmp_freq);
398 static int cpufreq_gx_cpu_init(struct cpufreq_policy *policy)
402 if (!policy || policy->cpu != 0)
418 policy->cpu = 0;
421 policy->min = maxfreq / max_duration;
423 policy->min = maxfreq / POLICY_MIN_DIV;
424 policy->max = maxfreq;
425 policy->cpuinfo.min_freq = maxfreq / max_duration;
426 policy->cpuinfo.max_freq = maxfreq;