Module regulator

Source
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 Regulator handle has not specifically asked for the underlying regulator to be enabled. This means that this reference does not own an enable reference count, but the regulator may still be on.
Enabled
A state where the Regulator is known to be enabled.
Error
An error that can occur when trying to convert a Regulator between states.
Regulator
A struct regulator abstraction.
Voltage
A voltage.

Traits§

IsEnabled
A trait that abstracts the ability to check if a Regulator is enabled.
RegulatorState
A trait representing the different states a Regulator can be in.

Functions§

devm_enable
Obtains and enables a devres-managed regulator for a device.
devm_enable_optional
Same as devm_enable, but calls devm_regulator_get_enable_optional instead.