aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation/power/regulator/consumer.txt
diff options
context:
space:
mode:
Diffstat (limited to 'Documentation/power/regulator/consumer.txt')
-rw-r--r--Documentation/power/regulator/consumer.txt35
1 files changed, 35 insertions, 0 deletions
diff --git a/Documentation/power/regulator/consumer.txt b/Documentation/power/regulator/consumer.txt
index 55c4175d8099..81c0e2b49cd8 100644
--- a/Documentation/power/regulator/consumer.txt
+++ b/Documentation/power/regulator/consumer.txt
@@ -180,3 +180,38 @@ int regulator_unregister_notifier(struct regulator *regulator,
180 180
181Regulators use the kernel notifier framework to send event to their interested 181Regulators use the kernel notifier framework to send event to their interested
182consumers. 182consumers.
183
1847. Regulator Direct Register Access
185===================================
186Some kinds of power management hardware or firmware are designed such that
187they need to do low-level hardware access to regulators, with no involvement
188from the kernel. Examples of such devices are:
189
190- clocksource with a voltage-controlled oscillator and control logic to change
191 the supply voltage over I2C to achieve a desired output clock rate
192- thermal management firmware that can issue an arbitrary I2C transaction to
193 perform system poweroff during overtemperature conditions
194
195To set up such a device/firmware, various parameters like I2C address of the
196regulator, addresses of various regulator registers etc. need to be configured
197to it. The regulator framework provides the following helpers for querying
198these details.
199
200Bus-specific details, like I2C addresses or transfer rates are handled by the
201regmap framework. To get the regulator's regmap (if supported), use :-
202
203struct regmap *regulator_get_regmap(struct regulator *regulator);
204
205To obtain the hardware register offset and bitmask for the regulator's voltage
206selector register, use :-
207
208int regulator_get_hardware_vsel_register(struct regulator *regulator,
209 unsigned *vsel_reg,
210 unsigned *vsel_mask);
211
212To convert a regulator framework voltage selector code (used by
213regulator_list_voltage) to a hardware-specific voltage selector that can be
214directly written to the voltage selector register, use :-
215
216int regulator_list_hardware_vsel(struct regulator *regulator,
217 unsigned selector);