STRUCT REGULATION_CONSTRAINTS(9)
β¨ struct regulation_constraints(9) β¨
okay so bestie, welcome to the Kernel API Manual π this one's all about struct regulation_constraints and honestly? it's giving "the vibe check for your regulator" π
πΈ NAME πΈ
struct regulation_constraints β regulator operating constraints. literally the rulebook for how your regulator is allowed to behave, no cap π
π¦ SYNOPSIS π¦
struct regulation_constraints {
const char *name;
int min_uV;
int max_uV;
int uV_offset;
int min_uA;
int max_uA;
int ilim_uA;
int pw_budget_mW;
int system_load;
u32 *max_spread;
int max_uV_step;
unsigned int valid_modes_mask;
unsigned int valid_ops_mask;
int input_uV;
struct regulator_state state_disk;
struct regulator_state state_mem;
struct regulator_state state_standby;
struct notification_limit over_curr_limits;
struct notification_limit over_voltage_limits;
struct notification_limit under_voltage_limits;
struct notification_limit temp_limits;
suspend_state_t initial_state;
unsigned int initial_mode;
unsigned int ramp_delay;
unsigned int settling_time;
unsigned int settling_time_up;
unsigned int settling_time_down;
unsigned int enable_time;
unsigned int uv_less_critical_window_ms;
unsigned int active_discharge;
unsigned always_on:1;
unsigned boot_on:1;
unsigned apply_uV:1;
unsigned ramp_disable:1;
unsigned soft_start:1;
unsigned pull_down:1;
unsigned system_critical:1;
unsigned over_current_protection:1;
unsigned over_current_detection:1;
unsigned over_voltage_detection:1;
unsigned under_voltage_detection:1;
unsigned over_temp_detection:1;
};
π Members π
okay this is the part where we go field by field, buckle up π«Ά
nameβ a descriptive name for the constraints, used for display purposes. it's the little label so you know who's who πmin_uVβ smallest voltage consumers may set.max_uVβ largest voltage consumers may set.uV_offsetβ offset applied to voltages from consumer to compensate for voltage drops. like a little correction for the drip π (voltage drip. voltage drop. iykyk)min_uAβ smallest current consumers may set.max_uAβ largest current consumers may set.ilim_uAβ maximum input current.pw_budget_mWβ power budget for the regulator, in mW. budget girlies stay on top πsystem_loadβ load that isn't captured by any consumer requests. the sneaky background load fr frmax_spreadβ max possible spread between coupled regulators.max_uV_stepβ max possible step change in voltage.valid_modes_maskβ mask of modes which may be configured by consumers.valid_ops_maskβ operations which may be performed by consumers.input_uVβ input voltage for the regulator when it's supplied by another regulator. regulator-ception πstate_diskβ state for the regulator when the system is suspended in disk mode.state_memβ state for the regulator when the system is suspended in mem mode.state_standbyβ state for the regulator when the system is suspended in standby mode.over_curr_limitsβ limits for acting on over current.over_voltage_limitsβ limits for acting on over voltage.under_voltage_limitsβ limits for acting on under voltage.temp_limitsβ limits for acting on over temperature. π‘οΈ yes she runs hot, we're handling itinitial_stateβ suspend state to set by default.initial_modeβ mode to set at startup.ramp_delayβ time to settle down after voltage change (unit: uV/us)settling_timeβ time to settle down after voltage change when the voltage change is non-linear (unit: microseconds).settling_time_upβ time to settle down after voltage increase when the voltage change is non-linear (unit: microseconds).settling_time_downβ time to settle down after voltage decrease when the voltage change is non-linear (unit: microseconds).enable_timeβ turn-on time of the rails (unit: microseconds).uv_less_critical_window_msβ specifies the time window (in milliseconds) following a critical under-voltage (UV) event during which less critical actions can be safely carried out by the system (for example logging). after this time window more critical actions should be done (for example prevent HW damage). β οΈ so like... log fast, bestie, the clock is literally ticking πactive_dischargeβ enable/disable active discharge. theenum regulator_active_dischargevalues are used for initialisation.always_onβ set if the regulator should never be disabled.boot_onβ set if the regulator is enabled when the system is initially started. if the regulator is not enabled by the hardware or bootloader then it will be enabled when the constraints are applied.apply_uVβ apply the voltage constraint when initialising.ramp_disableβ disable ramp delay when initialising or when setting voltage.soft_startβ enable soft start so that voltage ramps slowly. gentle. demure. mindful π§pull_downβ enable pull down when the regulator is disabled.system_criticalβ set if the regulator is critical to system stability or functionality. main character energy, do not touch π₯over_current_protectionβ auto disable on over current event.over_current_detectionβ configure over current limits.over_voltage_detectionβ configure over voltage limits.under_voltage_detectionβ configure under voltage limits.over_temp_detectionβ configure over temperature limits.
π Description π
this struct describes regulator and board/machine specific constraints. that's the whole glow-up: it's where the regulator meets your specific board and machine, and everybody learns the house rules π
β SEE ALSO β
- Kernel file
./include/linux/regulator/machine.h struct regulator_state(9)struct regulator_consumer_supply(9)struct regulator_init_data(9)
go read these next, bestie, they're all in the same friend group π«Ά
<aqua>okay that's the whole page!! mwah π this dropped from ./include/linux/regulator in October 2026, so if you're reading it any later than that, hi from the past, hope your rails are stable πΈβ¨</aqua>
π¦ 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