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

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

power: smb135x-charger: type detection cleanup



The code prints out the type detected even after the flag indicating
these values should not be trusted is set (WRKARND_APSD_FAIL). This
causes confusion while reviewing the logs - fix it to reflect that
type detection didn't detect a valid usb type.

Change-Id: I00b8034c7d5e8396a1f6ebb80b11cd1173e8c435
Signed-off-by: default avatarAbhijeet Dharmapurikar <adharmap@codeaurora.org>
parent fe59e87b
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -1288,15 +1288,16 @@ static int handle_usb_insertion(struct smb135x_chg *chip)
		dev_err(chip->dev, "Couldn't read status 5 rc = %d\n", rc);
		return rc;
	}
	usb_type_name = get_usb_type_name(reg);
	usb_supply_type = get_usb_supply_type(reg);
	/*
	 * Report the charger type as UNKNOWN if the
	 * apsd-fail flag is set. This nofifies the USB driver
	 * to initiate a s/w based charger type detection.
	 */
	if (chip->workaround_flags & WRKARND_APSD_FAIL)
		usb_supply_type = POWER_SUPPLY_TYPE_UNKNOWN;
		reg = 0;

	usb_type_name = get_usb_type_name(reg);
	usb_supply_type = get_usb_supply_type(reg);
	pr_debug("inserted %s, usb psy type = %d stat_5 = 0x%02x\n",
			usb_type_name, usb_supply_type, reg);
	if (chip->usb_psy) {