power: rk816-battery: otg switch to dc charger power when init

Without this, otg supply is always provided by PMIC and PMIC
can not enter charge mode, because charge or otg supply output
is exclusive, only one choice at one time.

Change-Id: I4c00392d93abdf55b2b663e8a6a8822249c64d74
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
This commit is contained in:
chenjh 2018-06-06 11:17:24 +08:00 committed by Tao Huang
parent 72d2f69981
commit 6c93daca40

View File

@ -4089,6 +4089,10 @@ static int rk816_bat_init_charger(struct rk816_battery *di)
dc_charger = rk816_bat_init_dc_det(di);
rk816_bat_set_chrg_param(di, dc_charger);
if (di->dc_in && di->otg_in && di->pdata->power_dc2otg) {
BAT_INFO("otg power from dc adapter\n");
rk816_bat_set_otg_power(di, USB_OTG_POWER_OFF);
}
return 0;
}