From 89ecc01a29f823f6740020cefa1cd3d17e90f985 Mon Sep 17 00:00:00 2001 From: Yonghua Yan Date: Tue, 23 Jul 2019 21:04:26 +0800 Subject: [PATCH] smb5: handle cc pin floated cable removal When use the CC pin floated USB cable to connect to PC or charger, typec mode cannot be detected, so it cannot use the typec removal when USB cable is removed. Since this USB cable make the device function as micro usb, so just call the micro usb removal. Change-Id: I6cf9fbcffa1fe05bade64dfce9309977e782eba4 Signed-off-by: Yonghua Yan Reviewed-on: https://gerrit.mot.com/1390306 SLTApproved: Slta Waiver SME-Granted: SME Approvals Granted Tested-by: Jira Key Reviewed-by: Jianqi Yang Submit-Approved: Jira Key Reviewed-on: https://gerrit.mot.com/1770289 Reviewed-by: Huosheng Liao --- drivers/power/supply/qcom/smb5-lib.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/power/supply/qcom/smb5-lib.c b/drivers/power/supply/qcom/smb5-lib.c index dfaf35b9a9b3..1e6f981afff1 100644 --- a/drivers/power/supply/qcom/smb5-lib.c +++ b/drivers/power/supply/qcom/smb5-lib.c @@ -5780,7 +5780,8 @@ static void smblib_usb_plugin_locked(struct smb_charger *chg) smblib_update_usb_type(chg); } - if (chg->connector_type == QTI_POWER_SUPPLY_CONNECTOR_MICRO_USB) + if (chg->connector_type == QTI_POWER_SUPPLY_CONNECTOR_MICRO_USB || + chg->typec_mode == QTI_POWER_SUPPLY_TYPEC_NONE) smblib_micro_usb_plugin(chg, vbus_rising); vote(chg->temp_change_irq_disable_votable, DEFAULT_VOTER,