Lines Matching refs:levels
107 static int cf_levels_method(device_t dev, struct cf_level *levels,
441 cpufreq_get_level(device_t dev, struct cf_level *levels, int count) in cpufreq_get_level() argument
448 if (freq == levels[i].total_set.freq) in cpufreq_get_level()
464 struct cf_level *levels; in cf_get_method() local
472 levels = NULL; in cf_get_method()
508 levels = malloc(count * sizeof(*levels), M_TEMP, M_NOWAIT); in cf_get_method()
509 if (levels == NULL) in cf_get_method()
511 error = CPUFREQ_LEVELS(sc->dev, levels, &count); in cf_get_method()
515 free(levels, M_TEMP); in cf_get_method()
528 i = cpufreq_get_level(sc->cf_drv_dev, levels, count); in cf_get_method()
530 sc->curr_level = levels[i]; in cf_get_method()
553 diff = abs(levels[i].total_set.freq - rate); in cf_get_method()
556 sc->curr_level = levels[i]; in cf_get_method()
566 if (levels) in cf_get_method()
567 free(levels, M_TEMP); in cf_get_method()
639 cf_levels_method(device_t dev, struct cf_level *levels, int *count) in cf_levels_method() argument
649 if (levels == NULL || count == NULL) in cf_levels_method()
710 levels[i] = *lev; in cf_levels_method()
945 struct cf_level *levels; in cpufreq_curr_sysctl() local
951 levels = sc->levels_buf; in cpufreq_curr_sysctl()
953 error = CPUFREQ_GET(sc->dev, &levels[0]); in cpufreq_curr_sysctl()
956 freq = levels[0].total_set.freq; in cpufreq_curr_sysctl()
971 error = CPUFREQ_LEVELS(devs[n], levels, &count); in cpufreq_curr_sysctl()
981 diff = abs(levels[i].total_set.freq - freq); in cpufreq_curr_sysctl()
987 error = CPUFREQ_SET(devs[n], &levels[best], CPUFREQ_PRIO_USER); in cpufreq_curr_sysctl()
1000 struct cf_level *levels; in cpufreq_levels_sysctl() local
1010 levels = sc->levels_buf; in cpufreq_levels_sysctl()
1011 if (levels == NULL) { in cpufreq_levels_sysctl()
1015 error = CPUFREQ_LEVELS(sc->dev, levels, &count); in cpufreq_levels_sysctl()
1023 set = &levels[i].total_set; in cpufreq_levels_sysctl()