Linux 电源系统
发布时间
阅读量:
阅读量
电池驱动程序所依赖的接口由结构体power_supply提供。
为使用户空间能够通过sys文件系统获取相关接口,其具体路径需由上层应用程序进行设定。
Linux系统中标准的Power Supply驱动程序默认采用的文件系统路径为/sys/class/power_supply,该路径下的每一个子目录均对应一种能源供应设备的标识名称。
与Power Supply驱动程序相关的头文件定义位于include/linux/power_supply.h中,用于实现驱动程序注册与注销功能的函数如下所示:
struct power_supply *power_supply_register(struct device *parent,
const struct power_supply_desc *desc,
const struct power_supply_config *cfg)
void power_supply_unregister(struct power_supply *psy)
其中power_supply结构体代表了驱动程序中需完成的实现内容:
struct power_supply {
const stru
全部评论 (0)
还没有任何评论哟~
