Loading drivers/power/supply/qcom/qpnp-smb2.c +2 −2 Original line number Diff line number Diff line Loading @@ -1420,10 +1420,10 @@ static int smb2_init_hw(struct smb2 *chip) DEFAULT_VOTER, true, chip->dt.fv_uv); vote(chg->dc_icl_votable, DEFAULT_VOTER, true, chip->dt.dc_icl_ua); vote(chg->hvdcp_disable_votable_indirect, DEFAULT_VOTER, chip->dt.hvdcp_disable, 0); vote(chg->hvdcp_disable_votable_indirect, PD_INACTIVE_VOTER, true, 0); vote(chg->hvdcp_disable_votable_indirect, DEFAULT_VOTER, chip->dt.hvdcp_disable, 0); vote(chg->pd_disallowed_votable_indirect, CC_DETACHED_VOTER, true, 0); vote(chg->pd_disallowed_votable_indirect, HVDCP_TIMEOUT_VOTER, Loading drivers/power/supply/qcom/smb-lib.c +24 −3 Original line number Diff line number Diff line Loading @@ -778,10 +778,31 @@ int smblib_rerun_apsd_if_required(struct smb_charger *chg) return 0; apsd_result = smblib_get_apsd_result(chg); if ((apsd_result->pst == POWER_SUPPLY_TYPE_UNKNOWN) || (apsd_result->pst == POWER_SUPPLY_TYPE_USB)) { smblib_rerun_apsd(chg); if ((apsd_result->pst != POWER_SUPPLY_TYPE_UNKNOWN) && (apsd_result->pst != POWER_SUPPLY_TYPE_USB)) /* if type is not usb or unknown no need to rerun apsd */ return 0; /* fetch the DPDM regulator */ if (!chg->dpdm_reg && of_get_property(chg->dev->of_node, "dpdm-supply", NULL)) { chg->dpdm_reg = devm_regulator_get(chg->dev, "dpdm"); if (IS_ERR(chg->dpdm_reg)) { smblib_err(chg, "Couldn't get dpdm regulator rc=%ld\n", PTR_ERR(chg->dpdm_reg)); chg->dpdm_reg = NULL; } } if (chg->dpdm_reg && !regulator_is_enabled(chg->dpdm_reg)) { smblib_dbg(chg, PR_MISC, "enabling DPDM regulator\n"); rc = regulator_enable(chg->dpdm_reg); if (rc < 0) smblib_err(chg, "Couldn't enable dpdm regulator rc=%d\n", rc); } smblib_rerun_apsd(chg); return 0; } Loading Loading
drivers/power/supply/qcom/qpnp-smb2.c +2 −2 Original line number Diff line number Diff line Loading @@ -1420,10 +1420,10 @@ static int smb2_init_hw(struct smb2 *chip) DEFAULT_VOTER, true, chip->dt.fv_uv); vote(chg->dc_icl_votable, DEFAULT_VOTER, true, chip->dt.dc_icl_ua); vote(chg->hvdcp_disable_votable_indirect, DEFAULT_VOTER, chip->dt.hvdcp_disable, 0); vote(chg->hvdcp_disable_votable_indirect, PD_INACTIVE_VOTER, true, 0); vote(chg->hvdcp_disable_votable_indirect, DEFAULT_VOTER, chip->dt.hvdcp_disable, 0); vote(chg->pd_disallowed_votable_indirect, CC_DETACHED_VOTER, true, 0); vote(chg->pd_disallowed_votable_indirect, HVDCP_TIMEOUT_VOTER, Loading
drivers/power/supply/qcom/smb-lib.c +24 −3 Original line number Diff line number Diff line Loading @@ -778,10 +778,31 @@ int smblib_rerun_apsd_if_required(struct smb_charger *chg) return 0; apsd_result = smblib_get_apsd_result(chg); if ((apsd_result->pst == POWER_SUPPLY_TYPE_UNKNOWN) || (apsd_result->pst == POWER_SUPPLY_TYPE_USB)) { smblib_rerun_apsd(chg); if ((apsd_result->pst != POWER_SUPPLY_TYPE_UNKNOWN) && (apsd_result->pst != POWER_SUPPLY_TYPE_USB)) /* if type is not usb or unknown no need to rerun apsd */ return 0; /* fetch the DPDM regulator */ if (!chg->dpdm_reg && of_get_property(chg->dev->of_node, "dpdm-supply", NULL)) { chg->dpdm_reg = devm_regulator_get(chg->dev, "dpdm"); if (IS_ERR(chg->dpdm_reg)) { smblib_err(chg, "Couldn't get dpdm regulator rc=%ld\n", PTR_ERR(chg->dpdm_reg)); chg->dpdm_reg = NULL; } } if (chg->dpdm_reg && !regulator_is_enabled(chg->dpdm_reg)) { smblib_dbg(chg, PR_MISC, "enabling DPDM regulator\n"); rc = regulator_enable(chg->dpdm_reg); if (rc < 0) smblib_err(chg, "Couldn't enable dpdm regulator rc=%d\n", rc); } smblib_rerun_apsd(chg); return 0; } Loading