Skip to contentSkip to conversation

arm64: dts: qcom: sdm845-oneplus-*: add fuel gauge

PATCH Applied Caleb Connolly 2 participants 2 messages Jan 20, 2022 – Feb 1, 2022

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 arm64: dts: qcom: sdm845-oneplus-*: add fuel gauge

The OnePlus 6 and 6T feature a BQ27411 fuel gauge for reading the battery stats. Enable it and add a simple battery to document the battery specs of each device.

---
 arch/arm64/boot/dts/qcom/sdm845-oneplus-common.dtsi  | 11 +++++++++++
 .../arm64/boot/dts/qcom/sdm845-oneplus-enchilada.dts | 12 ++++++++++++
 arch/arm64/boot/dts/qcom/sdm845-oneplus-fajita.dts   | 12 ++++++++++++
 3 files changed, 35 insertions(+)
arch/arm64/boot/dts/qcom/sdm845-oneplus-common.dtsi +11 -0
index 7f42e5315ecb..08deca53f0b2 100644
@@ -376,6 +376,17 @@ zap-shader {
 	};
 };
 
+&i2c10 {
+	status = "okay";
+	clock-frequency = <100000>;
+
+	bq27441_fg: bq27441-battery@55 {
+		compatible = "ti,bq27411";
+		status = "okay";
+		reg = <0x55>;
+	};
+};
+
 &i2c12 {
 	status = "okay";
 	clock-frequency = <400000>;
arch/arm64/boot/dts/qcom/sdm845-oneplus-enchilada.dts +12 -0
index 5936b47dee5f..bf2cf92e8976 100644
@@ -13,6 +13,14 @@ / {
 	chassis-type = "handset";
 	qcom,msm-id = <0x141 0x20001>;
 	qcom,board-id = <8 0 17819 22>;
+
+	battery: battery {
+		compatible = "simple-battery";
+
+		charge-full-design-microamp-hours = <3300000>;
+		voltage-min-design-microvolt = <3400000>;
+		voltage-max-design-microvolt = <4400000>;
+	};
 };
 
 &display_panel {
@@ -20,3 +28,7 @@ &display_panel {
 
 	compatible = "samsung,sofef00";
 };
+
+&bq27441_fg {
+	monitored-battery = <&battery>;
+};
arch/arm64/boot/dts/qcom/sdm845-oneplus-fajita.dts +12 -0
index 78a0b99144e6..1b6b5bf368df 100644
@@ -13,6 +13,14 @@ / {
 	chassis-type = "handset";
 	qcom,msm-id = <0x141 0x20001>;
 	qcom,board-id = <8 0 18801 41>;
+
+	battery: battery {
+		compatible = "simple-battery";
+
+		charge-full-design-microamp-hours = <3700000>;
+		voltage-min-design-microvolt = <3400000>;
+		voltage-max-design-microvolt = <4400000>;
+	};
 };
 
 &display_panel {
@@ -21,6 +29,10 @@ &display_panel {
 	compatible = "samsung,s6e3fc2x01";
 };
 
+&bq27441_fg {
+	monitored-battery = <&battery>;
+};
+
 &rmi4_f12 {
 	touchscreen-y-mm = <148>;
 };

--
2.34.1

#1 lore raw

Re: (subset) [PATCH] arm64: dts: qcom: sdm845-oneplus-*: add fuel gauge

Quoted 5 lines · Caleb Connolly

The OnePlus 6 and 6T feature a BQ27411 fuel gauge for reading the battery stats. Enable it and add a simple battery to document the battery specs of each device.

Applied, thanks!

[1/1] arm64: dts: qcom: sdm845-oneplus-*: add fuel gauge

      commit: 12dfb002ca01feceac9eaa2cc8a55fdc9be4a9ae

Best regards,

Signature · 1 line
Bjorn Andersson <[email protected]>