qpnp-smb2: force HVDCP to 5V before reboot

When the MSM resets the USB data lines are pulled low. If an HVDCP adapter
is attached and operating at >5V, and the phone reboots then the HVDCP
adapter will be in a bad state and the USB input will be suspended. Fix
this by forcing the HVDCP adapter to 5V in the shutdown path.

Change-Id: I953d42418f90398bd4248f8b761cf63943ce5532
Signed-off-by: Nicholas Troast <ntroast@codeaurora.org>
This commit is contained in:
Nicholas Troast 2016-10-28 11:02:03 -07:00
parent 8645a77a46
commit ab23ab8211

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);