Lines Matching full: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.
107 static int cf_levels_method(device_t dev, struct cf_level *levels,
141 "Don't provide levels below this frequency.");
198 cpufreq_levels_sysctl, "A", "CPU frequency levels");
201 * Queue a one-shot broadcast that levels have changed.
253 /* We are going to change levels so notify the pre-change handler. */
309 /* Reject levels that are below our specified threshold. */
418 * We changed levels (or attempted to) so notify the post-change
439 /* Returns the index into *levels with the match */
441 cpufreq_get_level(device_t dev, struct cf_level *levels, int count)
448 if (freq == levels[i].total_set.freq)
464 struct cf_level *levels;
472 levels = NULL;
508 levels = malloc(count * sizeof(*levels), M_TEMP, M_NOWAIT);
509 if (levels == NULL)
511 error = CPUFREQ_LEVELS(sc->dev, levels, &count);
515 free(levels, M_TEMP);
528 i = cpufreq_get_level(sc->cf_drv_dev, levels, count);
530 sc->curr_level = levels[i];
553 diff = abs(levels[i].total_set.freq - rate);
556 sc->curr_level = levels[i];
566 if (levels)
567 free(levels, M_TEMP);
639 cf_levels_method(device_t dev, struct cf_level *levels, int *count)
649 if (levels == NULL || count == NULL)
661 * If there are no absolute levels, create a fake one at 100%. We
667 CF_DEBUG("No absolute levels returned by driver\n");
690 /* Create a combined list of absolute + relative levels. */
701 /* Finally, output the list of levels. */
704 /* Skip levels that have a frequency that is too low. */
710 levels[i] = *lev;
717 /* Clear all levels since we regenerate them each time. */
733 * Create levels for an array of absolute settings and insert them in
788 * Expand a group of relative settings, creating derived levels from them.
800 * Walk the set of all existing levels in reverse. This is so we
906 KASSERT(!TAILQ_EMPTY(list), ("all levels list empty in dup set"));
945 struct cf_level *levels;
951 levels = sc->levels_buf;
953 error = CPUFREQ_GET(sc->dev, &levels[0]);
956 freq = levels[0].total_set.freq;
963 * CPUs have equal levels), we call cpufreq_set() on all CPUs.
971 error = CPUFREQ_LEVELS(devs[n], levels, &count);
981 diff = abs(levels[i].total_set.freq - freq);
987 error = CPUFREQ_SET(devs[n], &levels[best], CPUFREQ_PRIO_USER);
1000 struct cf_level *levels;
1010 levels = sc->levels_buf;
1011 if (levels == NULL) {
1015 error = CPUFREQ_LEVELS(sc->dev, levels, &count);
1023 set = &levels[i].total_set;
1101 * must offer the same levels and be switched at the same time.