Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

/sys/class/regulator

FieldValue
Subsystemregulator core, drivers/regulator/core.c (regulator_class)
Config gateCONFIG_REGULATOR (obj-$(CONFIG_REGULATOR) += core.o ... in drivers/regulator/Makefile, torvalds/linux master)
ABI documentationDocumentation/ABI/testing/sysfs-class-regulator
Since2.6.26 (most entries); 2.6.28 (name); 3.7 (bypass); 5.18 (fault and warning flags)
Live (5.10.134 host)class absent: no regulator registered in the container
Ledger IDSYSC-regulator

What it represents

One directory per voltage or current regulator registered with the regulator framework (PMIC rails, LDOs, DC-DC converters, fixed supplies). The interface is deliberately a read-only status and constraint report: consumers control regulators through the kernel API (regulator_enable(), constraints from machine description), and sysfs shows what was configured. The ABI spells directories as /sys/class/regulator/.../; each holds the attributes its hardware can report.

Relationship to the device model

Each regulator entry is a class view of a device under /sys/devices/... (usually an i2c/spi PMIC or a fixed-voltage platform device). The parent attribute is a symlink to the supplying regulator, expressing the supply tree. No regulator bus and no char/block node exist; the num_users count reflects in-kernel consumers that called regulator_enable().

Attributes

33 What: entries are documented in Documentation/ABI/testing/sysfs-class-regulator; the table below is representative.

AttributeR/WUnit/formatConditional?Source
nameROdisplay string; empty if driver provides nonealways (2.6.28)ABI What name
stateROenabled, disabled, unknownreporting regulatorsABI What state (2.6.26)
statusROoff, on, error, fast, normal, idle, standbyreporting regulatorsABI What status
typeROvoltage, current, unknownalwaysABI What type (2.6.26)
microvoltsROconfigured output voltage, E-6 voltsvoltage regulatorsABI What microvolts
microampsROconfigured current limit, E-6 ampscurrent regulatorsABI What microamps
opmodeROfast, normal, idle, standby, unknownreporting regulatorsABI What opmode
min_microvolts / max_microvoltsROconstraint values; constraint not defined if unsetconstrained suppliesABI What entries
num_usersROconsumers that called regulator_enable()alwaysABI What num_users
requested_microampsROsummed load request, microampscurrent reportingABI What requested_microamps
parentROsymlink to supplying regulatorif a supply existsABI What parent
bypassROenabled/disabled/unknownbypass-capable regulatorsABI What bypass (3.7)
under_voltage, over_current, over_temp, fail, … _warn variantsRO0/1 fault and warning flagsfault-reporting regulatorsABI What entries (5.18)
suspend_mem_microvolts, suspend_disk_state, and siblingsROper-sleep-state configurationsuspend constraintsABI What entries (2.6.26, May 2008)

The ABI notes microvolts/microamps/opmode report the configuration regardless of enable state; use state/status for the actual output condition.

Safety and writes

Everything is a read; the ABI documents no write semantics, and the class exists so userspace can observe regulator state, not drive it. Reads are safe and cheap. Changing rails belongs to kernel consumers with machine-level constraints; ad-hoc sysfs writes are not part of this interface.

References

  • Documentation/ABI/testing/sysfs-class-regulator (cached copy: 453 lines, 33 What: entries)
  • drivers/regulator/core.c, drivers/regulator/Makefile, include/linux/regulator/consumer.h (torvalds/linux master)
  • Ledger row SYSC-regulator; worklog Task 2-b (read-only interface characterization)