| 254 | } |
| 255 | |
| 256 | rt_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 | |
| 279 | static rt_err_t regulator_disable(struct rt_regulator_node *reg_np) |
| 280 | { |
no test coverage detected