[PATCH 2/2] arch: arm64: sdm845: starqltechn: fix max77705 interrupts

Dzmitry Sankouski posted 2 patches 1 month ago
There is a newer version of this series
[PATCH 2/2] arch: arm64: sdm845: starqltechn: fix max77705 interrupts
Posted by Dzmitry Sankouski 1 month ago
Since max77705 has a register, which indicates interrupt source, it acts
as an interrupt controller.

Use max77705 as an interrupt controller for charger and fuelgauge
subdevices.

Signed-off-by: Dzmitry Sankouski <dsankouski@gmail.com>
---
 arch/arm64/boot/dts/qcom/sdm845-samsung-starqltechn.dts | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/arch/arm64/boot/dts/qcom/sdm845-samsung-starqltechn.dts b/arch/arm64/boot/dts/qcom/sdm845-samsung-starqltechn.dts
index 03b63b987a18..7ccab6ba7d21 100644
--- a/arch/arm64/boot/dts/qcom/sdm845-samsung-starqltechn.dts
+++ b/arch/arm64/boot/dts/qcom/sdm845-samsung-starqltechn.dts
@@ -10,6 +10,7 @@
 #include <dt-bindings/input/linux-event-codes.h>
 #include <dt-bindings/gpio/gpio.h>
 #include <dt-bindings/leds/common.h>
+#include <dt-bindings/mfd/max77705.h>
 #include <dt-bindings/regulator/qcom,rpmh-regulator.h>
 #include <dt-bindings/sound/qcom,q6afe.h>
 #include <dt-bindings/sound/qcom,q6asm.h>
@@ -584,14 +585,16 @@ &uart9 {
 &i2c14 {
 	status = "okay";
 
-	pmic@66 {
+	max77705: pmic@66 {
 		compatible = "maxim,max77705";
 		reg = <0x66>;
 		interrupt-parent = <&pm8998_gpios>;
 		interrupts = <11 IRQ_TYPE_LEVEL_LOW>;
+		interrupt-controller;
 		pinctrl-0 = <&pmic_int_default>;
 		pinctrl-names = "default";
 		#address-cells = <1>;
+		#interrupt-cells = <2>;
 		#size-cells = <0>;
 
 		leds {
@@ -631,8 +634,8 @@ max77705_charger: charger@69 {
 		reg = <0x69>;
 		compatible = "maxim,max77705-charger";
 		monitored-battery = <&battery>;
-		interrupt-parent = <&pm8998_gpios>;
-		interrupts = <11 IRQ_TYPE_LEVEL_LOW>;
+		interrupt-parent = <&max77705>;
+		interrupts = <MAX77705_IRQ_CHG IRQ_TYPE_LEVEL_LOW>;
 
 	};
 
@@ -641,8 +644,8 @@ fuel-gauge@36 {
 		compatible = "maxim,max77705-battery";
 		power-supplies = <&max77705_charger>;
 		maxim,rsns-microohm = <5000>;
-		interrupt-parent = <&pm8998_gpios>;
-		interrupts = <11 IRQ_TYPE_LEVEL_LOW>;
+		interrupt-parent = <&max77705>;
+		interrupts = <MAX77705_IRQ_FG IRQ_TYPE_LEVEL_LOW>;
 	};
 };
 

-- 
2.39.5