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

Commit c0b6ecee authored by Umang Agrawal's avatar Umang Agrawal Committed by Shilpa Suresh
Browse files

power: qpnp-smb2: Add dt property to disable STAT SW_OVERRIDE



Add boolean device tree property to disable STAT pin SW_OVERRIDE
default configuration. This is required for enabling main charger
control over enable/disable of slave charger.

STAT pin SW override is disabled by default in case of presence of
parallel charger. But for SMB1390 case, it is required to define
this property to explicitly disable STAT pin SW override in order
to enable the charge pump.

Change-Id: I4539ffbe5c6f1135c212fb7fa13a802020798093
Signed-off-by: default avatarUmang Agrawal <uagrawal@codeaurora.org>
parent bcf27738
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -193,6 +193,12 @@ Charger specific properties:
		to be get from these properties defined in battery profile:
		qcom,step-chg-ranges, qcom,jeita-fcc-ranges, qcom,jeita-fv-ranges.

- qcom,disable-stat-sw-override
  Usage:      optional
  Value type: bool
  Definition: Boolean flag which when present disables STAT pin default software
		override configuration.

=============================================
Second Level Nodes - SMB2 Charger Peripherals
=============================================
+13 −0
Original line number Diff line number Diff line
@@ -326,6 +326,9 @@ static int smb2_parse_dt(struct smb2 *chip)
	if (rc < 0)
		chg->otg_delay_ms = OTG_DEFAULT_DEGLITCH_TIME_MS;

	chg->disable_stat_sw_override = of_property_read_bool(node,
					"qcom,disable-stat-sw-override");

	return 0;
}

@@ -1836,6 +1839,16 @@ static int smb2_init_hw(struct smb2 *chip)
		}
	}

	if (chg->disable_stat_sw_override) {
		rc = smblib_masked_write(chg, STAT_CFG_REG,
				STAT_SW_OVERRIDE_CFG_BIT, 0);
		if (rc < 0) {
			dev_err(chg->dev, "Couldn't disable STAT SW override rc=%d\n",
				rc);
			return rc;
		}
	}

	return rc;
}

+1 −0
Original line number Diff line number Diff line
@@ -350,6 +350,7 @@ struct smb_charger {
	u8			float_cfg;
	bool			use_extcon;
	bool			otg_present;
	bool			disable_stat_sw_override;

	/* workaround flag */
	u32			wa_flags;