STRUCT REGULATOR_IRQ_DESC(9)
β¨ STRUCT REGULATOR_IRQ_DESC(9) β¨
okay bestie, welcome to the Kernel API Manual entry for struct regulator_irq_desc(9) and honestly? it's giving "the group chat that tells everyone when something goes wrong" π
this thing is the notification sender for IRQ based events, and it's lowkey the main character of regulator error handling π₯
πΈ NAME πΈ
struct regulator_irq_desc β notification sender for IRQ based events. that's it, that's the vibe π
π¦ SYNOPSIS π¦
struct regulator_irq_desc {
const char *name;
int fatal_cnt;
int reread_ms;
int irq_off_ms;
bool skip_off;
bool high_prio;
void *data;
int (*die)(struct regulator_irq_data *rid);
int (*map_event)(int irq, struct regulator_irq_data *rid, unsigned
long *dev_mask);
int (*renable)(struct regulator_irq_data *rid);
};
copy that exactly, bestie β no cap, every character matters π€
π Members π
okay so here's the cast of characters, and they ALL have lore π«Ά
nameβ the visible name for the IRQ. literally its government name β¨fatal_cntβ so if this IRQ is used to signal a HW damaging condition, it may be best to shut-down regulator(s) or reboot the SOC if error handling is repeatedly failing. iffatal_cntis given, the IRQ handling is aborted if it fails forfatal_cnttimes and thediecallback (if populated) is called. and ifdieis not populated, poweroff for the system is attempted in order to prevent any further damage. that's the dramatic part, and it's real πreread_msβ the time which is waited before attempting to re-read status at the worker if IC reading fails. immediate re-read is done if time is not specified. so: no number = no waiting, it just goes πββοΈirq_off_msβ the time which IRQ is kept disabled before re-evaluating the status for devices which keep IRQ disabled for duration of the error. if this is not given, the IRQ is left enabled andrenableis not called. important!! πskip_offβ if set totrue, the IRQ handler will attempt to check if any of the associated regulators are enabled prior to taking other actions. if no regulators are enabled and this is set totrue, a spurious IRQ is assumed andIRQ_NONEis returned. spurious IRQ said "not me, not my problem" πhigh_prioβ boolean to indicate that high priority WQ should be used. high priority work queue, because this girl does not do lines βdataβ driver private data pointer which will be passed as such to therenable,map_eventanddiecallbacks inregulator_irq_data. it's the little bag she carries everywhere πdieβ protection callback. if IC status reading or recovery actions failfatal_cnttimes, this callback is called or the system is powered off. this callback should implement a final protection attempt like disabling the regulator. if protection succeeded,diemay return0. if anything else is returned, the core assumes final protection failed and attempts to perform a poweroff as a last resort. so like... zero means slay, anything else means π―οΈπ―οΈπ―οΈmap_eventβ driver callback to map IRQ status into regulator devices with events / errors. NOTE: callback MUST initialize both theerrorsandnotifsfor all rdevs which it signals having active events, as core does not clean the map data.REGULATOR_FAILED_RETRYcan be returned to indicate that the status reading from IC failed. if this is repeated forfatal_cnttimes, the core will call thediecallback or power-off the system as a last resort to protect the HW. read that NOTE again bestie, it's not decorative πrenableβ optional callback to check status (if HW supports that) before re-enabling IRQ. if implemented, this should clear the error flags so that errors fetched byregulator_get_error_flagsare updated. if callback is not implemented, then errors are assumed to be cleared and IRQ is re-enabled.REGULATOR_FAILED_RETRYcan be returned to indicate that the status reading from IC failed. if this is repeated for'fatal_cnt'times, the core will call thediecallback or, ifdieis not populated, then attempt to power-off the system as a last resort to protect the HW. returning zero indicates that the problem in HW has been solved and IRQ will be re-enabled. returningREGULATOR_ERROR_ONindicates the error condition is still active and keeps IRQ disabled. please note that returningREGULATOR_ERROR_ONdoes not retrigger evaluating what events are active or resending notifications. if this is needed, you probably want to return zero and allow IRQ to retrigger, causing events to be re-evaluated and re-sent. that's the whole plot twist right there π
π Description π
this structure is used for registering regulator IRQ notification helper. short and sweet β it's the ~registration form~ for the whole notification situation π
π 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_data(9)
go read those too, iykyk π
okay that's the whole page π«Ά this came out of ./include/linux/regulator, dated October 2026, and it's still struct regulator_irq_desc(9) β she said "same name, same energy" π
β¨ bye bestie, go write some safe regulators π¦π
π¦ 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