1. Basic Concepts
Pmic:power Management IC Power Management ICS
Related Interface Code :
U32 Pmic_config_interface (U32 RegNum, U32 val, U32 MASK, U32 SHIFT)
P reload: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: is the low dropout regulator, which means the voltage difference linear regulator, Ldo class power conversion chip.
Related interface Definitions:
power-up interface function: Hwpoweronpower-down interface function :hwpowerdown
Alps\mediatek\platform\mt6582\kernel\core\mt_pm_ldo.c
2. Power-on, power-down configuration method (preload, lk, kernel, Four stages after system start ):
2.1 preload, LK Stage configuration: here is the power-up/power-down method in the LK phase:use the API inside the UPMU_COMMON.C file to control each LDO_VGPX separately.For example:Upmu_set_rg_vgp6_vosel used to control the voltage value of power-up;The upmu_set_rg_vgp6_en is used to control the Enable VGP6 pin
2.2 Kernel phase configuration:
power-up interface function: Hwpoweronpower-down interface function :hwpowerdownThe following is an example of the VGP6 of PMIC6320. please call Hwpoweron when you want to power on the file # include <mach/mt_pm_ldo.h> power up please call HwpowerdownHwpoweron (MT65XX_POWER_LDO_VGP6, vol_2800, "ldo_test");bool Hwpowerdown (MT65XX_POWER_LDO_VGP6, "ldo_test");
2.3 System boot post-stage configuration:
After the normal start of the system, kernel are running up, so the power on/off the operation should be placed in the kernel inside.
3 Drive Voltage modification:
LCM vgp1 Drive Voltage:
\alps\mediatek\custom\common\kernel\lcm\rgb_mt8193\rgb_mt8193.c
static void Lcm_init (void) {
Upmu_set_rg_vgp1_vosel (0x7);// Drive voltage Modification--->pmic_config_interface ()
Upmu_set_rg_vgp1_en (0x1);
}
mt6323 voltage level corresponding file:
\alps\mediatek\platform\mt6582\kernel\drivers\power\pmic_mt6323.c
Example: VGP1 voltage level mapping table:
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