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

Commit c48fba48 authored by Zhenhua Huang's avatar Zhenhua Huang
Browse files

ARM: dts: msm: add device info for reducing power stage



B-family PMIC can optionally support reducing power stage
for improving IADC accurancy. This work around occupies while
charging under high load during low battery voltages. In case
board has a bad layout, customer can enable it manually.

Change-Id: I6c11cddfb92c657f8cbbbf9d77d30af44ba80b70
Signed-off-by: default avatarZhenhua Huang <zhenhuah@codeaurora.org>
parent f5edc513
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -96,6 +96,10 @@ Parent node optional properties:
- qcom,ibat-calibration-enabled		Indicates if ibat calibration is enabled. This is
					required for devices which have a ibat trim error
					causing ibatmax to go out of spec.
- qcom,power-stage-reduced		Indicates if power stage workaround is enabled. This work
					around reduces the power stage segments while charging
					under high load during low battery voltages. It's for
					improving IADC accuracy while board has a bad layout.

Sub node required structure:
- A qcom,chg node must be a child of an SPMI node that has specified
+7 −1
Original line number Diff line number Diff line
@@ -374,6 +374,7 @@ struct qpnp_chg_chip {
	struct alarm			reduce_power_stage_alarm;
	struct work_struct		reduce_power_stage_work;
	bool				power_stage_workaround_running;
	bool				power_stage_workaround_enable;
};


@@ -2185,7 +2186,8 @@ qpnp_batt_external_power_changed(struct power_supply *psy)

			if ((chip->flags & POWER_STAGE_WA)
			&& ((ret.intval / 1000) > USB_WALL_THRESHOLD_MA)
			&& !chip->power_stage_workaround_running) {
			&& !chip->power_stage_workaround_running
			&& chip->power_stage_workaround_enable) {
				chip->power_stage_workaround_running = true;
				pr_debug("usb wall chg inserted starting power stage workaround charger_monitor = %d\n",
						charger_monitor);
@@ -4326,6 +4328,10 @@ qpnp_charger_read_dt_props(struct qpnp_chg_chip *chip)
			of_property_read_bool(chip->spmi->dev.of_node,
					"qcom,ibat-calibration-enabled");

	chip->power_stage_workaround_enable =
			of_property_read_bool(chip->spmi->dev.of_node,
					"qcom,power-stage-reduced");

	of_get_property(chip->spmi->dev.of_node, "qcom,thermal-mitigation",
		&(chip->thermal_levels));