From db1d2335dc7a9b2d42bf4e84fe48b7eb13d1b5ca Mon Sep 17 00:00:00 2001 From: njl Date: Sun, 13 Feb 2005 18:49:48 +0000 Subject: Add support for the CPUFREQ_FLAG_INFO_ONLY flag. Devices that report this are not added to the list(s) of available settings. However, other drivers can call the CPUFREQ_DRV_SETTINGS() method on those devices directly to get info about available settings. Update the acpi_perf(4) driver to use this flag in the presence of "functional fixed hardware." Thus, future drivers like Powernow can query acpi_perf for platform info but perform frequency transitions themselves. --- sys/kern/kern_cpu.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'sys/kern/kern_cpu.c') diff --git a/sys/kern/kern_cpu.c b/sys/kern/kern_cpu.c index c058ead..ff1d006 100644 --- a/sys/kern/kern_cpu.c +++ b/sys/kern/kern_cpu.c @@ -348,13 +348,20 @@ cf_levels_method(device_t dev, struct cf_level *levels, int *count) /* Get settings from all cpufreq drivers. */ for (i = 0; i < numdevs; i++) { + /* Skip devices that aren't ready. */ if (!device_is_attached(devs[i])) continue; + + /* + * Get settings, skipping drivers that offer no settings or + * provide settings for informational purposes only. + */ set_count = MAX_SETTINGS; error = CPUFREQ_DRV_SETTINGS(devs[i], sets, &set_count, &type); - if (error || set_count == 0) + if (error || set_count == 0 || (type & CPUFREQ_FLAG_INFO_ONLY)) continue; + /* Add the settings to our absolute/relative lists. */ switch (type & CPUFREQ_TYPE_MASK) { case CPUFREQ_TYPE_ABSOLUTE: error = cpufreq_insert_abs(sc, sets, set_count); -- cgit v1.1