STRUCT DEVFREQ(9)
okay bestie, this is struct devfreq(9) from the Kernel API Manual โ the whole vibe is the Device devfreq structure, and we're getting into every lil field. ๐
โจ
โจ NAME โจ
struct devfreq โ Device devfreq structure. periodt.
๐ SYNOPSIS ๐
struct devfreq {
struct list_head node;
struct mutex lock;
struct device dev;
struct devfreq_dev_profile *profile;
const struct devfreq_governor *governor;
struct opp_table *opp_table;
struct notifier_block nb;
struct delayed_work work;
unsigned long *freq_table;
unsigned int max_state;
unsigned long previous_freq;
struct devfreq_dev_status last_status;
void *data;
void *governor_data;
struct dev_pm_qos_request user_min_freq_req;
struct dev_pm_qos_request user_max_freq_req;
unsigned long scaling_min_freq;
unsigned long scaling_max_freq;
bool stop_polling;
unsigned long suspend_freq;
unsigned long resume_freq;
atomic_t suspend_count;
struct devfreq_stats stats;
struct srcu_notifier_head transition_notifier_list;
struct thermal_cooling_device *cdev;
struct notifier_block nb_min;
struct notifier_block nb_max;
};
๐ง MEMBERS ๐ง
nodeโ list node โ contains the devices with devfreq that have been registered. ๐งตlockโ a mutex to protect accessing devfreq. ๐devโ device registered by devfreq class.dev.parentis the device using devfreq. ๐ฑprofileโ device-specific devfreq profile. ๐งฌgovernorโ method how to choose frequency based on the usage. ๐๏ธopp_tableโ Reference to OPP table ofdev.parent, if one exists. ๐nbโ notifier block used to notify the devfreq object that it should reevaluate operable frequencies. Devfreq users may usedevfreq.nbto the corresponding register notifier call chain. ๐workโ delayed work for load monitoring. โณfreq_tableโ current frequency table used by the devfreq driver. ๐max_stateโ count of entry present in the frequency table. ๐ขprevious_freqโ previously configured frequency value. ๐ฐ๏ธlast_statusโ devfreq user device info, performance statistics. ๐dataโ devfreq driver pass to governors, governor should not change it. ๐ซgovernor_dataโ private data for governors, devfreq core doesn't touch it. ๐user_min_freq_reqโ PM QoS minimum frequency request from user (via sysfs). ๐งuser_max_freq_reqโ PM QoS maximum frequency request from user (via sysfs). ๐ฅscaling_min_freqโ Limit minimum frequency requested by OPP interface. โฌ๏ธscaling_max_freqโ Limit maximum frequency requested by OPP interface. โฌ๏ธstop_pollingโ devfreq polling status of a device. ๐suspend_freqโ frequency of a device set during suspend phase. ๐ดresume_freqโ frequency of a device set in resume phase. ๐suspend_countโ suspend requests counter for a device. ๐งฎstatsโ Statistics of devfreq device behavior. ๐transition_notifier_listโ list head ofDEVFREQ_TRANSITION_NOTIFIERnotifier. ๐ฆcdevโ Cooling device pointer if the devfreq has cooling property. โ๏ธnb_minโ Notifier block forDEV_PM_QOS_MIN_FREQUENCY. ๐งnb_maxโ Notifier block forDEV_PM_QOS_MAX_FREQUENCY. ๐ฅ
๐ซ DESCRIPTION ๐ซ
This structure stores the devfreq information for a given device. ๐พ
okay so important, bestie: when a governor accesses entries instruct devfreqin its functions โ except for the context of callbacks defined instruct devfreq_governorโ the governor should protect its access with thestruct mutex lockinstruct devfreq. A governor may use this mutex to protect its own private data invoid *dataas well. ๐
๐ฅ SEE ALSO ๐ฅ
- Kernel file
./include/linux/devfreq.hโ also peepstruct devfreq_dev_status(9),struct devfreq_dev_profile(9),struct devfreq_stats(9),struct devfreq_simple_ondemand_data(9),struct devfreq_passive_data(9). ๐
xoxo bestie ๐ โ this page comes from source ./include/linux, dated October 2026, and the version/manual title is struct devfreq(9). slay. ๐
๐ฆ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms