power: pmic: rk8xx: enable under-voltage protection to rk817/rk809
The under-voltage protection will shutdown the LDO3 and reset the PMIC. Change-Id: Ic84c7ad1a2eed8c1f983e761988ffb903fc878af Signed-off-by: Shengfei Xu <xsf@rock-chips.com>
This commit is contained in:
parent
204f7c3926
commit
ba76dc003e
|
|
@ -13,17 +13,21 @@
|
|||
|
||||
DECLARE_GLOBAL_DATA_PTR;
|
||||
|
||||
static struct reg_data rk817_init_reg[] = {
|
||||
/* enable the under-voltage protection,
|
||||
* the under-voltage protection will shutdown the LDO3 and reset the PMIC
|
||||
*/
|
||||
{ RK817_BUCK4_CMIN, 0x60, 0x60},
|
||||
/*
|
||||
* Only when system suspend while U-Boot charge needs this config support
|
||||
*/
|
||||
#ifdef CONFIG_DM_CHARGE_DISPLAY
|
||||
static struct reg_data rk817_init_reg[] = {
|
||||
/* Set pmic_sleep as sleep function */
|
||||
{ RK817_PMIC_SYS_CFG3, 0x08, 0x18 },
|
||||
/* Set pmic_int active low */
|
||||
{ RK817_GPIO_INT_CFG, 0x00, 0x02 },
|
||||
};
|
||||
#endif
|
||||
};
|
||||
|
||||
static const struct pmic_child_info pmic_children_info[] = {
|
||||
{ .prefix = "DCDC", .driver = "rk8xx_buck"},
|
||||
|
|
@ -213,10 +217,8 @@ static int rk8xx_probe(struct udevice *dev)
|
|||
case RK817_ID:
|
||||
on_source = RK817_ON_SOURCE;
|
||||
off_source = RK817_OFF_SOURCE;
|
||||
#ifdef CONFIG_DM_CHARGE_DISPLAY
|
||||
init_data = rk817_init_reg;
|
||||
init_data_num = ARRAY_SIZE(rk817_init_reg);
|
||||
#endif
|
||||
power_en0 = pmic_reg_read(dev, RK817_POWER_EN0);
|
||||
power_en1 = pmic_reg_read(dev, RK817_POWER_EN1);
|
||||
power_en2 = pmic_reg_read(dev, RK817_POWER_EN2);
|
||||
|
|
|
|||
|
|
@ -211,6 +211,7 @@ enum {
|
|||
|
||||
#define RK8XX_ON_SOURCE 0xae
|
||||
#define RK8XX_OFF_SOURCE 0xaf
|
||||
#define RK817_BUCK4_CMIN 0xc6
|
||||
#define RK817_ON_SOURCE 0xf5
|
||||
#define RK817_OFF_SOURCE 0xf6
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue