MCPcopy Create free account
hub / github.com/RT-Thread/rt-thread / regulator_enable

Function regulator_enable

components/drivers/regulator/regulator.c:227–254  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

225}
226
227static rt_err_t regulator_enable(struct rt_regulator_node *reg_np)
228{
229 rt_err_t err = RT_EOK;
230 rt_uint32_t enable_delay = regulator_get_enable_time(reg_np);
231
232 if (reg_np->ops->enable)
233 {
234 err = reg_np->ops->enable(reg_np);
235
236 if (!err)
237 {
238 if (enable_delay)
239 {
240 regulator_delay(enable_delay);
241 }
242
243 rt_atomic_add(&reg_np->enabled_count, 1);
244 err = regulator_notifier_call_chain(reg_np, RT_REGULATOR_MSG_ENABLE, RT_NULL);
245 }
246 }
247
248 if (!err && reg_np->parent)
249 {
250 err = regulator_enable(reg_np->parent);
251 }
252
253 return err;
254}
255
256rt_err_t rt_regulator_enable(struct rt_regulator *reg)
257{

Callers 2

rt_regulator_registerFunction · 0.70
rt_regulator_enableFunction · 0.70

Calls 3

regulator_delayFunction · 0.85

Tested by

no test coverage detected