From owner-freebsd-acpi@FreeBSD.ORG Sun Feb 13 18:59:24 2005 Return-Path: Delivered-To: freebsd-acpi@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 341E916A4CE; Sun, 13 Feb 2005 18:59:24 +0000 (GMT) Received: from ylpvm01.prodigy.net (ylpvm01-ext.prodigy.net [207.115.57.32]) by mx1.FreeBSD.org (Postfix) with ESMTP id B989C43D46; Sun, 13 Feb 2005 18:59:23 +0000 (GMT) (envelope-from nate@root.org) Received: from [10.0.0.115] (adsl-64-171-186-189.dsl.snfc21.pacbell.net [64.171.186.189])j1DIxMvE021892; Sun, 13 Feb 2005 13:59:22 -0500 Message-ID: <420FA38A.6080009@root.org> Date: Sun, 13 Feb 2005 10:59:22 -0800 From: Nate Lawson User-Agent: Mozilla Thunderbird 1.0RC1 (X11/20041205) X-Accept-Language: en-us, en MIME-Version: 1.0 To: acpi@FreeBSD.org Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit cc: current@FreeBSD.org Subject: [Fwd: cvs commit: src/sys/dev/acpica acpi_perf.c src/sys/kern kern_cpu.c] X-BeenThere: freebsd-acpi@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: ACPI and power management development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Feb 2005 18:59:24 -0000 The commit below allows acpi_perf(4) to attach to FFixedHW devices and export settings to other drivers (say, EST and Powernow). The code snippet for foo_probe() to do this is as follows: /* Find an acpi_perf child under our common parent. */ device_t child; child = device_find_child(device_get_parent(dev), "acpi_perf", -1); if (child == NULL || !device_is_attached(child)) ... do whatever you can from static tables or fail ... /* Get its settings so we know what frequencies it offers. */ error = CPUFREQ_DRV_SETTINGS(child, sets, &count, &type); if (error) ... fall back to static tables ... /* * If the device is not offering info, it thinks it can control * settings itself. We fail out of our probe in this case since * it is already in charge. */ if ((type & CPUFREQ_FLAG_INFO_ONLY) == 0) return (ENXIO); /* Loop through all settings and match up to our levels */ for () powernow_sets[i].freq = sets[i].freq powernow_sets[i].power = sets[i].power; ... -------- Original Message -------- njl 2005-02-13 18:49:48 UTC FreeBSD src repository Modified files: sys/dev/acpica acpi_perf.c sys/kern kern_cpu.c Log: 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. Revision Changes Path 1.7 +39 -12 src/sys/dev/acpica/acpi_perf.c 1.4 +8 -1 src/sys/kern/kern_cpu.c -- Nate