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

Commit 0f2caf2d authored by qctecmdr Service's avatar qctecmdr Service Committed by Gerrit - the friendly Code Review server
Browse files

Merge "ARM: dts: msm: Specify qcom,five-pin-battery for SM8150 MTP/QRD"

parents e6b037b6 ce5bcb7f
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -368,6 +368,13 @@ First Level Node - FG Gen4 device
		    decrease when the battery SOC is low but not converging to
		    zero with battery voltage dropping rapidly below Vcutoff.

- qcom,five-pin-battery
	Usage:      optional
	Value type: <empty>
	Definition: A boolean property that when specified indicates that a
		    five pin battery is used. Based on this, time to full
		    calculations would use the Rbatt calculated properly.

==========================================================
Second Level Nodes - Peripherals managed by FG Gen4 driver
==========================================================
+1 −0
Original line number Diff line number Diff line
@@ -305,6 +305,7 @@
	qcom,battery-data = <&mtp_batterydata>;
	qcom,hold-soc-while-full;
	qcom,linearize-soc;
	qcom,five-pin-battery;
	/* ESR fast calibration */
	qcom,fg-esr-timer-chg-fast = <0 7>;
	qcom,fg-esr-timer-dischg-fast = <0 7>;
+1 −0
Original line number Diff line number Diff line
@@ -49,6 +49,7 @@
	qcom,battery-data = <&qrd_batterydata>;
	qcom,hold-soc-while-full;
	qcom,linearize-soc;
	qcom,five-pin-battery;
	/* ESR fast calibration */
	qcom,fg-esr-timer-chg-fast = <0 7>;
	qcom,fg-esr-timer-dischg-fast = <0 7>;
+4 −0
Original line number Diff line number Diff line
@@ -174,6 +174,8 @@ enum fg_sram_param_id {
	FG_SRAM_MONOTONIC_SOC,
	FG_SRAM_VOLTAGE_PRED,
	FG_SRAM_OCV,
	FG_SRAM_VBAT_FINAL,
	FG_SRAM_IBAT_FINAL,
	FG_SRAM_ESR,
	FG_SRAM_ESR_MDL,
	FG_SRAM_ESR_ACT,
@@ -491,6 +493,8 @@ struct fg_dbgfs {

extern int fg_decode_voltage_15b(struct fg_sram_param *sp,
	enum fg_sram_param_id id, int val);
extern int fg_decode_current_16b(struct fg_sram_param *sp,
	enum fg_sram_param_id id, int val);
extern int fg_decode_cc_soc(struct fg_sram_param *sp,
	enum fg_sram_param_id id, int value);
extern int fg_decode_value_16b(struct fg_sram_param *sp,
+10 −0
Original line number Diff line number Diff line
@@ -38,6 +38,16 @@ int fg_decode_voltage_15b(struct fg_sram_param *sp,
	return sp[id].value;
}

int fg_decode_current_16b(struct fg_sram_param *sp,
				enum fg_sram_param_id id, int value)
{
	value = sign_extend32(value, 15);
	sp[id].value = div_s64((s64)value * sp[id].denmtr, sp[id].numrtr);
	pr_debug("id: %d raw value: %x decoded value: %d\n", id, value,
		sp[id].value);
	return sp[id].value;
}

int fg_decode_cc_soc(struct fg_sram_param *sp,
				enum fg_sram_param_id id, int value)
{
Loading