Commit 8bb2314f authored by Krzysztof Kozlowski's avatar Krzysztof Kozlowski Committed by Sebastian Reichel
Browse files

power: supply: max17040: 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 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: default avatarKrzysztof Kozlowski <krzk@kernel.org>
Acked-by: default avatarIskren Chernev <iskren.chernev@gmail.com>
Acked-by: default avatarRob Herring <robh@kernel.org>
Signed-off-by: default avatarSebastian Reichel <sebastian.reichel@collabora.com>
parent 7fbf6b73
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -89,7 +89,7 @@ examples:
        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;
      };
    };
+1 −3
Original line number Diff line number Diff line
@@ -361,12 +361,10 @@ static irqreturn_t max17040_thread_handler(int id, void *dev)
static int max17040_enable_alert_irq(struct max17040_chip *chip)
{
	struct i2c_client *client = chip->client;
	unsigned int flags;
	int ret;

	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;