linux 电源管理 regulator,Linux电源管理-Linux regulator framework概述

055453b566e6f125292ae5e45cc3d91b.gif

struct regulation_constraints {

const char *name;

/* voltage output range (inclusive) - for voltage control */

int min_uV;

int max_uV;

int uV_offset;

/* current output range (inclusive) - for current control */

int min_uA;

int max_uA;

/* valid regulator operating modes for this machine */

unsigned int valid_modes_mask;

/* valid operations for regulator on this machine */

unsigned int valid_ops_mask;

/* regulator input voltage - only if supply is another regulator */

int input_uV;

/* regulator suspend states for global PMIC STANDBY/HIBERNATE */

struct regulator_state state_disk;

struct regulator_state state_mem;

struct regulator_state state_standby;

suspend_state_t initial_state; /* suspend state to set at init */

/* mode to set on startup */

unsigned int initial_mode;

unsigned int ramp_delay;

unsigned int enable_time;

/* constraint flags */

unsigned always_on:1; /* regulator never off when system is on */

unsigned boot_on:1; /* bootloader/firmware enabled regulator */

unsigned apply_uV:1; /* apply uV constraint if min == max */

unsigned ramp_disable:1; /* disable ramp delay */

};

33e842ebacc7ed84f94a47c3de7fe173.gif

.name:   描述该约束的名字。

.min_uV/max_uV:  最小/最大的输出电压。

.uV_offset:  consumer看到的电源和实际电源之间的偏移值,用于电源补偿。

.min_uA/max_uA:  最小/最大的输出电流。

.valid_modes_mask:  该regulator支持的操作模式。

#define REGULATOR_MODE_FAST 0x1         //快速改变模式

#define REGULATOR_MODE_NORMAL        0x2         //正常模式,大多数驱动都使用这种模式

#define REGULATOR_MODE_IDLE         0x4         //设备在idle状态,regulator给设备提供服务

#define REGULATOR_MODE_STANDBY 0x8         //设备在standby状态,regulator给设备提供服务

.valid_ops_mask: 该regulator支持的操作。

#define REGULATOR_CHANGE_VOLTAGE 0x1         //该regulator可以改变电压

#define REGULATOR_CHANGE_CURRENT 0x2         //该regulator可以改变电流

#define REGULATOR_CHANGE_MODE 0x4         //该regulator可以改变mode

#define REGULATOR_CHANGE_STATUS 0x8         //该regulator可以改变状态,也就是enable/disable power

#define REGULATOR_CHANGE_DRMS 0x10       //该regulator可以动态该变mode

#define REGULATOR_CHANGE_BYPASS 0x20       //该regulator支持bypass mode

.input_uV:  表示该regulator的input是另一个regulator。

.state_disk/state_mem/state_standby:  代表该regulator的各种suspend状态。

.always_on:  是否在系统启动后一直使能。

.boot_on:  是否在boot阶段使能。

.apply_uV: 当min_uV=max_uV的时候时使用。

.ramp_delay: 改变电压到电源稳定后时间。因为硬件原因,改变电源后不能立刻就成功,其中需要有一定的延迟。

.enable_time:  regulator的使能时间。

....未完

参考地址:https://blog.csdn.net/longwang155069/article/details/53129378

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值