_opp_add_v1(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– _opp_add_v1 πŸ’–

okay so bestie, welcome to the Kernel API Manual ✨ β€” this is the page for _opp_add_v1, and yes we're gonna get into it 🫢


✨ NAME ✨

_opp_add_v1 β€” allocate a OPP based on v1 bindings πŸ’…


πŸ¦‹ SYNOPSIS πŸ¦‹

int _opp_add_v1 (struct opp_table *opp_table , struct device *dev ,
       struct dev_pm_opp_data *data , bool dynamic );

like, that's the whole signature, no cap πŸ”₯


πŸŽ€ ARGUMENTS πŸŽ€

  • opp_table β€” the OPP table, bestie. the actual table we're doing stuff to πŸ’–
  • dev β€” the device we're doing this operation for πŸ‘‘
  • data β€” the OPP data for the OPP we're adding, literally the payload πŸ“¦
  • dynamic β€” dynamically added OPPs ✨

🌸 DESCRIPTION 🌸

so what this does is it adds an opp definition to the opp table and returns a status. that's it, that's the vibe πŸ’…

the opp is made available by default β€” like it's just there, main character energy β€” and it can be controlled using the dev_pm_opp_enable/dev_pm_opp_disable functions, and it may be removed by dev_pm_opp_remove. slay 🌈


πŸ™ˆ NOTE πŸ™ˆ

heads up bestie: the dynamic parameter impacts OPPs added by the dev_pm_opp_of_add_table and freed by dev_pm_opp_of_remove_table. iykyk ⭐

πŸ”₯ RETURN πŸ”₯

  • 0 β€” on success OR duplicate OPPs (both freq and volt are same) and opp->available βœ…
  • -EEXIST β€” freq are same and volt are different OR duplicate OPPs (both freq and volt are same) and !opp->available πŸ’€
  • -ENOMEM β€” memory allocation failure 😭

🧚 SEE ALSO 🧚

kernel file ./drivers/opp/core.c and, omg, the whole friend group 🫢:


that's the whole page bestie, go forth and add your OPPs πŸ’œ

and for the record, this little gem lives in ./drivers/opp and it's dated October 2026 β€” periodt πŸŽ€πŸ’…βœ¨

πŸ“¦ where this page comes from