tegra_cvb_add_opp_table(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… tegra_cvb_add_opp_table(9) β€” Kernel API Manual, bestie edition ✨

okay so. header check: this is tegra_cvb_add_opp_table(9) from the Kernel API Manual, and yes it's exactly as iconic as it sounds. buckle up πŸŽ€


✨ NAME ✨

tegra_cvb_add_opp_table β€” literally builds an OPP table from the Tegra CVB tables πŸ¦‹


🌸 SYNOPSIS 🌸

const struct cvb_table * tegra_cvb_add_opp_table (struct device *dev ,
       const struct cvb_table *tables , size_t count , struct rail_alignment
       *align , int process_id , int speedo_id , int speedo_value , unsigned
       long max_freq );

like yes that's a lot of arguments, but we're gonna get through them together, i promise 🫢


πŸ’– ARGUMENTS πŸ’–

  • dev β€” the struct device * that we're building the OPP table for. it's giving main character energy, honestly πŸ‘‘
  • tables β€” the array of CVB tables. the whole squad 🌈
  • count β€” the size of that array we just mentioned. gotta know how many besties we're working with ✨
  • align β€” the parameters of the regulator step and offset. fancy regulator math, don't worry about it πŸ’…
  • process_id β€” the process id of the HW module πŸ”₯
  • speedo_id β€” the speedo id of the HW module 🩱 (no cap, that's the actual name)
  • speedo_value β€” the speedo value of the HW module ⭐
  • max_freq β€” the highest safe clock rate. the ceiling, the limit, the "don't push it" 🚫

🧚 DESCRIPTION 🧚

so, on Tegra, a CVB table encodes the relationship between operating voltage and safe maximal frequency for a given module (e.g. GPU or CPU). iykyk πŸ’œ

this function calculates the optimal voltage-frequency operating points for the given arguments and exports them via the OPP library for the given dev. it's literally matchmaking but for voltage and frequency 😭

and what does it give back? it returns a pointer to the struct cvb_table that matched, or an ERR_PTR on failure. so like, either you get your match or you get a vibe check that failed πŸ’€


πŸ‘€ SEE ALSO πŸ‘€

  • Kernel file ./drivers/clk/tegra/cvb.c β€” go read it, bestie, it's right there πŸ“–

fr fr: ERR_PTR is not a valid cvb_table pointer, so check that return value before you dereference it. no cap 🚨

and that's the whole page, periodt πŸ’… source is ./drivers/clk/tegra, this is the Kernel API Manual, dated October 2026, and the page itself is tegra_cvb_add_opp_table(9) β€” obsessed with her, honestly πŸŽ€πŸŒΈβœ¨

πŸ“¦ where this page comes from