Lines Matching refs:policy

31 static int cpufreq_set(struct cpufreq_policy *policy, unsigned int freq)  in cpufreq_set()  argument
34 struct userspace_policy *userspace = policy->governor_data; in cpufreq_set()
36 pr_debug("cpufreq_set for cpu %u, freq %u kHz\n", policy->cpu, freq); in cpufreq_set()
44 ret = __cpufreq_driver_target(policy, freq, CPUFREQ_RELATION_L); in cpufreq_set()
50 static ssize_t show_speed(struct cpufreq_policy *policy, char *buf) in show_speed() argument
52 return sprintf(buf, "%u\n", policy->cur); in show_speed()
55 static int cpufreq_userspace_policy_init(struct cpufreq_policy *policy) in cpufreq_userspace_policy_init() argument
65 policy->governor_data = userspace; in cpufreq_userspace_policy_init()
73 static void cpufreq_userspace_policy_exit(struct cpufreq_policy *policy) in cpufreq_userspace_policy_exit() argument
75 kfree(policy->governor_data); in cpufreq_userspace_policy_exit()
76 policy->governor_data = NULL; in cpufreq_userspace_policy_exit()
79 static int cpufreq_userspace_policy_start(struct cpufreq_policy *policy) in cpufreq_userspace_policy_start() argument
81 struct userspace_policy *userspace = policy->governor_data; in cpufreq_userspace_policy_start()
83 BUG_ON(!policy->cur); in cpufreq_userspace_policy_start()
84 pr_debug("started managing cpu %u\n", policy->cpu); in cpufreq_userspace_policy_start()
88 userspace->setspeed = policy->cur; in cpufreq_userspace_policy_start()
93 static void cpufreq_userspace_policy_stop(struct cpufreq_policy *policy) in cpufreq_userspace_policy_stop() argument
95 struct userspace_policy *userspace = policy->governor_data; in cpufreq_userspace_policy_stop()
97 pr_debug("managing cpu %u stopped\n", policy->cpu); in cpufreq_userspace_policy_stop()
105 static void cpufreq_userspace_policy_limits(struct cpufreq_policy *policy) in cpufreq_userspace_policy_limits() argument
107 struct userspace_policy *userspace = policy->governor_data; in cpufreq_userspace_policy_limits()
112 policy->cpu, policy->min, policy->max, policy->cur, userspace->setspeed); in cpufreq_userspace_policy_limits()
114 if (policy->max < userspace->setspeed) in cpufreq_userspace_policy_limits()
115 __cpufreq_driver_target(policy, policy->max, in cpufreq_userspace_policy_limits()
117 else if (policy->min > userspace->setspeed) in cpufreq_userspace_policy_limits()
118 __cpufreq_driver_target(policy, policy->min, in cpufreq_userspace_policy_limits()
121 __cpufreq_driver_target(policy, userspace->setspeed, in cpufreq_userspace_policy_limits()