mirror of
https://github.com/apache/nuttx.git
synced 2026-05-22 22:20:01 +08:00
regulator: support link to supply
when add supply desc,the regulator is linked to the parent regulator 1.if enable the regualtor, the parent regulator is enabled 2.if disable all child regulator, the parent regualtor is disabled Signed-off-by: dulibo1 <dulibo1@xiaomi.com>
This commit is contained in:
@@ -74,30 +74,32 @@ struct regulator_ops_s
|
||||
|
||||
struct regulator_desc_s
|
||||
{
|
||||
const char *name; /* Regulator output name */
|
||||
unsigned int id; /* Numerical id for a given regulator of
|
||||
* a device
|
||||
*/
|
||||
unsigned int n_voltages; /* Number of discrete voltages */
|
||||
unsigned int vsel_reg; /* Device register for voltage selection */
|
||||
unsigned int vsel_mask; /* Register mask, for voltage selection */
|
||||
unsigned int enable_reg; /* Device register for enable/disable */
|
||||
unsigned int enable_mask; /* Register mask for enable/disable */
|
||||
unsigned int enable_time; /* Time for initial enable of regulator */
|
||||
unsigned int ramp_delay; /* Rate of change for setting new voltage */
|
||||
unsigned int uv_step; /* Voltage per step if linear mapping_uv */
|
||||
unsigned int min_uv; /* Minimum acceptable voltage */
|
||||
unsigned int max_uv; /* Maximum acceptable voltage */
|
||||
unsigned int pulldown; /* Enable pulldown when disabled */
|
||||
unsigned int pulldown_reg; /* Device register, for pulldown enable */
|
||||
unsigned int pulldown_mask; /* Register mask, for pulldown enable */
|
||||
unsigned int apply_uv; /* If true, the voltage specifed (between) * min_uv and max_uv will be applied during
|
||||
* initialisation.
|
||||
*/
|
||||
unsigned int boot_on; /* true if this regulator is to be enabled
|
||||
* at power up/reset
|
||||
*/
|
||||
unsigned int always_on;
|
||||
FAR const char *name; /* Regulator output name */
|
||||
unsigned int id; /* Numerical id for a given regulator of
|
||||
* a device
|
||||
*/
|
||||
unsigned int n_voltages; /* Number of discrete voltages */
|
||||
unsigned int vsel_reg; /* Device register for voltage selection */
|
||||
unsigned int vsel_mask; /* Register mask, for voltage selection */
|
||||
unsigned int enable_reg; /* Device register for enable/disable */
|
||||
unsigned int enable_mask; /* Register mask for enable/disable */
|
||||
unsigned int enable_time; /* Time for initial enable of regulator */
|
||||
unsigned int ramp_delay; /* Rate of change for setting new voltage */
|
||||
unsigned int uv_step; /* Voltage per step if linear mapping_uv */
|
||||
unsigned int min_uv; /* Minimum acceptable voltage */
|
||||
unsigned int max_uv; /* Maximum acceptable voltage */
|
||||
unsigned int pulldown; /* Enable pulldown when disabled */
|
||||
unsigned int pulldown_reg; /* Device register, for pulldown enable */
|
||||
unsigned int pulldown_mask; /* Register mask, for pulldown enable */
|
||||
unsigned int apply_uv; /* If true, the voltage specifed (between)
|
||||
* min_uv and max_uv will be applied during
|
||||
* initialisation.
|
||||
*/
|
||||
unsigned int boot_on; /* true if this regulator is to be enabled
|
||||
* at power up/reset
|
||||
*/
|
||||
unsigned int always_on;
|
||||
FAR const char *supply_name;
|
||||
};
|
||||
|
||||
struct regulator_dev_s
|
||||
@@ -109,6 +111,7 @@ struct regulator_dev_s
|
||||
mutex_t regulator_lock;
|
||||
struct list_node list;
|
||||
struct list_node consumer_list;
|
||||
FAR struct regulator_s *supply;
|
||||
|
||||
FAR void *priv;
|
||||
};
|
||||
@@ -147,7 +150,7 @@ extern "C"
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
struct regulator_dev_s *
|
||||
FAR struct regulator_dev_s *
|
||||
regulator_register(FAR const struct regulator_desc_s *desc,
|
||||
FAR const struct regulator_ops_s *ops,
|
||||
FAR void *priv);
|
||||
|
||||
Reference in New Issue
Block a user