Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ad710836 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "qcom: smb-lib: float D+/D- before running APSD at init" into msm-4.9

parents 8313e055 025e63a2
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -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,
+24 −3
Original line number Diff line number Diff line
@@ -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;
}