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

Function rt_regulator_enable

components/drivers/regulator/regulator.c:256–277  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

254}
255
256rt_err_t rt_regulator_enable(struct rt_regulator *reg)
257{
258 rt_err_t err;
259
260 if (!reg)
261 {
262 return -RT_EINVAL;
263 }
264
265 if (rt_regulator_is_enabled(reg))
266 {
267 return RT_EOK;
268 }
269
270 rt_hw_spin_lock(&_regulator_lock.lock);
271
272 err = regulator_enable(reg->reg_np);
273
274 rt_hw_spin_unlock(&_regulator_lock.lock);
275
276 return err;
277}
278
279static rt_err_t regulator_disable(struct rt_regulator_node *reg_np)
280{

Callers 2

pwm_fan_power_onFunction · 0.85
pwm_fan_power_offFunction · 0.85

Calls 4

rt_regulator_is_enabledFunction · 0.85
regulator_enableFunction · 0.70
rt_hw_spin_lockFunction · 0.50
rt_hw_spin_unlockFunction · 0.50

Tested by

no test coverage detected