[7/8] arm64: dts: qcom: msm8916-samsung-gt5-common: Add fuelgauge

Message ID 20230105123240.1089375-8-nikita@trvn.ru
State New
Headers
Series Add support for Samsung Galaxy tab A (2015) tablets |

Commit Message

Nikita Travkin Jan. 5, 2023, 12:32 p.m. UTC
  gt5 devices use additional MAX77849 MFD to handle battery, charging
and usb switching. Fuel-gauge from this MFD has a separate i2c line.

Signed-off-by: Nikita Travkin <nikita@trvn.ru>
---
 .../dts/qcom/msm8916-samsung-gt5-common.dtsi  | 27 +++++++++++++++++++
 1 file changed, 27 insertions(+)
  

Patch

diff --git a/arch/arm64/boot/dts/qcom/msm8916-samsung-gt5-common.dtsi b/arch/arm64/boot/dts/qcom/msm8916-samsung-gt5-common.dtsi
index 9cdb33247691..9f97a8129278 100644
--- a/arch/arm64/boot/dts/qcom/msm8916-samsung-gt5-common.dtsi
+++ b/arch/arm64/boot/dts/qcom/msm8916-samsung-gt5-common.dtsi
@@ -63,6 +63,25 @@  hall-sensor-switch {
 	};
 };
 
+&blsp_i2c4 {
+	status = "okay";
+
+	fuelgauge@36 {
+		compatible = "maxim,max77849-battery";
+		reg = <0x36>;
+
+		maxim,rsns-microohm = <10000>;
+		maxim,over-heat-temp = <600>;
+		maxim,over-volt = <4400>;
+
+		interrupt-parent = <&msmgpio>;
+		interrupts = <121 IRQ_TYPE_EDGE_FALLING>;
+
+		pinctrl-0 = <&fuelgauge_int_default>;
+		pinctrl-names = "default";
+	};
+};
+
 &blsp1_uart2 {
 	status = "okay";
 };
@@ -218,6 +237,14 @@  l18 {
 };
 
 &msmgpio {
+	fuelgauge_int_default: fuelgauge-int-default-state {
+		pins = "gpio121";
+		function = "gpio";
+
+		drive-strength = <2>;
+		bias-disable;
+	};
+
 	gpio_keys_default: gpio-keys-default-state {
 		pins = "gpio107", "gpio109";
 		function = "gpio";