From 73f818f4b5ef8f7dcb88f4c48990e249469d3fb3 Mon Sep 17 00:00:00 2001 From: mahj8 Date: Mon, 8 Nov 2021 19:07:50 +0800 Subject: [PATCH] charging: avoid vbus voltage increase to 12V If sometimes dm drop to 0V slowly, then vbus increase to 12V as dp 0.6V dm 0.6V. So first drop dm to 0V and then drop dp to 0.6V. Change-Id: I8db3b6273dd4be244b75513a0103a021719bf070 Signed-off-by: mahj8 Reviewed-on: https://gerrit.mot.com/2109927 SME-Granted: SME Approvals Granted SLTApproved: Slta Waiver Tested-by: Jira Key Reviewed-by: Huosheng Liao Reviewed-by: Lu Chai Submit-Approved: Jira Key --- drivers/power/sgm4154x_chg_mmi/sgm4154x_charger.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/power/sgm4154x_chg_mmi/sgm4154x_charger.c b/drivers/power/sgm4154x_chg_mmi/sgm4154x_charger.c index fab3dec3ef9a..0ce8645224a9 100644 --- a/drivers/power/sgm4154x_chg_mmi/sgm4154x_charger.c +++ b/drivers/power/sgm4154x_chg_mmi/sgm4154x_charger.c @@ -325,15 +325,15 @@ static int sgm4154x_adjust_qc20_hvdcp_5v(struct sgm4154x_device *sgm) int dp_val, dm_val; /* dp 0.6v and dm 0v out 5V */ - dp_val = 0x2<<3; - ret = regmap_update_bits(sgm->regmap, SGM4154x_CHRG_CTRL_d, - SGM4154x_DP_VSEL_MASK, dp_val); //dp 0.6v - if (ret) - return ret; - dm_val = 0x1<<1; ret = regmap_update_bits(sgm->regmap, SGM4154x_CHRG_CTRL_d, SGM4154x_DM_VSEL_MASK, dm_val); //dm 0v + if (ret) + return ret; + + dp_val = 0x2<<3; + ret = regmap_update_bits(sgm->regmap, SGM4154x_CHRG_CTRL_d, + SGM4154x_DP_VSEL_MASK, dp_val); //dp 0.6v return ret; }