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

Commit 97b2a779 authored by Ashay Jaiswal's avatar Ashay Jaiswal Committed by Harry Yang
Browse files

qpnp-smb2: Add DT option for enabling input suspend on fake battery



Input suspend on fake battery feature is by default enabled in the
software, add a DT property to enable/disable the feature.

Change-Id: I06bda6c72010699f4be24ff6044fe3bb248b06fb
Signed-off-by: default avatarAshay Jaiswal <ashayj@codeaurora.org>
Signed-off-by: default avatarHarry Yang <harryy@codeaurora.org>
parent 487ff740
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -163,6 +163,12 @@ Charger specific properties:
  Definition: Boolean flag which indicates that the platform only support
		micro usb port.

- qcom,suspend-input-on-debug-batt
  Usage:      optional
  Value type: <empty>
  Definition: Boolean flag which when present enables intput suspend for
		debug battery.

=============================================
Second Level Nodes - SMB2 Charger Peripherals
=============================================
+2 −0
Original line number Diff line number Diff line
@@ -387,6 +387,8 @@ static int smb2_parse_dt(struct smb2 *chip)

	chg->dcp_icl_ua = chip->dt.usb_icl_ua;

	chg->suspend_input_on_debug_batt = of_property_read_bool(node,
					"qcom,suspend-input-on-debug-batt");
	return 0;
}

+3 −0
Original line number Diff line number Diff line
@@ -662,6 +662,9 @@ void smblib_suspend_on_debug_battery(struct smb_charger *chg)
	int rc;
	union power_supply_propval val;

	if (!chg->suspend_input_on_debug_batt)
		return;

	rc = power_supply_get_property(chg->bms_psy,
			POWER_SUPPLY_PROP_DEBUG_BATTERY, &val);
	if (rc < 0) {
+1 −0
Original line number Diff line number Diff line
@@ -242,6 +242,7 @@ struct smb_charger {
	bool			micro_usb_mode;
	bool			otg_en;
	bool			vconn_en;
	bool			suspend_input_on_debug_batt;
	int			otg_attempts;
	int			vconn_attempts;