diff options
| author | Linux Build Service Account <lnxbuild@localhost> | 2017-03-30 15:31:23 -0700 |
|---|---|---|
| committer | Gerrit - the friendly Code Review server <code-review@localhost> | 2017-03-30 15:31:22 -0700 |
| commit | c93957ac9ad6bfaeb0ec2a59e65ba2b02c337ead (patch) | |
| tree | df1e463411d4d8f654bbce8778670e7823ec9091 /drivers/power | |
| parent | 8208716117d6ec62b423ea8c55e50ee672948ab6 (diff) | |
| parent | 606d9c3405bfd70f48a8552fa629bedb9e5988a4 (diff) | |
Merge "qcom: smblib: supsend USB input during boost"
Diffstat (limited to 'drivers/power')
| -rw-r--r-- | drivers/power/supply/qcom/smb-lib.c | 10 | ||||
| -rw-r--r-- | drivers/power/supply/qcom/smb-lib.h | 1 |
2 files changed, 11 insertions, 0 deletions
diff --git a/drivers/power/supply/qcom/smb-lib.c b/drivers/power/supply/qcom/smb-lib.c index 50af1087278a..6dceff89311d 100644 --- a/drivers/power/supply/qcom/smb-lib.c +++ b/drivers/power/supply/qcom/smb-lib.c @@ -1346,6 +1346,14 @@ int smblib_vbus_regulator_enable(struct regulator_dev *rdev) if (chg->otg_en) goto unlock; + if (!chg->usb_icl_votable) { + chg->usb_icl_votable = find_votable("USB_ICL"); + + if (!chg->usb_icl_votable) + return -EINVAL; + } + vote(chg->usb_icl_votable, USBIN_USBIN_BOOST_VOTER, true, 0); + rc = _smblib_vbus_regulator_enable(rdev); if (rc >= 0) chg->otg_en = true; @@ -1409,6 +1417,8 @@ int smblib_vbus_regulator_disable(struct regulator_dev *rdev) if (rc >= 0) chg->otg_en = false; + if (chg->usb_icl_votable) + vote(chg->usb_icl_votable, USBIN_USBIN_BOOST_VOTER, false, 0); unlock: mutex_unlock(&chg->otg_oc_lock); return rc; diff --git a/drivers/power/supply/qcom/smb-lib.h b/drivers/power/supply/qcom/smb-lib.h index 32a1c29bb376..048e7c2b4091 100644 --- a/drivers/power/supply/qcom/smb-lib.h +++ b/drivers/power/supply/qcom/smb-lib.h @@ -51,6 +51,7 @@ enum print_reason { #define VBUS_CC_SHORT_VOTER "VBUS_CC_SHORT_VOTER" #define PD_INACTIVE_VOTER "PD_INACTIVE_VOTER" #define BOOST_BACK_VOTER "BOOST_BACK_VOTER" +#define USBIN_USBIN_BOOST_VOTER "USBIN_USBIN_BOOST_VOTER" #define HVDCP_INDIRECT_VOTER "HVDCP_INDIRECT_VOTER" #define MICRO_USB_VOTER "MICRO_USB_VOTER" #define DEBUG_BOARD_VOTER "DEBUG_BOARD_VOTER" |
