Lines Matching full:devfreq

3  * linux/drivers/devfreq/governor_passive.c
16 #include <linux/devfreq.h>
77 static int get_target_freq_with_cpufreq(struct devfreq *devfreq, in get_target_freq_with_cpufreq() argument
81 (struct devfreq_passive_data *)devfreq->data; in get_target_freq_with_cpufreq()
106 devfreq->opp_table, &cpu_cur); in get_target_freq_with_cpufreq()
114 devfreq_get_freq_range(devfreq, &dev_min, &dev_max); in get_target_freq_with_cpufreq()
130 static int get_target_freq_with_devfreq(struct devfreq *devfreq, in get_target_freq_with_devfreq() argument
134 = (struct devfreq_passive_data *)devfreq->data; in get_target_freq_with_devfreq()
135 struct devfreq *parent_devfreq = (struct devfreq *)p_data->parent; in get_target_freq_with_devfreq()
142 devfreq->opp_table, freq); in get_target_freq_with_devfreq()
154 if (i < devfreq->max_state) { in get_target_freq_with_devfreq()
155 child_freq = devfreq->freq_table[i]; in get_target_freq_with_devfreq()
157 count = devfreq->max_state; in get_target_freq_with_devfreq()
158 child_freq = devfreq->freq_table[count - 1]; in get_target_freq_with_devfreq()
167 static int devfreq_passive_get_target_freq(struct devfreq *devfreq, in devfreq_passive_get_target_freq() argument
171 (struct devfreq_passive_data *)devfreq->data; in devfreq_passive_get_target_freq()
178 * If the devfreq device with passive governor has the specific method in devfreq_passive_get_target_freq()
183 return p_data->get_target_freq(devfreq, freq); in devfreq_passive_get_target_freq()
187 ret = get_target_freq_with_devfreq(devfreq, freq); in devfreq_passive_get_target_freq()
190 ret = get_target_freq_with_cpufreq(devfreq, freq); in devfreq_passive_get_target_freq()
194 dev_err(&devfreq->dev, "Invalid parent type\n"); in devfreq_passive_get_target_freq()
206 struct devfreq *devfreq = (struct devfreq *)p_data->this; in cpufreq_passive_notifier_call() local
222 mutex_lock(&devfreq->lock); in cpufreq_passive_notifier_call()
223 ret = devfreq_update_target(devfreq, freqs->new); in cpufreq_passive_notifier_call()
224 mutex_unlock(&devfreq->lock); in cpufreq_passive_notifier_call()
227 dev_err(&devfreq->dev, "failed to update the frequency.\n"); in cpufreq_passive_notifier_call()
234 static int cpufreq_passive_unregister_notifier(struct devfreq *devfreq) in cpufreq_passive_unregister_notifier() argument
237 = (struct devfreq_passive_data *)devfreq->data; in cpufreq_passive_unregister_notifier()
252 static int cpufreq_passive_register_notifier(struct devfreq *devfreq) in cpufreq_passive_register_notifier() argument
255 = (struct devfreq_passive_data *)devfreq->data; in cpufreq_passive_register_notifier()
256 struct device *dev = devfreq->dev.parent; in cpufreq_passive_register_notifier()
320 mutex_lock(&devfreq->lock); in cpufreq_passive_register_notifier()
321 ret = devfreq_update_target(devfreq, 0L); in cpufreq_passive_register_notifier()
322 mutex_unlock(&devfreq->lock); in cpufreq_passive_register_notifier()
342 struct devfreq *devfreq = (struct devfreq *)data->this; in devfreq_passive_notifier_call() local
343 struct devfreq *parent = (struct devfreq *)data->parent; in devfreq_passive_notifier_call()
348 mutex_lock_nested(&devfreq->lock, SINGLE_DEPTH_NESTING); in devfreq_passive_notifier_call()
352 ret = devfreq_update_target(devfreq, freq); in devfreq_passive_notifier_call()
357 ret = devfreq_update_target(devfreq, freq); in devfreq_passive_notifier_call()
360 mutex_unlock(&devfreq->lock); in devfreq_passive_notifier_call()
363 dev_warn(&devfreq->dev, in devfreq_passive_notifier_call()
364 "failed to update devfreq using passive governor\n"); in devfreq_passive_notifier_call()
369 static int devfreq_passive_unregister_notifier(struct devfreq *devfreq) in devfreq_passive_unregister_notifier() argument
372 = (struct devfreq_passive_data *)devfreq->data; in devfreq_passive_unregister_notifier()
373 struct devfreq *parent = (struct devfreq *)p_data->parent; in devfreq_passive_unregister_notifier()
379 static int devfreq_passive_register_notifier(struct devfreq *devfreq) in devfreq_passive_register_notifier() argument
382 = (struct devfreq_passive_data *)devfreq->data; in devfreq_passive_register_notifier()
383 struct devfreq *parent = (struct devfreq *)p_data->parent; in devfreq_passive_register_notifier()
393 static int devfreq_passive_event_handler(struct devfreq *devfreq, in devfreq_passive_event_handler() argument
397 = (struct devfreq_passive_data *)devfreq->data; in devfreq_passive_event_handler()
403 p_data->this = devfreq; in devfreq_passive_event_handler()
408 ret = devfreq_passive_register_notifier(devfreq); in devfreq_passive_event_handler()
410 ret = cpufreq_passive_register_notifier(devfreq); in devfreq_passive_event_handler()
414 WARN_ON(devfreq_passive_unregister_notifier(devfreq)); in devfreq_passive_event_handler()
416 WARN_ON(cpufreq_passive_unregister_notifier(devfreq)); in devfreq_passive_event_handler()
450 MODULE_DESCRIPTION("DEVFREQ Passive governor");