diff mbox series

[12/18] ARM: dts: qcom: msm8974-samsung-klte: correct fuel gauge interrupt trigger level

Message ID 20201210212534.216197-12-krzk@kernel.org
State Accepted
Commit 5fde3361ba57a9b4eb560dabf859176909d61004
Headers show
Series [01/18] ARM: dts: exynos: correct fuel gauge interrupt trigger level on GT-I9100 | expand

Commit Message

Krzysztof Kozlowski Dec. 10, 2020, 9:25 p.m. UTC
The Maxim fuel gauge datasheets describe the interrupt line as active
low with a requirement of acknowledge from the CPU.  The falling edge
interrupt will mostly work but it's not correct.

Fixes: da8d46992e67 ("ARM: dts: qcom: msm8974-klte: Add fuel gauge")
Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
---
 arch/arm/boot/dts/qcom-msm8974-samsung-klte.dts | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Iskren Chernev Dec. 11, 2020, 3:25 p.m. UTC | #1
On 12/10/20 11:25 PM, Krzysztof Kozlowski wrote:
 > The Maxim fuel gauge datasheets describe the interrupt line as active
 > low with a requirement of acknowledge from the CPU.  The falling edge
 > interrupt will mostly work but it's not correct.
 >
 > Fixes: da8d46992e67 ("ARM: dts: qcom: msm8974-klte: Add fuel gauge")
 > Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
 > ---
 >  arch/arm/boot/dts/qcom-msm8974-samsung-klte.dts | 2 +-
 >  1 file changed, 1 insertion(+), 1 deletion(-)
 >
 > diff --git a/arch/arm/boot/dts/qcom-msm8974-samsung-klte.dts 
b/arch/arm/boot/dts/qcom-msm8974-samsung-klte.dts
 > index 97352de91314..64a3fdb79539 100644
 > --- a/arch/arm/boot/dts/qcom-msm8974-samsung-klte.dts
 > +++ b/arch/arm/boot/dts/qcom-msm8974-samsung-klte.dts
 > @@ -691,7 +691,7 @@ fuelgauge@36 {
 >              maxim,rcomp = /bits/ 8 <0x56>;
 >
 >              interrupt-parent = <&pma8084_gpios>;
 > -            interrupts = <21 IRQ_TYPE_EDGE_FALLING>;
 > +            interrupts = <21 IRQ_TYPE_LEVEL_LOW>;
 >
 >              pinctrl-names = "default";
 >              pinctrl-0 = <&fuelgauge_pin>;

After testing this patch + the rfc modifying 17040 driver I can confirm it
works on the klte. Also, according to the max17048 datasheet, the ALRT pin
is active low, so everything is in order.

Acked-By: Iskren Chernev <iskren.chernev@gmail.com>
Tested-By: Iskren Chernev <iskren.chernev@gmail.com>
diff mbox series

Patch

diff --git a/arch/arm/boot/dts/qcom-msm8974-samsung-klte.dts b/arch/arm/boot/dts/qcom-msm8974-samsung-klte.dts
index 97352de91314..64a3fdb79539 100644
--- a/arch/arm/boot/dts/qcom-msm8974-samsung-klte.dts
+++ b/arch/arm/boot/dts/qcom-msm8974-samsung-klte.dts
@@ -691,7 +691,7 @@  fuelgauge@36 {
 			maxim,rcomp = /bits/ 8 <0x56>;
 
 			interrupt-parent = <&pma8084_gpios>;
-			interrupts = <21 IRQ_TYPE_EDGE_FALLING>;
+			interrupts = <21 IRQ_TYPE_LEVEL_LOW>;
 
 			pinctrl-names = "default";
 			pinctrl-0 = <&fuelgauge_pin>;