set ACIN current limit

Signed-off-by: August <mingxin.android@gmail.com>
This commit is contained in:
August 2018-07-28 18:51:06 +08:00
parent e75b08e946
commit 555ca787b7
8 changed files with 20 additions and 1 deletions

View file

@ -53,6 +53,24 @@ int pwrok_restart_enable(void)
static int axp_probe(void)
{
u8 pmu_type;
u8 acin_path;
/* bpi, set VBUS current limit from 1500mA to 3500mA */
if(axp_i2c_read(AXP81X_ADDR, BOOT_POWER81X_ACIN_PATH, &acin_path))
{
printf("axp read error\n");
return -1;
}
printf("[BPI] set ac cur limit to 3500mA\n");
acin_path &= 0xf8;
acin_path |= 0x04;
if(axp_i2c_write(AXP81X_ADDR, BOOT_POWER81X_ACIN_PATH, acin_path))
{
printf("axp write error\n");
return -1;
}
if(axp_i2c_read(AXP81X_ADDR, 0x3, &pmu_type))
{

View file

@ -225,7 +225,7 @@ static int sunxi_probe_power_state(void)
if (pmu_bat_unused || (__bat_exist <= 0))
{
pr_notice("no battery exist\n");
printf("no battery exist, boot normal\n");
return SUNXI_STATE_NORMAL_BOOT;
}

View file

@ -75,6 +75,7 @@
#define BOOT_POWER81X_CHARGE1 (0x33)
#define BOOT_POWER81X_CHARGE2 (0x34)
#define BOOT_POWER81X_CHARGE3 (0x35)
#define BOOT_POWER81X_ACIN_PATH (0x3A)
#define BOOT_POWER81X_BAT_AVERVOL_H8 (0x50)//----------
#define BOOT_POWER81X_BAT_AVERVOL_L4 (0x51)//-----------