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

Commit a8ff857a authored by Abhijeet Dharmapurikar's avatar Abhijeet Dharmapurikar
Browse files

power: smb135x-charger: skip APSD rerun if battery is absent



When APSD reruns, it turns off the switcher preventing the power
drawn from the USB charger. If battery is not present then the device
will run without any input power when APSD rerun happens. This will
cause a brownout.

Prevent running APSD while battery is missing. The USB type detected
may not be correct but this prevents brownout.

CRs-Fixed: 834342
Change-Id: I933246b3bbb2abc97bdc927d5ab2a882fb100e68
Signed-off-by: default avatarAbhijeet Dharmapurikar <adharmap@codeaurora.org>
parent 5c6aadee
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -2689,7 +2689,8 @@ static int handle_usb_insertion(struct smb135x_chg *chip)
	usb_supply_type = get_usb_supply_type(reg);
	pr_debug("inserted %s, usb psy type = %d stat_5 = 0x%02x apsd_rerun = %d\n",
			usb_type_name, usb_supply_type, reg, chip->apsd_rerun);
	if (!chip->apsd_rerun && chip->usb_psy) {

	if (chip->batt_present && !chip->apsd_rerun && chip->usb_psy) {
		if (usb_supply_type == POWER_SUPPLY_TYPE_USB) {
			pr_debug("setting usb psy allow detection 1 SDP and rerun\n");
			power_supply_set_allow_detection(chip->usb_psy, 1);