October 2017
Intermediate to advanced
586 pages
14h 8m
English
Prior to gaining access to a regulator, the consumer has to request the kernel by means of the regulator_get() function. It is also possible to use the managed version, the devm_regulator_get() function:
struct regulator *regulator_get(struct device *dev, const char *id)
An example of using this function is as follows:
reg = regulator_get(dev, "Vcc");
The consumer passes in its struct device pointer and power supply ID. The core will try to find the correct regulator by consulting the DT or a machine-specific lookup table. If we focus only on the device tree, *id should match the <name> pattern of the regulator supply in the device tree. If the lookup is successful then this call will return a pointer to the ...