arm64: dts: qcom: msm8916-samsung-fortuna/rossa: Add fuel gauge
authorJoe Mason <buddyjojo06@outlook.com>
Fri, 16 Feb 2024 12:46:50 +0000 (12:46 +0000)
committerBjorn Andersson <andersson@kernel.org>
Fri, 16 Feb 2024 17:16:43 +0000 (11:16 -0600)
Like the Samsung Galaxy A3/A5, the Grand Prime/Core 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@outlook.com>
[Raymond: Move to fortuna-common. Use interrupts-extended]
Signed-off-by: Raymond Hackley <raymondhackley@protonmail.com>
Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org>
Link: https://lore.kernel.org/r/20240216124639.24689-1-raymondhackley@protonmail.com
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
arch/arm64/boot/dts/qcom/msm8916-samsung-fortuna-common.dtsi

index 052024073f54d36038e4c6d2d4e62ba45d13d4e7..c2800ad2dd5b2dc063b5eceb7b4a1d852a75e1a9 100644 (file)
        };
 };
 
+&blsp_i2c4 {
+       status = "okay";
+
+       fuel-gauge@35 {
+               compatible = "richtek,rt5033-battery";
+               reg = <0x35>;
+
+               interrupts-extended = <&tlmm 121 IRQ_TYPE_EDGE_FALLING>;
+
+               pinctrl-0 = <&fg_alert_default>;
+               pinctrl-names = "default";
+       };
+};
+
 &blsp_uart2 {
        status = "okay";
 };
 };
 
 &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";