STRUCT DEVFREQ_DEV_PROFILE(9)
π struct devfreq_dev_profile(9) π
okay so bestie, welcome to the Kernel API Manual β¨ and buckle up, because this one's all about struct devfreq_dev_profile β literally the glow-up plan your device hands to devfreq so it knows how to be managed. it's giving "here's my whole personality, please govern me" π«Ά
πΈ NAME πΈ
struct devfreq_dev_profile β Devfreq's user device profile π
β¨ SYNOPSIS β¨
struct devfreq_dev_profile {
unsigned long initial_freq;
unsigned int polling_ms;
enum devfreq_timer timer;
int (*target)(struct device *dev, unsigned long *freq, u32 flags);
int (*get_dev_status)(struct device *dev, struct devfreq_dev_status
*stat);
int (*get_cur_freq)(struct device *dev, unsigned long *freq);
void (*exit)(struct device *dev);
unsigned long *freq_table;
unsigned int max_state;
bool is_cooling_device;
const struct attribute_group **dev_groups;
};
like, that's the whole vibe right there π
π Members π
initial_freqβ the operating frequency at the momentdevfreq_add_devicegets called. the "hi nice to meet you" frequency πΈpolling_msβ the polling interval, measured in ms. set it to0and polling is disabled, no cap π«timerβ the timer type, and it's either a deferrable timer or a delayed timer. pick your fighter β°targetβ the main character callback, fr. your device is supposed to set its operating frequency atfreqor at the lowest-upper-than-freqvalue. iffreqis higher than any frequency it can actually operate at, then set maximum. and before it returns, thetargetfunction should setfreqto the current frequency. the"flags"parameter's possible values are explained above with the"DEVFREQ_FLAG_*"macros ππ₯get_dev_statusβ your device should hand devfreq its current performance status here. governors are recommended not to use this one directly β instead, governors are recommended to usedevfreq_update_statsalong withdevfreq.last_status. iykyk πget_cur_freqβ your device should provide the current frequency it's operating at. simple, iconic, does what it says π«exitβ an optional callback, called when devfreq is removing the devfreq object because of an error, or from adevfreq_remove_devicecall. and if the user has registereddevfreq->nbat a notifier-head, this is the time to unregister it. like, this is your moment, do the cleanup π§Ήfreq_tableβ an optional list of frequencies, used to support statistics β and heads up,freq_tablemust be generated in ascending order β¬οΈβ¨max_stateβ the size offreq_table, periodt πis_cooling_deviceβ a self-explanatory boolean that gives the device a cooling effect property. it's giving "yes i run cool, literally" βοΈdev_groupsβ optional device-specific sysfs attribute groups that are to be attached to the devfreq device π
π¦ SEE ALSO π¦
Kernel file ./include/linux/devfreq.h β struct devfreq_dev_status(9), struct devfreq_stats(9), struct devfreq(9), struct devfreq_simple_ondemand_data(9), struct devfreq_passive_data(9) β go read all of them, bestie, they're all linked in the group chat ππ
and that's the whole page π«Ά it lives over in ./include/linux, and this version is dated October 2026 β slay, see you next kernel cycle β¨π
π₯
π¦ 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