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

Commit 3a3a3988 authored by Abhijeet Dharmapurikar's avatar Abhijeet Dharmapurikar
Browse files

power: qpnp-smbcharger: set DP_DM before PRESENT and TYPE at bootup



It is expected that at charger insertion, DP_DM property be set prior
to setting the usb power supply's PRESENT and TYPE property and at
charger removal DP_DM property be set subsequent to setting the usb power
supply's PRESENT and TYPE property.

At the time of boot up, if a charger is found present the driver only sets
the PRESENT and TYPE property without setting DP_DM property. Fix this.

Change-Id: I5b8f721e033ef0f6ae06959f2352db3fa6abcc74
Signed-off-by: default avatarAbhijeet Dharmapurikar <adharmap@codeaurora.org>
parent b9ae0269
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -5458,10 +5458,14 @@ static int determine_initial_status(struct smbchg_chip *chip)
	chip->usb_present = is_usb_present(chip);
	chip->dc_present = is_dc_present(chip);

	if (chip->usb_present)
	if (chip->usb_present) {
		pr_smb(PR_MISC, "setting usb psy dp=f dm=f\n");
		power_supply_set_dp_dm(chip->usb_psy,
				POWER_SUPPLY_DP_DM_DPF_DMF);
		handle_usb_insertion(chip);
	else
	} else {
		handle_usb_removal(chip);
	}

	return 0;
}