qpnp-smb2: force UFP mode before shutdown
If a legacy Type-A to Type-C cable is attached to the phone, but the Type-A end is left disconnected, then the VBUS capacitor will be charged when DRP toggles to DFP mode. Since VBUS is charged it will prevent the device from staying in power off state when shutdown. Fix this by forcing UFP mode before shutdown so the VBUS capacitor will be discharged, and therefore it will not trigger PON to restart the device. Change-Id: I53f89cf6b7c11f32c5e8e5a51a5986fa31424b92 Signed-off-by: Nicholas Troast <ntroast@codeaurora.org>
This commit is contained in:
parent
e2787f510d
commit
38fbbf2ca0
1 changed files with 6 additions and 1 deletions
|
@ -1837,8 +1837,13 @@ static void smb2_shutdown(struct platform_device *pdev)
|
|||
struct smb2 *chip = platform_get_drvdata(pdev);
|
||||
struct smb_charger *chg = &chip->chg;
|
||||
|
||||
/* configure power role for UFP */
|
||||
smblib_masked_write(chg, TYPE_C_INTRPT_ENB_SOFTWARE_CTRL_REG,
|
||||
TYPEC_POWER_ROLE_CMD_MASK, UFP_EN_CMD_BIT);
|
||||
|
||||
/* force HVDCP to 5V */
|
||||
smblib_masked_write(chg, USBIN_OPTIONS_1_CFG_REG,
|
||||
HVDCP_AUTONOMOUS_MODE_EN_CFG_BIT, 0);
|
||||
HVDCP_AUTONOMOUS_MODE_EN_CFG_BIT, 0);
|
||||
smblib_write(chg, CMD_HVDCP_2_REG, FORCE_5V_BIT);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue