Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0d5cbba6 authored by Ashay Jaiswal's avatar Ashay Jaiswal Committed by Guru Das Srinagesh
Browse files

power: smb5-lib: update charger switcher frequency for OTG



Add support to configure optimal charger switcher frequency
at OTG insertion and removal.

Change-Id: I448fd7165ca79f5deff7cdf442b687b2a6bd7ec5
Signed-off-by: default avatarAshay Jaiswal <ashayj@codeaurora.org>
parent 33bbcaf4
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -4582,7 +4582,13 @@ static bool smblib_src_lpd(struct smb_charger *chg)

static void typec_sink_insertion(struct smb_charger *chg)
{
	int rc;

	vote(chg->usb_icl_votable, OTG_VOTER, true, 0);
	rc = smblib_set_charge_param(chg, &chg->param.freq_switcher,
					chg->chg_freq.freq_above_otg_threshold);
	if (rc < 0)
		dev_err(chg->dev, "Error in setting freq_boost rc=%d\n", rc);

	if (chg->use_extcon) {
		smblib_notify_usb_host(chg, true);
@@ -4620,7 +4626,13 @@ static void typec_src_insertion(struct smb_charger *chg)

static void typec_sink_removal(struct smb_charger *chg)
{
	int rc;

	vote(chg->usb_icl_votable, OTG_VOTER, false, 0);
	rc = smblib_set_charge_param(chg, &chg->param.freq_switcher,
					chg->chg_freq.freq_removal);
	if (rc < 0)
		dev_err(chg->dev, "Error in setting freq_removal rc=%d\n", rc);

	if (chg->use_extcon) {
		if (chg->otg_present)