regulator_irq_helper(9)
π regulator_irq_helper(9) β like, the actual manual page, bestie
okay so this is a page from the Kernel API Manual, and it's about regulator_irq_helper β the function that registers your IRQ based regulator event/error notifier. yes it's a lot of words. no I'm not scared of it. let's go π«Ά
β¨ NAME β¨
regulator_irq_helper β register IRQ based regulator event/error notifier
like, it hooks your regulator errors up to an IRQ so you actually hear about them. main character behavior honestly π
πΈ SYNOPSIS πΈ
void * regulator_irq_helper (struct device *dev , const struct
regulator_irq_desc *d , int irq , int irq_flags , int common_errs , int
*per_rdev_errs , struct regulator_dev **rdev , int rdev_amount );
eight arguments. EIGHT. and every single one of them matters, so don't come for me π₯
π ARGUMENTS π
devβ the device providing the IRQs. like, whose IRQs are these? theirs. it's giving source of truth πdβ the IRQ helper descriptor. that's theconst struct regulator_irq_desc *one. it's the blueprint, the vibe documentation, the plan.irqβ the IRQ used to inform events/errors to be notified. this is the actual interrupt line doing the talking π¦irq_flagsβ extra IRQ flags that get OR'ed with the defaultIRQF_ONESHOTwhen requesting the (threaded) irq. so you're adding toIRQF_ONESHOT, not replacing it. noted. don't mess it up πcommon_errsβ errors which can be flagged by this IRQ for all rdevs. when the IRQ is re-enabled these errors will be cleared from all associated regulators. and here's the little tip: use this instead ofper_rdev_errsif you useregulator_irq_map_event_simplefor event mapping. iykyk πper_rdev_errsβ optional error flag array describing errors specific for only some of the regulators. these errors will be or'ed with common errors. if this is given, the array should containrdev_amountflags. can be set toNULLif there is no regulator specific error flags for this IRQ. optional means optional, bestie πrdevβ array of pointers to regulators associated with this IRQ.struct regulator_dev **β yes, double pointer. yes, that's on purpose πrdev_amountβ amount of regulators associated with this IRQ. and remember, this number doubles as the required size ofper_rdev_errs. consistency queen π
β RETURN β
handle to irq_helper or an ERR_PTR encoded negative error number.
so like... check it. please check it. an ERR_PTR encoded negative error number is not a handle and it will not slay for you π
π¦ SEE ALSO π¦
- Kernel file
./drivers/regulator/irq_helpers.cβ go read it, the source is right there, it's literally free π regulator_irq_helper_cancel(9)regulator_irq_map_event_simple(9)
real talk: this page lives in ./drivers/regulator, dated October 2026. that's the footer, that's the vibe, no cap π
periodt. now go register that notifier β¨π§
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms