[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20230622020515.65823-1-linmengbo0689@protonmail.com>
Date: Thu, 22 Jun 2023 02:05:26 +0000
From: "Lin, Meng-Bo" <linmengbo0689@...tonmail.com>
To: linux-kernel@...r.kernel.org
Cc: Andy Gross <agross@...nel.org>,
Bjorn Andersson <andersson@...nel.org>,
Konrad Dybcio <konrad.dybcio@...aro.org>,
Rob Herring <robh+dt@...nel.org>,
Krzysztof Kozlowski <krzysztof.kozlowski+dt@...aro.org>,
Conor Dooley <conor+dt@...nel.org>,
Stephan Gerhold <stephan@...hold.net>,
Nikita Travkin <nikita@...n.ru>, linux-arm-msm@...r.kernel.org,
devicetree@...r.kernel.org, ~postmarketos/upstreaming@...ts.sr.ht
Subject: [PATCH 5/8] arm64: dts: qcom: msm8939-samsung-a7: Add rt5033 battery
The Samsung Galaxy A7 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: Lin, Meng-Bo <linmengbo0689@...tonmail.com>
---
.../boot/dts/qcom/msm8939-samsung-a7.dts | 37 +++++++++++++++++++
1 file changed, 37 insertions(+)
diff --git a/arch/arm64/boot/dts/qcom/msm8939-samsung-a7.dts b/arch/arm64/boot/dts/qcom/msm8939-samsung-a7.dts
index 6a817038a3b9..271dcea6da94 100644
--- a/arch/arm64/boot/dts/qcom/msm8939-samsung-a7.dts
+++ b/arch/arm64/boot/dts/qcom/msm8939-samsung-a7.dts
@@ -69,6 +69,29 @@ button-home {
};
};
+ i2c-fg {
+ compatible = "i2c-gpio";
+ sda-gpios = <&tlmm 106 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>;
+ scl-gpios = <&tlmm 105 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>;
+
+ pinctrl-0 = <&fg_i2c_default>;
+ pinctrl-names = "default";
+
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ battery@35 {
+ compatible = "richtek,rt5033-battery";
+ reg = <0x35>;
+
+ interrupt-parent = <&tlmm>;
+ interrupts = <121 IRQ_TYPE_EDGE_BOTH>;
+
+ pinctrl-0 = <&fg_alert_default>;
+ pinctrl-names = "default";
+ };
+ };
+
i2c-sensor {
compatible = "i2c-gpio";
sda-gpios = <&tlmm 84 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>;
@@ -234,6 +257,20 @@ accel_int_default: accel-int-default-state {
bias-disable;
};
+ fg_alert_default: fg-alert-default-state {
+ pins = "gpio121";
+ function = "gpio";
+ drive-strength = <2>;
+ bias-disable;
+ };
+
+ fg_i2c_default: fg-i2c-default-state {
+ pins = "gpio105", "gpio106";
+ function = "gpio";
+ drive-strength = <2>;
+ bias-disable;
+ };
+
gpio_hall_sensor_default: gpio-hall-sensor-default-state {
pins = "gpio52";
function = "gpio";
--
2.39.2
Powered by blists - more mailing lists