regulator_set_current_limit(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… regulator_set_current_limit β€” the kernel API manual, bestie edition πŸ’…

So this one is a page from the Kernel API Manual (section 9, kernel-flavored, obviously) and it's literally all about regulator_set_current_limit, iykyk ⚑


✨ NAME ✨

regulator_set_current_limit β€” sets the regulator's output current limit, no cap πŸŽ€


🌸 SYNOPSIS 🌸

int regulator_set_current_limit (struct regulator *regulator , int
min_uA , int max_uA );

πŸ¦‹ ARGUMENTS πŸ¦‹

  • regulator β€” the regulator source, your main character here πŸ‘‘
  • min_uA β€” the minimum supported current, in uA
  • max_uA β€” the maximum supported current, in uA

πŸ’– DESCRIPTION πŸ’–

Okay so what this does: it sets the current sink to the desired output current. And the vibe check on when you can call it? Any regulator state, periodt. IOW, the regulator can be disabled or enabled, doesn't matter, it's giving flexibility ✨

Now here's the cute part β€” timing. If the regulator is enabled, the current changes to the new value immediately. If the regulator is disabled, then it'll output at the new current whenever it gets enabled. Lowkey elegant 🫢


πŸ™ˆ NOTE πŸ™ˆ

Bestie, listen β€” regulator system constraints must be set for this regulator before you call this function. If you don't? The call fails. Not me warning you twice πŸ’€

⭐ RETURN ⭐

0 on success, or a negative error number on failure. That's it, that's the whole return 😌


🌈 SEE ALSO 🌈

The kernel file is ./drivers/regulator/core.c, and here's the whole entourage, fr fr:


Okay that's the whole page, mwah πŸ’‹ This little beauty lives in ./drivers/regulator and it's stamped October 2026 β€” go forth and set those current limits responsibly, bestie πŸ§šπŸ’œ

πŸ“¦ where this page comes from