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

Commit 43562020 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "power: smb1360: Add a DT property to prevent system sleep under min_soc"

parents e93cc545 84a0e948
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -61,6 +61,8 @@ Optional Properties:
- qcom,shdn-after-pwroff:	A bool property to configure smb1360 for shutdown at power-off.
- qcom,empty-soc-disabled:	A bool property to indicate whether stop updating empty_soc flag.
				System reports 0% SOC when empty_soc being set.
- qcom,awake-min-soc		A bool property to indicate whether the system is prevented from
				sleeping when SOC is under the min_soc threshold.
- qcom,batt-profile-select	A boolean flag to indicate of battery-profile
				selection is enabled.
- qcom,profile-a-rid-kohm	The battery-ID resistor (RID) in Kohm supported by
+8 −1
Original line number Diff line number Diff line
@@ -337,6 +337,7 @@ struct smb1360_chip {
	bool				resume_completed;
	bool				irq_waiting;
	bool				empty_soc;
	bool				awake_min_soc;
	int				workaround_flags;
	u8				irq_cfg_mask[3];
	int				usb_psy_ma;
@@ -1634,7 +1635,10 @@ static int delta_soc_handler(struct smb1360_chip *chip, u8 rt_stat)

static int min_soc_handler(struct smb1360_chip *chip, u8 rt_stat)
{
	pr_debug("SOC dropped below min SOC\n");
	pr_debug("SOC dropped below min SOC, rt_stat = 0x%02x\n", rt_stat);

	if (chip->awake_min_soc)
		rt_stat ? pm_stay_awake(chip->dev) : pm_relax(chip->dev);

	return 0;
}
@@ -3711,6 +3715,9 @@ static int smb_parse_dt(struct smb1360_chip *chip)
	if (rc < 0)
		chip->soc_min = -EINVAL;

	chip->awake_min_soc = of_property_read_bool(node,
					"qcom,awake-min-soc");

	rc = of_property_read_u32(node, "qcom,fg-voltage-min-mv",
					&chip->voltage_min_mv);
	if (rc < 0)