dev_pm_opp_set_rate(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– 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:

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