Expand description
Regulator abstractions, providing a standard kernel interface to control voltage and current regulators.
The intention is to allow systems to dynamically control regulator power output in order to save power and prolong battery life. This applies to both voltage regulators (where voltage output is controllable) and current sinks (where current limit is controllable).
C header: include/linux/regulator/consumer.h
Regulators are modeled in Rust with a collection of states. Each state may enforce a given invariant, and they may convert between each other where applicable.
See Voltage and current regulator API for more information.
Structs§
- Disabled
- A state where this Regulatorhandle has not specifically asked for the underlying regulator to be enabled. This means that this reference does not own anenablereference count, but the regulator may still be on.
- Enabled
- A state where the Regulatoris known to be enabled.
- Error
- An error that can occur when trying to convert a Regulatorbetween states.
- Regulator
- A struct regulatorabstraction.
- Voltage
- A voltage.
Traits§
- IsEnabled
- A trait that abstracts the ability to check if a Regulatoris enabled.
- RegulatorState 
- A trait representing the different states a Regulatorcan be in.
Functions§
- devm_enable 
- Obtains and enables a devres-managed regulator for a device.
- devm_enable_ optional 
- Same as devm_enable, but callsdevm_regulator_get_enable_optionalinstead.