Merge "qpnp-smb2: force HVDCP to 5V before reboot"

This commit is contained in:
Linux Build Service Account 2016-11-08 11:18:26 -08:00 committed by Gerrit - the friendly Code Review server
commit 0b672e32a0
2 changed files with 12 additions and 1 deletions

View file

@ -1746,6 +1746,16 @@ static int smb2_remove(struct platform_device *pdev)
return 0;
}
static void smb2_shutdown(struct platform_device *pdev)
{
struct smb2 *chip = platform_get_drvdata(pdev);
struct smb_charger *chg = &chip->chg;
smblib_masked_write(chg, USBIN_OPTIONS_1_CFG_REG,
HVDCP_AUTONOMOUS_MODE_EN_CFG_BIT, 0);
smblib_write(chg, CMD_HVDCP_2_REG, FORCE_5V_BIT);
}
static const struct of_device_id match_table[] = {
{ .compatible = "qcom,qpnp-smb2", },
{ },
@ -1759,6 +1769,7 @@ static struct platform_driver smb2_driver = {
},
.probe = smb2_probe,
.remove = smb2_remove,
.shutdown = smb2_shutdown,
};
module_platform_driver(smb2_driver);

View file

@ -490,7 +490,7 @@ static int try_rerun_apsd_for_hvdcp(struct smb_charger *chg)
/* ensure hvdcp is enabled */
if (!get_effective_result(chg->hvdcp_disable_votable)) {
apsd_result = smblib_get_apsd_result(chg);
if (apsd_result->pst == POWER_SUPPLY_TYPE_USB_HVDCP) {
if (apsd_result->bit & (QC_2P0_BIT | QC_3P0_BIT)) {
/* rerun APSD */
smblib_dbg(chg, PR_MISC, "rerun APSD\n");
smblib_masked_write(chg, CMD_APSD_REG,