PMIC
本文介绍 Linux 中 Regulator 子系统的功能及使用方法。
模块介绍
Regulator(电源调节器)子系统主要用于控制能够输出电压和电流的硬件模块,我司P1芯片就是一款包含该功能的PMIC。对于 Linux 内核来说,regulator 是一套标准的软件框架,提供统一的接口用于控制各类电压/电流输出设备。
功能介绍

- regulator consumer: 有调节器供电的设备,他们消耗调节器提供的电力
- regulator framework: 提供标准的内核接口,控制系统的voltage/current regulators,并提供相应的开关、电压/电流设置的机制
- regulator diver: regulator 的驱动代码,负责向 framework 注册设备,并且与底层硬件通讯
- machine: 主要是配置各个regulator的属性,如电压范围、初始状态等。
源码结构介绍
Regulator 模块在内核源码中的路径为 drivers/regulator/,目录结构如下:
drivers/regulator/
├── core.c
├── devres.c
├── dummy.c
├── dummy.h
├── fixed.c
├── fixed-helper.c
├── gpio-regulator.c
├── helpers.c
├── internal.h
├── irq_helpers.c
├── Kconfig
├── Makefile
├── of_regulator.c
├── spacemit-regulator.c
关键特性
特性
| 特性 | 特性说明 |
|---|---|
| 支持 6路 DCDC | 支持动态调压:enable/disable |
| 支持 5路 ALDO | 支持调压:enable/disable |
| 支持 7路 DLDO | 支持调压:enable/disable |
配置介绍
主要包括 驱动使能配置 和 DTS 配置