首页 > 代码库 > MTK Android Driver:PMIC
MTK Android Driver:PMIC
1.基本概念
PMIC: Power Management IC电源管理IC
相关接口代码:
U32 pmic_config_interface (U32 RegNum, U32 val, U32 MASK, U32 SHIFT)
preload:alps\mediatek\platform\mt6582\preloader\src\drivers\pmic_6323.c
lk:alps\mediatek\platform\mt6582\lk\mt_pmic.c
kernel:alps\mediatek\platform\mt6582\kernel\drivers\power\pmic_mt6323.c
LDO: 是low dropout regulator,意为低压差线性稳压器,LDO类的电源转换芯片。
相关接口定义:
alps\mediatek\platform\mt6582\kernel\core\mt_pm_ldo.c
2.上电、掉电配置方法(preload 、lk、 kernel、系统启动后四个阶段):
2.2 kernel 阶段配置:
2.3系统启动后阶段配置:
系统正常启动后,kernel都是跑起来的,所以上电/掉电的操作都应该放在kernel里面。
3 驱动电压修改:
lcm vgp1驱动电压:
\alps\mediatek\custom\common\kernel\lcm\rgb_mt8193\rgb_mt8193.c
static void lcm_init(void){
upmu_set_rg_vgp1_vosel(0x7);//驱动电压修改--->pmic_config_interface()
upmu_set_rg_vgp1_en(0x1);
}
mt6323 电压等级对应文件:
\alps\mediatek\platform\mt6582\kernel\drivers\power\pmic_mt6323.c
举例说明:vgp1电压等级映射表:
void dct_pmic_VGP1_sel(kal_uint32 volt)
{
if(volt == VOL_DEFAULT) { upmu_set_rg_vgp1_vosel(5);}
else if(volt == VOL_1200){ upmu_set_rg_vgp1_vosel(0);}
else if(volt == VOL_1300){ upmu_set_rg_vgp1_vosel(1);}
else if(volt == VOL_1500){ upmu_set_rg_vgp1_vosel(2);}
else if(volt == VOL_1800){ upmu_set_rg_vgp1_vosel(3);}
else if(volt == VOL_2000){ upmu_set_rg_vgp1_vosel(4);}
else if(volt == VOL_2800){ upmu_set_rg_vgp1_vosel(5);}
else if(volt == VOL_3000){ upmu_set_rg_vgp1_vosel(6);}
else if(volt == VOL_3300){ upmu_set_rg_vgp1_vosel(7);}
else{
}
}
MTK Android Driver:PMIC