Lines Matching refs:policy

26  * @policy: pointer to policy struct where freq is being set
31 static int cpufreq_set(struct cpufreq_policy *policy, unsigned int freq)
34 struct userspace_policy *userspace = policy->governor_data;
36 pr_debug("cpufreq_set for cpu %u, freq %u kHz\n", policy->cpu, freq);
44 ret = __cpufreq_driver_target(policy, freq, CPUFREQ_RELATION_L);
50 static ssize_t show_speed(struct cpufreq_policy *policy, char *buf)
52 return sprintf(buf, "%u\n", policy->cur);
55 static int cpufreq_userspace_policy_init(struct cpufreq_policy *policy)
65 policy->governor_data = userspace;
70 * Any routine that writes to the policy struct will hold the "rwsem" of
71 * policy struct that means it is free to free "governor_data" here.
73 static void cpufreq_userspace_policy_exit(struct cpufreq_policy *policy)
75 kfree(policy->governor_data);
76 policy->governor_data = NULL;
79 static int cpufreq_userspace_policy_start(struct cpufreq_policy *policy)
81 struct userspace_policy *userspace = policy->governor_data;
83 BUG_ON(!policy->cur);
84 pr_debug("started managing cpu %u\n", policy->cpu);
88 userspace->setspeed = policy->cur;
93 static void cpufreq_userspace_policy_stop(struct cpufreq_policy *policy)
95 struct userspace_policy *userspace = policy->governor_data;
97 pr_debug("managing cpu %u stopped\n", policy->cpu);
105 static void cpufreq_userspace_policy_limits(struct cpufreq_policy *policy)
107 struct userspace_policy *userspace = policy->governor_data;
112 policy->cpu, policy->min, policy->max, policy->cur, userspace->setspeed);
114 if (policy->max < userspace->setspeed)
115 __cpufreq_driver_target(policy, policy->max,
117 else if (policy->min > userspace->setspeed)
118 __cpufreq_driver_target(policy, policy->min,
121 __cpufreq_driver_target(policy, userspace->setspeed,
141 MODULE_DESCRIPTION("CPUfreq policy governor 'userspace'");