#1# Copyright (c) 2004 Nate Lawson2# All rights reserved.3#4# Redistribution and use in source and binary forms, with or without5# modification, are permitted provided that the following conditions6# are met:7# 1. Redistributions of source code must retain the above copyright8# notice, this list of conditions and the following disclaimer.9# 2. Redistributions in binary form must reproduce the above copyright10# notice, this list of conditions and the following disclaimer in the11# documentation and/or other materials provided with the distribution.12#13# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND14# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE15# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE16# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE17# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL18# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS19# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)20# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT21# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY22# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF23# SUCH DAMAGE.24#25#2627#include <sys/bus.h>2829INTERFACE cpufreq;3031HEADER {32struct cf_level;33struct cf_setting;34};3536# cpufreq interface methods3738#39# Set the current CPU frequency level.40#41METHOD int set {42device_t dev;43const struct cf_level *level;44int priority;45};4647#48# Get the current active level.49#50METHOD int get {51device_t dev;52struct cf_level *level;53};5455#56# Get the current possible levels, based on all drivers.57#58METHOD int levels {59device_t dev;60struct cf_level *levels;61int *count;62};6364# Individual frequency driver methods6566#67# Set an individual driver's setting.68#69METHOD int drv_set {70device_t dev;71const struct cf_setting *set;72};7374#75# Get an individual driver's setting.76#77METHOD int drv_get {78device_t dev;79struct cf_setting *set;80};8182#83# Get the settings supported by a driver.84#85METHOD int drv_settings {86device_t dev;87struct cf_setting *sets;88int *count;89};9091#92# Get an individual driver's type.93#94METHOD int drv_type {95device_t dev;96int *type;97};9899100101