常用电源管理函数:
1.regulator_get
regulator_get(dev, "vtp")
- 通常在驱动的probe
- 获取驱动对应的regulator,"vtp"电源id,内核会查找对应电源id,dtsi要基于此电源id做相应的配置
2.regulator_put
- 通常在驱动的remove
- 释放regulator
3.regulator_enable && regulator_is_enabled
- regulator_enable使能电源输出
- regulator_is_enable判断电源输出是否被使能,返回值大于0即已使能
4.regulator_disable && regulator_force_disbled
- regulator_disable 关闭电源输出
- regulator_force_disable 立即关闭电源输出,使用regulator_disable 电源未必立即关闭,存在共享电源场景
5.regulator_set_voltage && regulator_get_voltage
- regulator_set_voltage 调节电压的最大最小输出