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

Commit 6cfab062 authored by Xiaozhe Shi's avatar Xiaozhe Shi Committed by Abhijeet Dharmapurikar
Browse files

power: qpnp-smbcharger: turn off USB APSD reruns by default



Currently USB APSD reruns are enabled by default and it is not needed on
MSM8994 devices. Make this feature selectively configurable to avoid the
extra detection time on platforms where this is not needed.

CRs-Fixed: 837882
Change-Id: If4e07d0ed5653ee3fe111a03748a9d0f1acbddac
Signed-off-by: default avatarXiaozhe Shi <xiaozhes@codeaurora.org>
parent 6cb955a8
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -258,6 +258,10 @@ Optional Properties:
- qcom,chg-led-support		A bool property to support the charger led feature.
- qcom,chg-led-sw-controls		A bool property to allow the software to control
					the charger led without a valid charger.
- qcom,rerun-apsd		A bool property that will force the charger to
				force the msm USB phy to relinquish control of the
				USB data lines and rerun APSD when a USB SDP is
				selected.

Example:
	qcom,qpnp-smbcharger {
+5 −1
Original line number Diff line number Diff line
@@ -235,6 +235,7 @@ struct smbchg_chip {
	struct mutex			usb_status_lock;
	/* apsd workaround */
	struct work_struct		rerun_apsd_work;
	bool				do_apsd_reruns;
	bool				apsd_rerun;
	bool				apsd_rerun_ignore_uv_irq;
	struct completion		apsd_src_det_lowered;
@@ -4319,7 +4320,8 @@ static void handle_usb_insertion(struct smbchg_chip *chip)
		power_supply_set_allow_detection(chip->usb_psy, 1);
	}

	if (!chip->apsd_rerun && usb_supply_type == POWER_SUPPLY_TYPE_USB) {
	if (chip->do_apsd_reruns && !chip->apsd_rerun
			&& usb_supply_type == POWER_SUPPLY_TYPE_USB) {
		chip->apsd_rerun = true;
		schedule_work(&chip->rerun_apsd_work);
		return;
@@ -5506,6 +5508,8 @@ static int smb_parse_dt(struct smbchg_chip *chip)
					"qcom,low-volt-dcin");
	chip->force_aicl_rerun = of_property_read_bool(node,
					"qcom,force-aicl-rerun");
	chip->do_apsd_reruns = of_property_read_bool(node,
					"qcom,rerun-apsd");

	/* parse the battery missing detection pin source */
	rc = of_property_read_string(chip->spmi->dev.of_node,