STRUCT REGULATOR_COUPLER(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… struct regulator_coupler(9) β€” kernel API manual, bestie edition ✨

okay so this is a page straight out of the Kernel API Manual, and it's all about struct regulator_coupler β€” the little struct that lets you have a customized regulator's coupler πŸŽ€ ngl it's niche but it ate.


🌸 NAME 🌸

struct regulator_coupler β€” a customized regulator's coupler, fr fr πŸ’–


✨ SYNOPSIS ✨

here's the whole thing, copied exactly, no cap:

struct regulator_coupler {
    struct list_head list;
    int (*attach_regulator)(struct regulator_coupler *coupler, struct
regulator_dev *rdev);
    int (*detach_regulator)(struct regulator_coupler *coupler, struct
regulator_dev *rdev);
    int (*balance_voltage)(struct regulator_coupler *coupler, struct
regulator_dev *rdev, suspend_state_t state);
 };

like, look at those function pointers 🫢 iconic behavior honestly.


πŸ¦‹ Members πŸ¦‹

  • list β€” couplers list entry. that's it, that's the whole vibe, it's just the list entry bestie πŸ’…
  • attach_regulator β€” the callback that gets invoked on creation of a coupled regulator. ⚠️ important: couples are unresolved at this point. so the callee should check that it could handle the regulator, and then return 0 on success, -errno on failure, and 1 if the given regulator is not suitable for this coupler (which is the case of having multiple regulators in a system, iykyk). and heads up β€” this callback shall be implemented. like it's not optional, periodt πŸ‘‘
  • detach_regulator β€” the callback invoked on destruction of a coupled regulator. this one is optional and could be NULL πŸ™ˆ lowkey the chill one of the group.
  • balance_voltage β€” the callback invoked when the voltage of a coupled regulator is changing. it gets called with all of the coupled rdev's being held under "consumer lock" πŸ”’. the callee should perform voltage balancing, changing the voltage of the coupled regulators as needed. and it's up to the coupler to verify the voltage before changing it in hardware β€” i.e. the coupler should check consumer's min/max and etc. this callback is optional and could be NULL, in which case a generic voltage balancer will be used. so like, if you don't show up, the generic one shows up for you, no stress 🌈

πŸ’œ Description πŸ’œ

Regulator's coupler allows to customize the coupling algorithm. that's the whole thesis statement, bestie β€” it's the customization hook πŸŽ€


πŸ”₯ SEE ALSO πŸ”₯

  • Kernel file ./include/linux/regulator/coupler.h β€” go read it, it's giving main character energy πŸ‘‘

ok that's the page!! every flag, every return value, every NULL, all of it preserved, nothing skipped 🫢

and that's a wrap on this ./include/linux/regulator situation, October 2026 edition ⭐ thanks for reading my little manpage era, mwah πŸ’–πŸ§šβ€β™€οΈπŸ’œ

πŸ“¦ where this page comes from