qcom: smb138x-charger: add vbus regulator
Add vbus regulator in USBIN-USBIN parallel mode. Change-Id: I57d5cc54aa789a942d5b1a5bc33677ba263d3284 Signed-off-by: Harry Yang <harryy@codeaurora.org>
This commit is contained in:
parent
71aeac7a9c
commit
1a62ba595f
1 changed files with 11 additions and 0 deletions
|
@ -1464,6 +1464,15 @@ static int smb138x_slave_probe(struct smb138x *chip)
|
|||
goto cleanup;
|
||||
}
|
||||
|
||||
if (chip->dt.pl_mode == POWER_SUPPLY_PL_USBIN_USBIN) {
|
||||
rc = smb138x_init_vbus_regulator(chip);
|
||||
if (rc < 0) {
|
||||
pr_err("Couldn't initialize vbus regulator rc=%d\n",
|
||||
rc);
|
||||
return rc;
|
||||
}
|
||||
}
|
||||
|
||||
rc = smb138x_init_parallel_psy(chip);
|
||||
if (rc < 0) {
|
||||
pr_err("Couldn't initialize parallel psy rc=%d\n", rc);
|
||||
|
@ -1488,6 +1497,8 @@ cleanup:
|
|||
smblib_deinit(chg);
|
||||
if (chip->parallel_psy)
|
||||
power_supply_unregister(chip->parallel_psy);
|
||||
if (chg->vbus_vreg && chg->vbus_vreg->rdev)
|
||||
regulator_unregister(chg->vbus_vreg->rdev);
|
||||
return rc;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue