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

Commit 8b377e17 authored by Harry Yang's avatar Harry Yang
Browse files

power: smb5-lib: Ignore repetitive PD_ACTIVE notice in PD session



If PD hard reset occurs while PD session is underway, charger driver
may receive duplicative PD_ACTIVE messages from PD driver. Handling
them is unnecessary and incurs delay, which may lead to another hard
reset.

No operation for repetitive PD_ACTIVE message while PD is active.

Change-Id: If7f4f5efd47808716085c612ecd1c60e220d3ef9
Signed-off-by: default avatarHarry Yang <harryy@codeaurora.org>
parent 580b80dd
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -4074,6 +4074,13 @@ int smblib_set_prop_pd_active(struct smb_charger *chg,
	int rc = 0;
	int sec_charger;

	/*
	 * Ignore repetitive notification while PD is active, which
	 * is caused by hard reset.
	 */
	if (chg->pd_active && chg->pd_active == val->intval)
		return 0;

	chg->pd_active = val->intval;

	smblib_apsd_enable(chg, !chg->pd_active);