Skip to content

Commit

Permalink
power: supply: max17040: Do not enforce (incorrect) interrupt trigger…
Browse files Browse the repository at this point in the history
… 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 14577/77836 datasheets describe the interrupt line as active
low with a requirement of acknowledge from the CPU therefore the edge
falling is not correct.

Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>

---

This patch should wait till DTS changes are merged, as it relies on
proper Devicetree.
  • Loading branch information
krzk committed Dec 10, 2020
1 parent 851845a commit 4cb9d4f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ Example:
reg = <0x36>;
maxim,alert-low-soc-level = <10>;
interrupt-parent = <&gpio7>;
interrupts = <2 IRQ_TYPE_EDGE_FALLING>;
interrupts = <2 IRQ_TYPE_LEVEL_LOW>;
wakeup-source;
};

Expand Down
2 changes: 1 addition & 1 deletion drivers/power/supply/max17040_battery.c
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ static int max17040_enable_alert_irq(struct max17040_chip *chip)

flags = IRQF_TRIGGER_FALLING | IRQF_ONESHOT;
ret = devm_request_threaded_irq(&client->dev, client->irq, NULL,
max17040_thread_handler, flags,
max17040_thread_handler, IRQF_ONESHOT,
chip->battery->desc->name, chip);

return ret;
Expand Down

0 comments on commit 4cb9d4f

Please sign in to comment.