October 2017
Intermediate to advanced
586 pages
14h 8m
English
For consumers that need to adapt their power supplies according to their operating modes, the kernel provides this:
int regulator_set_voltage(regulator, min_uV, max_uV);
min_uV and max_uV are the minimum and maximum acceptable voltages in microvolts.
If called when the regulator is disabled, this function will change the voltage configuration so that the voltage is physically set when the regulator is next enabled. That said, consumers can get the regulator configured voltage output by calling regulator_get_voltage(), which will return the configured output voltage whether the regulator is enabled or not:
int regulator_get_voltage(regulator);
Here is an example:
printk (KERN_INFO "Regulator Voltage = %d\n", regulator_get_voltage(reg)); ...
Read now
Unlock full access