regulator_get_voltage(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… regulator_get_voltage(9) β€” get regulator output voltage

okay so real talk: this is a page straight out of the Kernel API Manual, and the star of the show is regulator_get_voltage(9). she's a tiny little function with one job and honestly? she ate. let's get into it 🫢


✨ SYNOPSIS ✨

int regulator_get_voltage (struct regulator *regulator );

like yes that's the whole signature, no cap. one argument, one int coming back at you πŸ’–


πŸŽ€ ARGUMENTS πŸŽ€

  • regulator β€” your regulator source, bestie. that's the thing you're asking about. that's the main character of this call 🌸

⭐ RETURN ⭐

so what do you get back? two possible vibes:

  • the current regulator voltage in uV β€” slay, that's your answer πŸ’…
  • or a negative error number on failure β€” not slay, something went wrong 😭

that's it. that's the return value.


πŸ’€ NOTE πŸ’€

okay this part is important, do NOT skip it πŸ™ˆ

if the regulator is disabled, this function will still return the voltage value. yes, fr fr. so heads up:

this function should not be used to determine regulator state.

like, don't use voltage readings to figure out if something's on or off. that's not what she's for, that's not her job, she's just here to report a number. periodt. πŸ‘‘


🌈 SEE ALSO 🌈

the extended universe, aka the whole regulator friend group. and when i say the whole group i mean the WHOLE group, so buckle up πŸ¦‹

these all live in the kernel file ./drivers/regulator/core.c:

like... that's the whole group chat and every single one of them is in there πŸ’œ


and that's the page, bestie!! πŸŽ€ this lil gem lives under ./drivers/regulator, dated October 2026, and yes the page is literally named regulator_get_voltage(9) β€” go read her friends too, iykyk ✨πŸ”₯

πŸ“¦ where this page comes from