diff mbox series

[11/18] ARM: dts: qcom: msm8974-lge-nexus5: correct fuel gauge interrupt trigger level

Message ID 20201210212534.216197-11-krzk@kernel.org (mailing list archive)
State New, archived
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: 45dfa741df86 ("ARM: dts: qcom: msm8974-lge-nexus5: Add fuel gauge")
Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
---
 arch/arm/boot/dts/qcom-msm8974-lge-nexus5-hammerhead.dts | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Iskren Chernev Dec. 11, 2020, 3:29 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: 45dfa741df86 ("ARM: dts: qcom: msm8974-lge-nexus5: Add fuel 
gauge")
 > Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
 > ---
 >  arch/arm/boot/dts/qcom-msm8974-lge-nexus5-hammerhead.dts | 2 +-
 >  1 file changed, 1 insertion(+), 1 deletion(-)
 >
 > diff --git a/arch/arm/boot/dts/qcom-msm8974-lge-nexus5-hammerhead.dts 
b/arch/arm/boot/dts/qcom-msm8974-lge-nexus5-hammerhead.dts
 > index e769f638f205..4c6f54aa9f66 100644
 > --- a/arch/arm/boot/dts/qcom-msm8974-lge-nexus5-hammerhead.dts
 > +++ b/arch/arm/boot/dts/qcom-msm8974-lge-nexus5-hammerhead.dts
 > @@ -575,7 +575,7 @@ fuelgauge: max17048@36 {
 >              maxim,rcomp = /bits/ 8 <0x4d>;
 >
 >              interrupt-parent = <&msmgpio>;
 > -            interrupts = <9 IRQ_TYPE_EDGE_FALLING>;
 > +            interrupts = <9 IRQ_TYPE_LEVEL_LOW>;
 >
 >              pinctrl-names = "default";
 >              pinctrl-0 = <&fuelgauge_pin>;

According to the datasheet for max17048 the ALRT pin is active low, so that
looks good. The reason it was implemented EDGE_FALLING is mostly due to
fragments taken from downstream, and the fact that it worked :)

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

Patch

diff --git a/arch/arm/boot/dts/qcom-msm8974-lge-nexus5-hammerhead.dts b/arch/arm/boot/dts/qcom-msm8974-lge-nexus5-hammerhead.dts
index e769f638f205..4c6f54aa9f66 100644
--- a/arch/arm/boot/dts/qcom-msm8974-lge-nexus5-hammerhead.dts
+++ b/arch/arm/boot/dts/qcom-msm8974-lge-nexus5-hammerhead.dts
@@ -575,7 +575,7 @@  fuelgauge: max17048@36 {
 			maxim,rcomp = /bits/ 8 <0x4d>;
 
 			interrupt-parent = <&msmgpio>;
-			interrupts = <9 IRQ_TYPE_EDGE_FALLING>;
+			interrupts = <9 IRQ_TYPE_LEVEL_LOW>;
 
 			pinctrl-names = "default";
 			pinctrl-0 = <&fuelgauge_pin>;