Lines Matching refs:regulator
4 This text describes the regulator interface for consumer device drivers.
11 A consumer driver can get access to its supply regulator by calling :-
13 regulator = regulator_get(dev, "Vcc");
16 then finds the correct regulator by consulting a machine specific lookup table.
18 regulator that supplies this consumer.
20 To release the regulator the consumer driver should call :-
22 regulator_put(regulator);
24 Consumers can be supplied by more than one regulator e.g. codec consumer with
30 The regulator access functions regulator_get() and regulator_put() will
39 int regulator_enable(regulator);
42 This may happen if the consumer shares the regulator or the regulator has been
45 A consumer can determine if a regulator is enabled by calling :-
47 int regulator_is_enabled(regulator);
49 This will return > zero when the regulator is enabled.
54 int regulator_disable(regulator);
57 regulator will only be disabled when the enabled reference count is zero.
59 Finally, a regulator can be forcefully disabled in the case of an emergency :-
61 int regulator_force_disable(regulator);
63 NOTE: this will immediately and forcefully shutdown the regulator output. All
77 int regulator_set_voltage(regulator, min_uV, max_uV);
82 NOTE: this can be called when the regulator is enabled or disabled. If called
84 configuration changes and the voltage is physically set when the regulator is
89 int regulator_get_voltage(regulator);
92 regulator is enabled or disabled and should NOT be used to determine regulator
94 determine the regulator physical output voltage.
107 int regulator_set_current_limit(regulator, min_uA, max_uA);
112 NOTE: this can be called when the regulator is enabled or disabled. If called
115 regulator is next enabled.
119 int regulator_get_current_limit(regulator);
121 NOTE: get_current_limit() will return the current limit whether the regulator
122 is enabled or disabled and should not be used to determine regulator current
130 their supply regulator to be more efficient when the consumers operating state
137 Consumer drivers can request a change in their supply regulator operating mode
140 int regulator_set_load(struct regulator *regulator, int load_uA);
142 This will cause the core to recalculate the total load on the regulator (based
151 knowledge of the regulator or whether the regulator is shared with other
156 Bespoke or tightly coupled drivers may want to directly control regulator
160 int regulator_set_mode(struct regulator *regulator, unsigned int mode);
161 unsigned int regulator_get_mode(struct regulator *regulator);
163 Direct mode will only be used by consumers that *know* about the regulator and
164 are not sharing the regulator with other consumers.
170 consumers under regulator stress or failure conditions.
172 Consumers can register interest in regulator events by calling :-
174 int regulator_register_notifier(struct regulator *regulator,
179 int regulator_unregister_notifier(struct regulator *regulator,
197 regulator, addresses of various regulator registers etc. need to be configured
198 to it. The regulator framework provides the following helpers for querying
202 regmap framework. To get the regulator's regmap (if supported), use :-
204 struct regmap *regulator_get_regmap(struct regulator *regulator);
206 To obtain the hardware register offset and bitmask for the regulator's voltage
209 int regulator_get_hardware_vsel_register(struct regulator *regulator,
213 To convert a regulator framework voltage selector code (used by
217 int regulator_list_hardware_vsel(struct regulator *regulator,