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

Commit 89aac38f authored by Ashay Jaiswal's avatar Ashay Jaiswal Committed by Gerrit - the friendly Code Review server
Browse files

power: qpnp-smbcharger: update OTG status change to FG for PMI8950/8994



Fuel Gauge needs OTG status change updates from charger to implement
workarounds. Update FG via power-supply framework whenever charger
detects change in the OTG status.

CRs-Fixed: 859531
Change-Id: I486c15a6f4195aeda3bff6826efd0da2ed371a16
Signed-off-by: default avatarAshay Jaiswal <ashayj@codeaurora.org>
parent f1d461b6
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -4078,6 +4078,10 @@ void update_usb_status(struct smbchg_chip *chip, bool usb_present, bool force)
		chip->usb_present = usb_present;
		handle_usb_removal(chip);
	}

	/* update FG */
	set_property_on_fg(chip, POWER_SUPPLY_PROP_STATUS,
			get_prop_batt_status(chip));
unlock:
	mutex_unlock(&chip->usb_status_lock);
}
@@ -5422,6 +5426,10 @@ static irqreturn_t usbid_change_handler(int irq, void *_chip)
	if (otg_present)
		pr_smb(PR_STATUS, "OTG detected\n");

	/* update FG */
	set_property_on_fg(chip, POWER_SUPPLY_PROP_STATUS,
			get_prop_batt_status(chip));

	return IRQ_HANDLED;
}