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

Commit 3cae625e authored by Kiran Kumar's avatar Kiran Kumar Committed by laxman
Browse files

{Changes to fix repeated animation with 65W charger at 100%}



Change-Id: I770ca387dff3bb05f0633b5ed6b9ff751d3f599b
Signed-off-by: default avatarKiran Kumar <v-k.kumar@oneplus.com>
parent e560f764
Loading
Loading
Loading
Loading
+17 −0
Original line number Diff line number Diff line
@@ -60,6 +60,7 @@
#define BATT_TEMP_HYST                20
#define DASH_VALID_TEMP_LOW_THRESHOLD	125
#define DASH_VALID_TEMP_HIG_THRESHOLD	430
#define DASH_VALID_CAPACITY_HIG_THRESHOLD 90

#define PDO_SELECTION_INTERVAL_MS	5000

@@ -8077,6 +8078,12 @@ static void pd_skin_thermal_check_work(struct work_struct *work)
			msecs_to_jiffies(PD_CHECK_INTERVAL_PERIOD));
}

void op_set_swarp_charger(struct smb_charger *chg)
{
	chg->real_charger_type = POWER_SUPPLY_TYPE_DASH;
	enhance_dash_type_set(CHARGER_SWARP_65W);
}

/* @bsp, 2020/08/04, add to detect SVID */
static void pps_usbpd_connect_cb(struct usbpd_svid_handler *hdlr,
		bool peer_usb_comm)
@@ -8091,6 +8098,7 @@ static void pps_usbpd_connect_cb(struct usbpd_svid_handler *hdlr,
			cancel_delayed_work(&chg->check_switch_dash_work);
			schedule_delayed_work(&chg->check_switch_dash_work, msecs_to_jiffies(500));
		}
		op_set_swarp_charger(chg);
	}
	pr_info("SWARP adapter connected!\n");
}
@@ -8280,10 +8288,12 @@ bool is_fastchg_allowed(struct smb_charger *chg)
	static int pre_temp;
	static bool pre_switch_to_normal;
	bool low_temp_full, switch_to_normal, fw_updated;
	int cap = 0;

	temp = get_prop_batt_temp(chg);
	low_temp_full = op_get_fast_low_temp_full(chg);
	fw_updated = get_fastchg_firmware_updated_status(chg);
	cap = get_prop_batt_capacity(chg);

	if (!chg->chg_enabled)
		return false;
@@ -8302,6 +8312,13 @@ bool is_fastchg_allowed(struct smb_charger *chg)
		return false;
	}

	if (chg->swarp_online
		&& cap > DASH_VALID_CAPACITY_HIG_THRESHOLD
		&& (get_boot_mode() != MSM_BOOT_MODE_CHARGE)) {
		pr_err("capacity high, swarp adapter.");
		return false;
	}

	switch_to_normal = get_prop_fast_switch_to_normal(chg);
	if (pre_switch_to_normal != switch_to_normal)
		pr_info("switch_to_normal =%d\n", switch_to_normal);
+4 −0
Original line number Diff line number Diff line
@@ -154,6 +154,8 @@ enum print_reason {
#define DCIN_ICL_STEP_UA		100000
#define ROLE_REVERSAL_DELAY_MS		500

#define CHARGER_SWARP_65W		4

enum smb_mode {
	PARALLEL_MASTER = 0,
	PARALLEL_SLAVE,
@@ -896,6 +898,8 @@ extern int op_pdo_select(int vbus_mv, int ibus_ma);
extern int op_usbpd_send_svdm(u16 svid, u8 cmd,
		enum usbpd_svdm_cmd_type cmd_type, int obj_pos,
		const u32 *vdos, int num_vdos);
extern void enhance_dash_type_set(int type);

/* @bsp, 2019/07/05 Battery & Charging porting */
void op_bus_vote(int disable);
int get_prop_fast_adapter_update(struct smb_charger *chg);