STRUCT REGULATOR_CONFIG(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– struct regulator_config(9) πŸ’–

okay bestie, welcome to the Kernel API Manual β€” this is the page for struct regulator_config, and it's lowkey the glow-up page for Dynamic regulator descriptor. yes, that's the NAME. slay.


✨ SYNOPSIS ✨

like, here's the whole struct, exactly as it lives, no cap:

struct regulator_config {
    struct device *dev;
    const struct regulator_init_data *init_data;
    void *driver_data;
    struct device_node *of_node;
    struct regmap *regmap;
    struct gpio_desc *ena_gpiod;
 };

she's compact, she's iconic, she's six fields of main character energy. πŸŽ€


πŸ¦‹ Members πŸ¦‹

okay so let's meet the cast, one by one:

  • dev β€” the struct device for the regulator. the home address, the vibe check, the whole identity. πŸ’…
  • init_data β€” platform provided init data, passed through by driver. it's giving "handed down from above," and we respect it. ✨
  • driver_data β€” private regulator data. that's your stuff, bestie, nobody else's business. πŸ™ˆ
  • of_node β€” OpenFirmware node to parse for device tree bindings (may be NULL). yes, she can be NULL, and that's valid, don't panic. 🌸
  • regmap β€” regmap to use for core regmap helpers if dev_get_regmap is insufficient. the backup plan that absolutely eats. πŸ”₯
  • ena_gpiod β€” GPIO controlling regulator enable. the little on/off switch with big responsibilities. ⭐

πŸ’œ Description πŸ’œ

so the way this works: each regulator registered with the core is described with a structure of this type and a struct regulator_desc. two structs, one destiny, iykyk. 🫢

this structure contains the runtime variable parts of the regulator description β€” the stuff that changes at runtime while struct regulator_desc handles the rest. lowkey a perfect little division of labour. πŸ’–


🌈 SEE ALSO 🌈

go read these next, bestie, they're all in the kernel file ./include/linux/regulator/driver.h:

  • struct regulator_ops(9)
  • struct regulator_desc(9)
  • struct regulator_err_state(9)
  • struct regulator_irq_data(9)
  • struct regulator_irq_desc(9)

ok real talk β€” this page came out of ./include/linux/regulator, it's dated October 2026, and it's part of the Kernel API Manual. mwah, that's the sign-off. periodt. πŸ’‹πŸ‘‘
πŸ“¦ where this page comes from