11#ifndef __REGULATOR_H__
12#define __REGULATOR_H__
20#define RT_REGULATOR_UVOLT_INVALID (((int)(RT_UINT32_MAX >> 1)))
72#define RT_REGULATOR_MODE_INVALID 0
73#define RT_REGULATOR_MODE_FAST RT_BIT(0)
74#define RT_REGULATOR_MODE_NORMAL RT_BIT(1)
75#define RT_REGULATOR_MODE_IDLE RT_BIT(2)
76#define RT_REGULATOR_MODE_STANDBY RT_BIT(3)
93#define RT_REGULATOR_MSG_ENABLE RT_BIT(0)
94#define RT_REGULATOR_MSG_DISABLE RT_BIT(1)
95#define RT_REGULATOR_MSG_VOLTAGE_CHANGE RT_BIT(2)
96#define RT_REGULATOR_MSG_VOLTAGE_CHANGE_ERR RT_BIT(3)
143 int min_uvolt,
int target_uvolt,
int max_uvolt)
struct rt_regulator * rt_regulator_get(struct rt_device *dev, const char *id)
rt_bool_t rt_regulator_is_supported_voltage(struct rt_regulator *reg, int min_uvolt, int max_uvolt)
int rt_regulator_get_voltage(struct rt_regulator *reg)
rt_err_t(* rt_regulator_notifier_callback)(struct rt_regulator_notifier *notifier, rt_ubase_t msg, void *data)
rt_err_t rt_regulator_unregister(struct rt_regulator_node *reg_np)
rt_err_t rt_regulator_set_mode(struct rt_regulator *reg, rt_uint32_t mode)
rt_int32_t rt_regulator_get_mode(struct rt_regulator *reg)
void rt_regulator_put(struct rt_regulator *reg)
rt_err_t rt_regulator_notifier_register(struct rt_regulator *reg, struct rt_regulator_notifier *notifier)
rt_err_t rt_regulator_enable(struct rt_regulator *reg)
rt_err_t rt_regulator_register(struct rt_regulator_node *reg_np)
rt_inline rt_err_t rt_regulator_set_voltage_triplet(struct rt_regulator *reg, int min_uvolt, int target_uvolt, int max_uvolt)
rt_err_t rt_regulator_disable(struct rt_regulator *reg)
rt_err_t rt_regulator_notifier_unregister(struct rt_regulator *reg, struct rt_regulator_notifier *notifier)
rt_err_t rt_regulator_set_voltage(struct rt_regulator *reg, int min_uvolt, int max_uvolt)
rt_bool_t rt_regulator_is_enabled(struct rt_regulator *reg)
struct rt_list_node rt_list_t
rt_atomic_t enabled_count
const struct rt_regulator_param * param
const struct rt_regulator_ops * ops
struct rt_regulator_node * parent
rt_regulator_notifier_callback callback
struct rt_regulator * regulator
rt_uint32_t(* enable_time)(struct rt_regulator_node *reg)
rt_int32_t(* get_mode)(struct rt_regulator_node *reg)
rt_err_t(* set_voltage)(struct rt_regulator_node *reg, int min_uvolt, int max_uvolt)
int(* get_voltage)(struct rt_regulator_node *reg)
rt_err_t(* set_mode)(struct rt_regulator_node *reg, rt_uint32_t mode)
rt_err_t(* set_ramp_delay)(struct rt_regulator_node *reg, int ramp)
rt_err_t(* disable)(struct rt_regulator_node *reg)
rt_bool_t(* is_enabled)(struct rt_regulator_node *reg)
rt_err_t(* enable)(struct rt_regulator_node *reg)
rt_uint32_t enable_active_high
rt_uint32_t over_current_protection