power: supply: max17042: Do not enforce (incorrect) interrupt trigger type
authorKrzysztof Kozlowski <krzk@kernel.org>
Wed, 26 May 2021 17:20:35 +0000 (13:20 -0400)
committerSebastian Reichel <sebastian.reichel@collabora.com>
Fri, 4 Jun 2021 09:58:22 +0000 (11:58 +0200)
commit7fbf6b731bca347700e460d94b130f9d734b33e9
treeccdea4e431726913ca2f60b779d915bb2384a35d
parentb49a81d0fd021a1f0c8660fa40ad9984d9d1f5b7
power: supply: max17042: Do not enforce (incorrect) interrupt trigger type

Interrupt line can be configured on different hardware in different way,
even inverted.  Therefore driver should not enforce specific trigger
type - edge falling - but instead rely on Devicetree to configure it.

The Maxim 17047/77693 datasheets describe the interrupt line as active
low with a requirement of acknowledge from the CPU therefore the edge
falling is not correct.

The interrupt line is shared between PMIC and RTC driver, so using level
sensitive interrupt is here especially important to avoid races.  With
an edge configuration in case if first PMIC signals interrupt followed
shortly after by the RTC, the interrupt might not be yet cleared/acked
thus the second one would not be noticed.

Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
drivers/power/supply/max17042_battery.c