Lines Matching defs:levels

56  * Number of levels we can handle.  Levels are synthesized from settings
57 * so for M settings and N drivers, there may be M*N levels.
106 static int cf_levels_method(device_t dev, struct cf_level *levels,
140 "Don't provide levels below this frequency.");
190 cpufreq_levels_sysctl, "A", "CPU frequency levels");
193 * Queue a one-shot broadcast that levels have changed.
245 /* We are going to change levels so notify the pre-change handler. */
301 /* Reject levels that are below our specified threshold. */
410 * We changed levels (or attempted to) so notify the post-change
431 /* Returns the index into *levels with the match */
433 cpufreq_get_level(device_t dev, struct cf_level *levels, int count)
440 if (freq == levels[i].total_set.freq)
456 struct cf_level *levels;
464 levels = NULL;
500 levels = malloc(count * sizeof(*levels), M_TEMP, M_NOWAIT);
501 if (levels == NULL)
503 error = CPUFREQ_LEVELS(sc->dev, levels, &count);
507 free(levels, M_TEMP);
520 i = cpufreq_get_level(sc->cf_drv_dev, levels, count);
522 sc->curr_level = levels[i];
545 diff = abs(levels[i].total_set.freq - rate);
548 sc->curr_level = levels[i];
558 if (levels)
559 free(levels, M_TEMP);
631 cf_levels_method(device_t dev, struct cf_level *levels, int *count)
641 if (levels == NULL || count == NULL)
653 * If there are no absolute levels, create a fake one at 100%. We
659 CF_DEBUG("No absolute levels returned by driver\n");
682 /* Create a combined list of absolute + relative levels. */
693 /* Finally, output the list of levels. */
696 /* Skip levels that have a frequency that is too low. */
702 levels[i] = *lev;
709 /* Clear all levels since we regenerate them each time. */
725 * Create levels for an array of absolute settings and insert them in
780 * Expand a group of relative settings, creating derived levels from them.
792 * Walk the set of all existing levels in reverse. This is so we
898 KASSERT(!TAILQ_EMPTY(list), ("all levels list empty in dup set"));
937 struct cf_level *levels;
943 levels = sc->levels_buf;
945 error = CPUFREQ_GET(sc->dev, &levels[0]);
948 freq = levels[0].total_set.freq;
955 * CPUs have equal levels), we call cpufreq_set() on all CPUs.
963 error = CPUFREQ_LEVELS(devs[n], levels, &count);
973 diff = abs(levels[i].total_set.freq - freq);
979 error = CPUFREQ_SET(devs[n], &levels[best], CPUFREQ_PRIO_USER);
992 struct cf_level *levels;
1002 levels = sc->levels_buf;
1003 if (levels == NULL) {
1007 error = CPUFREQ_LEVELS(sc->dev, levels, &count);
1015 set = &levels[i].total_set;
1093 * must offer the same levels and be switched at the same time.