[PATCH 4/7] arm64: dts: qcom: msm8916-samsung-fortuna: Add rt5033 battery

Lin, Meng-Bo linmengbo0689 at protonmail.com
Wed Jun 21 17:04:25 PDT 2023


From: Joe Mason <buddyjojo06 at outlook.com>

Like the Samsung Galaxy A3/A5, the Grand Prime uses a Richtek RT5033 PMIC
as battery fuel gauge, charger, flash LED and for some regulators.
For now, only add the fuel gauge/battery device to the device tree, so we
can check the remaining battery percentage.

The other RT5033 drivers need some more work first before they can be used
properly.

Signed-off-by: Joe Mason <buddyjojo06 at outlook.com>
Signed-off-by: Lin, Meng-Bo <linmengbo0689 at protonmail.com>
---
 .../qcom/msm8916-samsung-fortuna-common.dtsi  | 22 +++++++++++++++++++
 1 file changed, 22 insertions(+)

diff --git a/arch/arm64/boot/dts/qcom/msm8916-samsung-fortuna-common.dtsi b/arch/arm64/boot/dts/qcom/msm8916-samsung-fortuna-common.dtsi
index 40c8edc795b0..ca147310c27a 100644
--- a/arch/arm64/boot/dts/qcom/msm8916-samsung-fortuna-common.dtsi
+++ b/arch/arm64/boot/dts/qcom/msm8916-samsung-fortuna-common.dtsi
@@ -79,6 +79,21 @@ muic: extcon at 25 {
 	};
 };
 
+&blsp_i2c4 {
+	status = "okay";
+
+	battery at 35 {
+		compatible = "richtek,rt5033-battery";
+		reg = <0x35>;
+
+		interrupt-parent = <&tlmm>;
+		interrupts = <121 IRQ_TYPE_EDGE_FALLING>;
+
+		pinctrl-0 = <&fg_alert_default>;
+		pinctrl-names = "default";
+	};
+};
+
 &blsp_uart2 {
 	status = "okay";
 };
@@ -127,6 +142,13 @@ &wcnss_iris {
 };
 
 &tlmm {
+	fg_alert_default: fg-alert-default-state {
+		pins = "gpio121";
+		function = "gpio";
+		drive-strength = <2>;
+		bias-disable;
+	};
+
 	gpio_keys_default: gpio-keys-default-state {
 		pins = "gpio107", "gpio109";
 		function = "gpio";
-- 
2.39.2





More information about the linux-arm-kernel mailing list