mb/google: Replace some strings in regulator.c
From comments of CB:65875, we replace *_vol to *_voltage. s/mainboard_set_regulator_vol/mainboard_set_regulator_voltage/ s/mainboard_get_regulator_vol/mainboard_get_regulator_voltage/ TEST=build pass BUG=b:233720142 Signed-off-by: Bo-Chen Chen <rex-bc.chen@mediatek.com> Change-Id: Iadf0408e8914d6e32915464f93979978c4634eaf Reviewed-on: https://review.coreboot.org/c/coreboot/+/65994 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Yu-Ping Wu <yupingso@google.com>
This commit is contained in:
@ -38,8 +38,7 @@ static int get_mt6359p_regulator_id(enum mtk_regulator regulator)
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
void mainboard_set_regulator_vol(enum mtk_regulator regulator,
|
void mainboard_set_regulator_voltage(enum mtk_regulator regulator, uint32_t voltage_uv)
|
||||||
uint32_t voltage_uv)
|
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
* Handle the regulator that does not have a regulator ID
|
* Handle the regulator that does not have a regulator ID
|
||||||
@ -68,7 +67,7 @@ void mainboard_set_regulator_vol(enum mtk_regulator regulator,
|
|||||||
printk(BIOS_WARNING, "Invalid regulator ID: %d\n", regulator);
|
printk(BIOS_WARNING, "Invalid regulator ID: %d\n", regulator);
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32_t mainboard_get_regulator_vol(enum mtk_regulator regulator)
|
uint32_t mainboard_get_regulator_voltage(enum mtk_regulator regulator)
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
* Handle the regulator that does not have a regulator ID
|
* Handle the regulator that does not have a regulator ID
|
||||||
|
@ -51,8 +51,7 @@ static int check_regulator_control(enum mtk_regulator regulator)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void mainboard_set_regulator_vol(enum mtk_regulator regulator,
|
void mainboard_set_regulator_voltage(enum mtk_regulator regulator, uint32_t voltage_uv)
|
||||||
uint32_t voltage_uv)
|
|
||||||
{
|
{
|
||||||
if (check_regulator_control(regulator) < 0)
|
if (check_regulator_control(regulator) < 0)
|
||||||
return;
|
return;
|
||||||
@ -89,7 +88,7 @@ void mainboard_set_regulator_vol(enum mtk_regulator regulator,
|
|||||||
printk(BIOS_ERR, "Invalid regulator ID: %d\n", regulator);
|
printk(BIOS_ERR, "Invalid regulator ID: %d\n", regulator);
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32_t mainboard_get_regulator_vol(enum mtk_regulator regulator)
|
uint32_t mainboard_get_regulator_voltage(enum mtk_regulator regulator)
|
||||||
{
|
{
|
||||||
if (check_regulator_control(regulator) < 0)
|
if (check_regulator_control(regulator) < 0)
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -35,9 +35,9 @@ static void bridge_ps8640_power_on(void)
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/* Set VRF12 to 1.2V and VCN33 to 3.3V */
|
/* Set VRF12 to 1.2V and VCN33 to 3.3V */
|
||||||
mainboard_set_regulator_vol(MTK_REGULATOR_VRF12, 1200000);
|
mainboard_set_regulator_voltage(MTK_REGULATOR_VRF12, 1200000);
|
||||||
udelay(100);
|
udelay(100);
|
||||||
mainboard_set_regulator_vol(MTK_REGULATOR_VCN33, 3300000);
|
mainboard_set_regulator_voltage(MTK_REGULATOR_VCN33, 3300000);
|
||||||
udelay(200);
|
udelay(200);
|
||||||
|
|
||||||
/* Turn on bridge */
|
/* Turn on bridge */
|
||||||
|
@ -26,8 +26,7 @@ static const int regulator_id[] = {
|
|||||||
|
|
||||||
_Static_assert(ARRAY_SIZE(regulator_id) == MTK_REGULATOR_NUM, "regulator_id size error");
|
_Static_assert(ARRAY_SIZE(regulator_id) == MTK_REGULATOR_NUM, "regulator_id size error");
|
||||||
|
|
||||||
void mainboard_set_regulator_vol(enum mtk_regulator regulator,
|
void mainboard_set_regulator_voltage(enum mtk_regulator regulator, uint32_t voltage_uv)
|
||||||
uint32_t voltage_uv)
|
|
||||||
{
|
{
|
||||||
assert(regulator < MTK_REGULATOR_NUM);
|
assert(regulator < MTK_REGULATOR_NUM);
|
||||||
|
|
||||||
@ -38,7 +37,7 @@ void mainboard_set_regulator_vol(enum mtk_regulator regulator,
|
|||||||
mt6366_set_voltage(regulator_id[regulator], voltage_uv);
|
mt6366_set_voltage(regulator_id[regulator], voltage_uv);
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32_t mainboard_get_regulator_vol(enum mtk_regulator regulator)
|
uint32_t mainboard_get_regulator_voltage(enum mtk_regulator regulator)
|
||||||
{
|
{
|
||||||
assert(regulator < MTK_REGULATOR_NUM);
|
assert(regulator < MTK_REGULATOR_NUM);
|
||||||
|
|
||||||
|
@ -11,8 +11,8 @@
|
|||||||
|
|
||||||
static void raise_little_cpu_freq(void)
|
static void raise_little_cpu_freq(void)
|
||||||
{
|
{
|
||||||
mainboard_set_regulator_vol(MTK_REGULATOR_VPROC12, 1031250);
|
mainboard_set_regulator_voltage(MTK_REGULATOR_VPROC12, 1031250);
|
||||||
mainboard_set_regulator_vol(MTK_REGULATOR_VSRAM_PROC12, 1118750);
|
mainboard_set_regulator_voltage(MTK_REGULATOR_VSRAM_PROC12, 1118750);
|
||||||
udelay(200);
|
udelay(200);
|
||||||
mt_pll_raise_little_cpu_freq(2000 * MHz);
|
mt_pll_raise_little_cpu_freq(2000 * MHz);
|
||||||
mt_pll_raise_cci_freq(1385 * MHz);
|
mt_pll_raise_cci_freq(1385 * MHz);
|
||||||
|
@ -23,9 +23,8 @@ enum mtk_regulator {
|
|||||||
MTK_REGULATOR_NUM,
|
MTK_REGULATOR_NUM,
|
||||||
};
|
};
|
||||||
|
|
||||||
void mainboard_set_regulator_vol(enum mtk_regulator regulator,
|
void mainboard_set_regulator_voltage(enum mtk_regulator regulator, uint32_t voltage_uv);
|
||||||
uint32_t voltage_uv);
|
uint32_t mainboard_get_regulator_voltage(enum mtk_regulator regulator);
|
||||||
uint32_t mainboard_get_regulator_vol(enum mtk_regulator regulator);
|
|
||||||
int mainboard_enable_regulator(enum mtk_regulator regulator, uint8_t enable);
|
int mainboard_enable_regulator(enum mtk_regulator regulator, uint8_t enable);
|
||||||
uint8_t mainboard_regulator_is_enabled(enum mtk_regulator regulator);
|
uint8_t mainboard_regulator_is_enabled(enum mtk_regulator regulator);
|
||||||
|
|
||||||
|
@ -102,6 +102,6 @@ void mtk_msdc_configure_sdcard(void)
|
|||||||
MSDC1_GPIO_MODE1_1, MSDC1_GPIO_MODE1_VALUE);
|
MSDC1_GPIO_MODE1_1, MSDC1_GPIO_MODE1_VALUE);
|
||||||
|
|
||||||
/* enable SDCard power */
|
/* enable SDCard power */
|
||||||
mainboard_set_regulator_vol(MTK_REGULATOR_VMCH, 3300000);
|
mainboard_set_regulator_voltage(MTK_REGULATOR_VMCH, 3300000);
|
||||||
mainboard_set_regulator_vol(MTK_REGULATOR_VMC, 3300000);
|
mainboard_set_regulator_voltage(MTK_REGULATOR_VMC, 3300000);
|
||||||
}
|
}
|
||||||
|
@ -176,7 +176,7 @@ unsigned int dramc_set_vcore_voltage(unsigned int vcore)
|
|||||||
dramc_debug("%s set vcore to %d\n", __func__, vcore);
|
dramc_debug("%s set vcore to %d\n", __func__, vcore);
|
||||||
//mt6359p_buck_set_voltage(MT6359P_GPU11, vcore);
|
//mt6359p_buck_set_voltage(MT6359P_GPU11, vcore);
|
||||||
|
|
||||||
mainboard_set_regulator_vol(MTK_REGULATOR_VCORE, vcore);
|
mainboard_set_regulator_voltage(MTK_REGULATOR_VCORE, vcore);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -186,7 +186,7 @@ unsigned int dramc_get_vcore_voltage(void)
|
|||||||
#ifdef MTK_PMIC_MT6359
|
#ifdef MTK_PMIC_MT6359
|
||||||
return mtk_regulator_get_voltage(®_vcore);
|
return mtk_regulator_get_voltage(®_vcore);
|
||||||
#else
|
#else
|
||||||
return mainboard_get_regulator_vol(MTK_REGULATOR_VCORE);
|
return mainboard_get_regulator_voltage(MTK_REGULATOR_VCORE);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -195,7 +195,7 @@ unsigned int dramc_set_vdram_voltage(unsigned int ddr_type, unsigned int vdram)
|
|||||||
#ifdef MTK_PMIC_MT6359
|
#ifdef MTK_PMIC_MT6359
|
||||||
mtk_regulator_set_voltage(®_vdram, vdram, MAX_VDRAM);
|
mtk_regulator_set_voltage(®_vdram, vdram, MAX_VDRAM);
|
||||||
#endif
|
#endif
|
||||||
mainboard_set_regulator_vol(MTK_REGULATOR_VDD2, vdram);
|
mainboard_set_regulator_voltage(MTK_REGULATOR_VDD2, vdram);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -204,7 +204,7 @@ unsigned int dramc_get_vdram_voltage(unsigned int ddr_type)
|
|||||||
#ifdef MTK_PMIC_MT6359
|
#ifdef MTK_PMIC_MT6359
|
||||||
return mtk_regulator_get_voltage(®_vdram);
|
return mtk_regulator_get_voltage(®_vdram);
|
||||||
#else
|
#else
|
||||||
return mainboard_get_regulator_vol(MTK_REGULATOR_VDD2);
|
return mainboard_get_regulator_voltage(MTK_REGULATOR_VDD2);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -213,7 +213,7 @@ unsigned int dramc_set_vddq_voltage(unsigned int ddr_type, unsigned int vddq)
|
|||||||
#ifdef MTK_PMIC_MT6359
|
#ifdef MTK_PMIC_MT6359
|
||||||
mtk_regulator_set_voltage(®_vddq, vddq, MAX_VDDQ);
|
mtk_regulator_set_voltage(®_vddq, vddq, MAX_VDDQ);
|
||||||
#endif
|
#endif
|
||||||
mainboard_set_regulator_vol(MTK_REGULATOR_VDDQ, vddq);
|
mainboard_set_regulator_voltage(MTK_REGULATOR_VDDQ, vddq);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -222,7 +222,7 @@ unsigned int dramc_get_vddq_voltage(unsigned int ddr_type)
|
|||||||
#ifdef MTK_PMIC_MT6359
|
#ifdef MTK_PMIC_MT6359
|
||||||
return mtk_regulator_get_voltage(®_vddq);
|
return mtk_regulator_get_voltage(®_vddq);
|
||||||
#else
|
#else
|
||||||
return mainboard_get_regulator_vol(MTK_REGULATOR_VDDQ);
|
return mainboard_get_regulator_voltage(MTK_REGULATOR_VDDQ);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -231,7 +231,7 @@ unsigned int dramc_set_vmddr_voltage(unsigned int vmddr)
|
|||||||
#ifdef MTK_PMIC_MT6359
|
#ifdef MTK_PMIC_MT6359
|
||||||
return mtk_regulator_set_voltage(®_vmddr, vmddr, MAX_VMDDR);
|
return mtk_regulator_set_voltage(®_vmddr, vmddr, MAX_VMDDR);
|
||||||
#endif
|
#endif
|
||||||
mainboard_set_regulator_vol(MTK_REGULATOR_VMDDR, vmddr);
|
mainboard_set_regulator_voltage(MTK_REGULATOR_VMDDR, vmddr);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -240,7 +240,7 @@ unsigned int dramc_get_vmddr_voltage(void)
|
|||||||
#ifdef MTK_PMIC_MT6359
|
#ifdef MTK_PMIC_MT6359
|
||||||
return mtk_regulator_get_voltage(®_vmddr);
|
return mtk_regulator_get_voltage(®_vmddr);
|
||||||
#else
|
#else
|
||||||
return mainboard_get_regulator_vol(MTK_REGULATOR_VMDDR);
|
return mainboard_get_regulator_voltage(MTK_REGULATOR_VMDDR);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -252,7 +252,7 @@ unsigned int dramc_set_vio18_voltage(unsigned int vio18)
|
|||||||
pmic_config_interface(PMIC_RG_VM18_VOCAL_ADDR, twist, PMIC_RG_VM18_VOCAL_MASK, PMIC_RG_VM18_VOCAL_SHIFT);
|
pmic_config_interface(PMIC_RG_VM18_VOCAL_ADDR, twist, PMIC_RG_VM18_VOCAL_MASK, PMIC_RG_VM18_VOCAL_SHIFT);
|
||||||
return mtk_regulator_set_voltage(®_vio18, vio18, MAX_VIO18);
|
return mtk_regulator_set_voltage(®_vio18, vio18, MAX_VIO18);
|
||||||
#else
|
#else
|
||||||
mainboard_set_regulator_vol(MTK_REGULATOR_VDD1, vio18);
|
mainboard_set_regulator_voltage(MTK_REGULATOR_VDD1, vio18);
|
||||||
return 0;
|
return 0;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
@ -265,7 +265,7 @@ unsigned int dramc_get_vio18_voltage(void)
|
|||||||
pmic_read_interface(PMIC_RG_VM18_VOCAL_ADDR, &twist, PMIC_RG_VM18_VOCAL_MASK, PMIC_RG_VM18_VOCAL_SHIFT);
|
pmic_read_interface(PMIC_RG_VM18_VOCAL_ADDR, &twist, PMIC_RG_VM18_VOCAL_MASK, PMIC_RG_VM18_VOCAL_SHIFT);
|
||||||
return mtk_regulator_get_voltage(®_vio18) + twist * UNIT_VIO18;
|
return mtk_regulator_get_voltage(®_vio18) + twist * UNIT_VIO18;
|
||||||
#else
|
#else
|
||||||
return mainboard_get_regulator_vol(MTK_REGULATOR_VDD1);
|
return mainboard_get_regulator_voltage(MTK_REGULATOR_VDD1);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -354,7 +354,7 @@ unsigned int dramc_set_vcore_voltage(unsigned int vcore)
|
|||||||
return mtk_regulator_set_voltage(®_vcore, vcore, MAX_VCORE);
|
return mtk_regulator_set_voltage(®_vcore, vcore, MAX_VCORE);
|
||||||
#elif defined(FOR_COREBOOT)
|
#elif defined(FOR_COREBOOT)
|
||||||
dramc_debug("%s set vcore to %u\n", __func__, vcore);
|
dramc_debug("%s set vcore to %u\n", __func__, vcore);
|
||||||
mainboard_set_regulator_vol(MTK_REGULATOR_VCORE, vcore);
|
mainboard_set_regulator_voltage(MTK_REGULATOR_VCORE, vcore);
|
||||||
return 0;
|
return 0;
|
||||||
#else
|
#else
|
||||||
return 0;
|
return 0;
|
||||||
@ -366,7 +366,7 @@ unsigned int dramc_get_vcore_voltage(void)
|
|||||||
#ifdef MTK_PMIC_MT6359
|
#ifdef MTK_PMIC_MT6359
|
||||||
return mtk_regulator_get_voltage(®_vcore);
|
return mtk_regulator_get_voltage(®_vcore);
|
||||||
#elif defined(FOR_COREBOOT)
|
#elif defined(FOR_COREBOOT)
|
||||||
return mainboard_get_regulator_vol(MTK_REGULATOR_VCORE);
|
return mainboard_get_regulator_voltage(MTK_REGULATOR_VCORE);
|
||||||
#else
|
#else
|
||||||
return 0;
|
return 0;
|
||||||
#endif
|
#endif
|
||||||
@ -377,7 +377,7 @@ unsigned int dramc_set_vmdd_voltage(unsigned int ddr_type, unsigned int vdram)
|
|||||||
#ifdef MTK_PMIC_MT6359
|
#ifdef MTK_PMIC_MT6359
|
||||||
mtk_regulator_set_voltage(®_vdram, vdram, MAX_VDRAM);
|
mtk_regulator_set_voltage(®_vdram, vdram, MAX_VDRAM);
|
||||||
#elif defined(FOR_COREBOOT)
|
#elif defined(FOR_COREBOOT)
|
||||||
mainboard_set_regulator_vol(MTK_REGULATOR_VDD2, vdram);
|
mainboard_set_regulator_voltage(MTK_REGULATOR_VDD2, vdram);
|
||||||
#endif
|
#endif
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -387,7 +387,7 @@ unsigned int dramc_get_vmdd_voltage(unsigned int ddr_type)
|
|||||||
#ifdef MTK_PMIC_MT6359
|
#ifdef MTK_PMIC_MT6359
|
||||||
return mtk_regulator_get_voltage(®_vdram);
|
return mtk_regulator_get_voltage(®_vdram);
|
||||||
#elif defined(FOR_COREBOOT)
|
#elif defined(FOR_COREBOOT)
|
||||||
return mainboard_get_regulator_vol(MTK_REGULATOR_VDD2);
|
return mainboard_get_regulator_voltage(MTK_REGULATOR_VDD2);
|
||||||
#else
|
#else
|
||||||
return 0;
|
return 0;
|
||||||
#endif
|
#endif
|
||||||
@ -398,7 +398,7 @@ unsigned int dramc_set_vmddq_voltage(unsigned int ddr_type, unsigned int vddq)
|
|||||||
#ifdef MTK_PMIC_MT6359
|
#ifdef MTK_PMIC_MT6359
|
||||||
mtk_regulator_set_voltage(®_vddq, vddq, MAX_VDDQ);
|
mtk_regulator_set_voltage(®_vddq, vddq, MAX_VDDQ);
|
||||||
#elif defined(FOR_COREBOOT)
|
#elif defined(FOR_COREBOOT)
|
||||||
mainboard_set_regulator_vol(MTK_REGULATOR_VDDQ, vddq);
|
mainboard_set_regulator_voltage(MTK_REGULATOR_VDDQ, vddq);
|
||||||
#endif
|
#endif
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -408,7 +408,7 @@ unsigned int dramc_get_vmddq_voltage(unsigned int ddr_type)
|
|||||||
#ifdef MTK_PMIC_MT6359
|
#ifdef MTK_PMIC_MT6359
|
||||||
return mtk_regulator_get_voltage(®_vddq);
|
return mtk_regulator_get_voltage(®_vddq);
|
||||||
#elif defined(FOR_COREBOOT)
|
#elif defined(FOR_COREBOOT)
|
||||||
return mainboard_get_regulator_vol(MTK_REGULATOR_VDDQ);
|
return mainboard_get_regulator_voltage(MTK_REGULATOR_VDDQ);
|
||||||
#else
|
#else
|
||||||
return 0;
|
return 0;
|
||||||
#endif
|
#endif
|
||||||
@ -419,7 +419,7 @@ unsigned int dramc_set_vmddr_voltage(unsigned int vmddr)
|
|||||||
#ifdef MTK_PMIC_MT6359
|
#ifdef MTK_PMIC_MT6359
|
||||||
return mtk_regulator_set_voltage(®_vmddr, vmddr, MAX_VMDDR);
|
return mtk_regulator_set_voltage(®_vmddr, vmddr, MAX_VMDDR);
|
||||||
#elif defined(FOR_COREBOOT)
|
#elif defined(FOR_COREBOOT)
|
||||||
mainboard_set_regulator_vol(MTK_REGULATOR_VMDDR, vmddr);
|
mainboard_set_regulator_voltage(MTK_REGULATOR_VMDDR, vmddr);
|
||||||
return 0;
|
return 0;
|
||||||
#else
|
#else
|
||||||
return 0;
|
return 0;
|
||||||
@ -431,7 +431,7 @@ unsigned int dramc_get_vmddr_voltage(void)
|
|||||||
#ifdef MTK_PMIC_MT6359
|
#ifdef MTK_PMIC_MT6359
|
||||||
return mtk_regulator_get_voltage(®_vmddr);
|
return mtk_regulator_get_voltage(®_vmddr);
|
||||||
#elif defined(FOR_COREBOOT)
|
#elif defined(FOR_COREBOOT)
|
||||||
return mainboard_get_regulator_vol(MTK_REGULATOR_VMDDR);
|
return mainboard_get_regulator_voltage(MTK_REGULATOR_VMDDR);
|
||||||
#else
|
#else
|
||||||
return 0;
|
return 0;
|
||||||
#endif
|
#endif
|
||||||
@ -442,7 +442,7 @@ unsigned int dramc_set_vio18_voltage(unsigned int vio18)
|
|||||||
#ifdef MTK_PMIC_MT6359
|
#ifdef MTK_PMIC_MT6359
|
||||||
return mtk_regulator_set_voltage(®_vio18, vio18, MAX_VIO18);
|
return mtk_regulator_set_voltage(®_vio18, vio18, MAX_VIO18);
|
||||||
#elif defined(FOR_COREBOOT)
|
#elif defined(FOR_COREBOOT)
|
||||||
mainboard_set_regulator_vol(MTK_REGULATOR_VDD1, vio18);
|
mainboard_set_regulator_voltage(MTK_REGULATOR_VDD1, vio18);
|
||||||
return 0;
|
return 0;
|
||||||
#else
|
#else
|
||||||
return 0;
|
return 0;
|
||||||
@ -455,7 +455,7 @@ unsigned int dramc_get_vio18_voltage(void)
|
|||||||
#ifdef MTK_PMIC_MT6359
|
#ifdef MTK_PMIC_MT6359
|
||||||
return mtk_regulator_get_voltage(®_vio18);
|
return mtk_regulator_get_voltage(®_vio18);
|
||||||
#elif defined(FOR_COREBOOT)
|
#elif defined(FOR_COREBOOT)
|
||||||
return mainboard_get_regulator_vol(MTK_REGULATOR_VDD1);
|
return mainboard_get_regulator_voltage(MTK_REGULATOR_VDD1);
|
||||||
#else
|
#else
|
||||||
return 0;
|
return 0;
|
||||||
#endif
|
#endif
|
||||||
|
Reference in New Issue
Block a user