dev_pm_opp_set_rate(9)
π dev_pm_opp_set_rate(9) π
okay so bestie, welcome to another episode of the Kernel API Manual, and today's main character is dev_pm_opp_set_rate β it's giving "let me set your vibe (and by vibe I mean frequency) correctly" energy. π¦
β¨ NAME β¨
dev_pm_opp_set_rate β configure a new OPP based on frequency. periodt, that's the whole name, no notes. π
πΈ SYNOPSIS πΈ
int dev_pm_opp_set_rate (struct device *dev , unsigned long target_freq
);
literally that's it. two arguments, one int coming back at you. π
π ARGUMENTS π
devβ the device we're doing this whole operation for. like, who is this for? this device. π«Άtarget_freqβ the frequency we're trying to actually achieve. the goal. the dream. the target. β¨
π DESCRIPTION π
so here's the tea, bestie: this function configures the power-supplies to the levels specified by the OPP that corresponds to target_freq, and then it programs the clock to a value <= target_freq, as rounded by clk_round_rate. π
and lowkey important: a device that wants to run at fmax provided by the opp should already have rounded to the target OPP's frequency. no cap, do that part first or the vibes will be off. π
π¦ SEE ALSO π¦
Kernel file ./drivers/opp/core.c π« and, like, an entire friend group:
_find_opp_table(9)dev_pm_opp_get_bw(9)dev_pm_opp_get_voltage(9)dev_pm_opp_get_supplies(9)dev_pm_opp_get_power(9)dev_pm_opp_get_freq_indexed(9)dev_pm_opp_get_level(9)dev_pm_opp_get_required_pstate(9)dev_pm_opp_is_turbo(9)dev_pm_opp_get_max_clock_latency(9)dev_pm_opp_get_max_volt_latency(9)dev_pm_opp_get_max_transition_latency(9)dev_pm_opp_get_suspend_opp_freq(9)dev_pm_opp_get_opp_count(9)dev_pm_opp_find_freq_exact(9)dev_pm_opp_find_key_exact(9)dev_pm_opp_find_freq_exact_indexed(9)dev_pm_opp_find_freq_ceil(9)dev_pm_opp_find_freq_ceil_indexed(9)dev_pm_opp_find_freq_floor(9)dev_pm_opp_find_freq_floor_indexed(9)dev_pm_opp_find_level_exact(9)dev_pm_opp_find_level_ceil(9)dev_pm_opp_find_level_floor(9)dev_pm_opp_find_bw_ceil(9)dev_pm_opp_find_bw_floor(9)dev_pm_opp_set_opp(9)dev_pm_opp_remove(9)dev_pm_opp_remove_all_dynamic(9)_opp_add_v1(9)dev_pm_opp_set_config(9)dev_pm_opp_clear_config(9)devm_pm_opp_set_config(9)dev_pm_opp_xlate_required_opp(9)dev_pm_opp_xlate_performance_state(9)dev_pm_opp_add_dynamic(9)_opp_set_availability(9)dev_pm_opp_adjust_voltage(9)dev_pm_opp_sync_regulators(9)dev_pm_opp_enable(9)dev_pm_opp_disable(9)dev_pm_opp_register_notifier(9)dev_pm_opp_unregister_notifier(9)dev_pm_opp_remove_table(9)
fr fr, that's a whole squad. go say hi. π«Ά
βΏ and that's the page, bestie βΏ
signing off from ./drivers/opp, dated October 2026, still serving kernel API realness ππβ¨
π¦ 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