Skip to content

Commit efe2ccf

Browse files
JosephChen2017rkhuangtao
authored andcommitted
power: rk818-charger: 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: I445c1ec6aac9520593bfb53aa7681352417f0543 Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
1 parent 62a9f46 commit efe2ccf

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

drivers/power/rk818_charger.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1394,6 +1394,12 @@ static void rk818_cg_init_charger_state(struct rk818_charger *cg)
13941394
rk818_cg_init_finish_sig(cg);
13951395
rk818_cg_set_chrg_param(cg, cg->dc_charger);
13961396
rk818_cg_set_chrg_param(cg, cg->usb_charger);
1397+
1398+
if (cg->otg_in && cg->dc_in && cg->pdata->power_dc2otg) {
1399+
CG_INFO("otg power from dc adapter\n");
1400+
rk818_cg_set_otg_power(cg, USB_OTG_POWER_OFF);
1401+
}
1402+
13971403
CG_INFO("ac=%d, usb=%d, dc=%d, otg=%d, 5v=%d\n",
13981404
cg->ac_in, cg->usb_in, cg->dc_in, cg->otg_in, cg->otg_pmic5v);
13991405
}

0 commit comments

Comments
 (0)