dev_pm_opp_set_config(9)
β¨ dev_pm_opp_set_config(9) β¨
okay so real talk bestie, this is a page from the Kernel API Manual and it's literally the glow-up cheat sheet for telling the kernel how a device's OPPs work π (OPP = operating performance points, iykyk). One call, all the config, no scrambling around. Obsessed.
π SYNOPSIS π
int dev_pm_opp_set_config (struct device *dev , struct dev_pm_opp_config
*config );
πΈ ARGUMENTS πΈ
devβ thestruct deviceyou're setting the config up for. Your main character device, basically π«Άconfigβ the OPP configuration itself. This is the whole vibe package π
π¦ DESCRIPTION π¦
So here's the tea: this function lets all of the device OPP configurations get done at once. One call, everything handled, no twenty separate setup steps. We love efficiency π
Timing matters, ngl: you must call this before any OPPs are initialized for the device. Not after, not "eh, close enough". Before. π
Also very valid: you can call this multiple times for the same OPP table β like, once for each CPU that shares the same table. Very "share the aux" energy π§
But heads up, every single one of those calls has to be balanced by the same number of calls to dev_pm_opp_clear_config so the OPP table can be freed properly. Cleanup is not optional, bestie π
When it's done, it hands a token back to the caller. You keep that token and pass it to dev_pm_opp_clear_config later to free the resources. The value of the returned token will be >= 1 for success and negative for errors. And why 1 as the minimum? Because it makes it easy for callers to manage the resource β thoughtful king behavior πβ¨
π₯ SEE ALSO π₯
Everything else in the OPP cinematic universe:
- Kernel file
./drivers/opp/core.c _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_rate(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_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)
and that's the whole page, bestie π straight from ./drivers/opp, dated October 2026, and we're back on dev_pm_opp_set_config(9) β go forth and configure responsibly π§ββοΈβ¨
π¦ 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