summaryrefslogtreecommitdiff
path: root/drivers/power
diff options
context:
space:
mode:
authorAnirudh Ghayal <aghayal@codeaurora.org>2017-04-04 17:04:20 +0530
committerAnirudh Ghayal <aghayal@codeaurora.org>2017-04-14 19:35:50 +0530
commit7ba93fdab2e65c178e2879f881e79b9898f70a80 (patch)
tree45d025ca0fc4a7627bbb9f0704e4a06f8693c377 /drivers/power
parent406ab7d2d4f3a72f3ef1dd10f894e6c88ee3ac01 (diff)
power: smb-lib: Fix sink/source insertion/removal function ordering
On PM660 the charger buck/boost frequency is configured in the same register. Present ordering of the sink/source removal function call causes incorrect charger frequency configuration. Fix this by first calling sink_removal and then source_insertion function. Also, configure the buck frequency to the initial 5V USB value during source insertion. Change-Id: I0d436f7e0843f2ddaa3d09db05cec403d03b6893 Signed-off-by: Anirudh Ghayal <aghayal@codeaurora.org>
Diffstat (limited to 'drivers/power')
-rw-r--r--drivers/power/supply/qcom/smb-lib.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/power/supply/qcom/smb-lib.c b/drivers/power/supply/qcom/smb-lib.c
index 14e9c3a2254d..42833a2ebf06 100644
--- a/drivers/power/supply/qcom/smb-lib.c
+++ b/drivers/power/supply/qcom/smb-lib.c
@@ -3578,6 +3578,8 @@ static void typec_source_insertion(struct smb_charger *chg)
&& !is_client_vote_enabled(chg->usb_icl_votable, PD_VOTER)
&& !is_client_vote_enabled(chg->usb_icl_votable, USB_PSY_VOTER))
vote(chg->usb_icl_votable, LEGACY_UNKNOWN_VOTER, true, 100000);
+
+ smblib_set_opt_freq_buck(chg, chg->chg_freq.freq_5V);
}
static void typec_sink_insertion(struct smb_charger *chg)
@@ -3653,8 +3655,8 @@ static void smblib_handle_typec_insertion(struct smb_charger *chg,
typec_source_removal(chg);
typec_sink_insertion(chg);
} else {
- typec_source_insertion(chg);
typec_sink_removal(chg);
+ typec_source_insertion(chg);
}
rp = smblib_get_prop_ufp_mode(chg);