From fbff4fcc80b04e632c07592d7dc76bcbd6523061 Mon Sep 17 00:00:00 2001 From: Harry Yang Date: Thu, 17 Nov 2016 12:50:04 -0800 Subject: [PATCH] qcom-charger: smb2: Disable try.SINK mode in the probe Currently we disable try.SINK right before pd becomes active and re-enable it right after inactive. This breaks typec compliance. To fix it, disable try.SINK mode in the probe and never enable it. Change-Id: I61523188f45daca026b90943c845b43a8327f51e Signed-off-by: Harry Yang --- drivers/power/qcom-charger/qpnp-smb2.c | 7 +++++++ drivers/power/qcom-charger/smb-lib.c | 7 ------- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/power/qcom-charger/qpnp-smb2.c b/drivers/power/qcom-charger/qpnp-smb2.c index ee18ac271573..a6c08e8d62ec 100644 --- a/drivers/power/qcom-charger/qpnp-smb2.c +++ b/drivers/power/qcom-charger/qpnp-smb2.c @@ -1187,6 +1187,13 @@ static int smb2_init_hw(struct smb2 *chip) return rc; } + /* disable try.SINK mode */ + rc = smblib_masked_write(chg, TYPE_C_CFG_3_REG, EN_TRYSINK_MODE_BIT, 0); + if (rc < 0) { + dev_err(chg->dev, "Couldn't set TRYSINK_MODE rc=%d\n", rc); + return rc; + } + rc = smblib_masked_write(chg, QNOVO_PT_ENABLE_CMD_REG, QNOVO_PT_ENABLE_CMD_BIT, QNOVO_PT_ENABLE_CMD_BIT); if (rc < 0) { diff --git a/drivers/power/qcom-charger/smb-lib.c b/drivers/power/qcom-charger/smb-lib.c index 41260fc56077..781f5554f1bb 100644 --- a/drivers/power/qcom-charger/smb-lib.c +++ b/drivers/power/qcom-charger/smb-lib.c @@ -2081,13 +2081,6 @@ int smblib_set_prop_pd_active(struct smb_charger *chg, smblib_update_usb_type(chg); power_supply_changed(chg->usb_psy); - rc = smblib_masked_write(chg, TYPE_C_CFG_3_REG, EN_TRYSINK_MODE_BIT, - chg->pd_active ? 0 : EN_TRYSINK_MODE_BIT); - if (rc < 0) { - dev_err(chg->dev, "Couldn't set TRYSINK_MODE rc=%d\n", rc); - return rc; - } - return rc; }