STRUCT REGULATION_CONSTRAINTS(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ 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 fr
  • max_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 it
  • initial_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. the enum regulator_active_discharge values 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