STRUCT REGULATOR_IRQ_DATA(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

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

okay so bestie, welcome to the Kernel API Manual β€” today's main character is struct regulator_irq_data, and it's literally the glow-up data holder for regulator error/notification status. yes. that. πŸŽ€


✨ NAME ✨

struct regulator_irq_data β€” the regulator error/notification status data struct. it's giving "I hold the receipts" energy. πŸ§ΎπŸ’…


πŸ¦‹ SYNOPSIS πŸ¦‹

struct regulator_irq_data {
    struct regulator_err_state *states;
    int num_states;
    void *data;
    long opaque;
 };

no cap, that's the whole vibe. four fields, zero drama (until the IRQ fires, anyway 😭).


🌸 Members 🌸

  • states β€” the status structs, one for each of the associated regulators. every regulator gets its own little status buddy 🫢
  • num_states β€” how many associated regulators there are. the headcount, fr fr.
  • data β€” the driver data pointer that was given at regulator_irq_desc. it's the driver's stuff, being handed back. πŸ”₯
  • opaque β€” value storage for the IC driver. the core does not update this β€” say it with me, the core does not update this. it's yours, IC drivers πŸ‘‘

so here's the tea: ICs may want to store the status register value here at map_event, and then compare the contents at the 'renable' callback to see if new problems have been added to status. and if that's the case? it may be desirable to return REGULATOR_ERROR_CLEARED and not REGULATOR_ERROR_ON, which allows the IRQ to fire again and to generate notifications also for the new issues. iconic behavior tbh ✨


πŸ’œ Description πŸ’œ

this structure is passed to the 'map_event' and 'renable' callbacks for reporting regulator status to core. that's it, that's the whole job, and it does it flawlessly. periodt. πŸ’…


πŸ‘‘ SEE ALSO πŸ‘‘

  • Kernel file ./include/linux/regulator/driver.h struct regulator_ops(9)
  • struct regulator_desc(9)
  • struct regulator_config(9)
  • struct regulator_err_state(9)
  • struct regulator_irq_desc(9)

go read those, iykyk 🌈


and that's a wrap, bestie!! πŸŽ€ this little masterpiece lives at ./include/linux/regulator and it's dated October 2026 β€” go off, struct regulator_irq_data(9), you ate. πŸ’–πŸ¦‹βœ¨

πŸ“¦ where this page comes from