Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp5121814pxu; Thu, 10 Dec 2020 13:33:27 -0800 (PST) X-Google-Smtp-Source: ABdhPJwPY1D9cTPqDDFI/Hu16caAAqRG9pS7xgh6qKpuwZg8lpu7X/XbHgAmR8V6M/f+yial1Yl7 X-Received: by 2002:a17:907:6e9:: with SMTP id yh9mr8173053ejb.131.1607636007605; Thu, 10 Dec 2020 13:33:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607636007; cv=none; d=google.com; s=arc-20160816; b=ElqBwtVzJ1vmFc7zJzz6NV4C8x32Xs26a2cr8evkvSR8yzLddF97SubO6m5f8dJOxd JHc9zQ57Tsaelm9IDCMfScSVZWSTlclg788cl+xUH5SAqCYXqS6tUuYv1Iwgxwc35lHI LCQirT1sE6/QT1Jz3aIpmn503SN6G0Cv+wGiPDSGIeyWTd5JntU/Xj145hMTTQ0K0q6o 6rUqPOjCygsLiKmt0zgwgWDHpj/JYfoiOwwuty7TrorHE0feXDx6u1bON1r8di2LmEYw yUqbxWz6xpswIuMpDjjIcU+QBMy0DidybkSWUVo29JxFiPUOEbEereHW7IuwHroOx5Ck 691g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=gIrXWxIq6XWwGLhVMyPUJ3UQVmxMxKNuGRtKQWdAA2Y=; b=T1m3Zle5qo0+x2ggKvDw9E2r5tUU5zDRMAshK1sKEUdrEKYP2dl2PfQE/KSFW9in54 KQKxPKr2RKkhItTAAsyC2q+KxXK85iBxL81OUTse6s0HsGc0JkDWDldAtNE62CV5cmTv z3niGNBcrfgUvrMkY3+JMGev2P0kUe0xMfJmMWYHWThSVq5ho+TKp+WHdCschVna62MH VWvY0EnTP3Rt9aGW2iAIkfmy0kCKkXJz0jt9jb6K4tT6gR8TMu5phGg3x8iJIvehLoKQ APvD6csqO+5YmdtL9tP8Ry8wgrlnV50ZOwwQ6Hi5Pi1hSqtvHwGiooH70Jheq4fdz54g n79w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b5si3694664edw.587.2020.12.10.13.33.05; Thu, 10 Dec 2020 13:33:27 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2404995AbgLJV23 (ORCPT + 99 others); Thu, 10 Dec 2020 16:28:29 -0500 Received: from mail.kernel.org ([198.145.29.99]:38458 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2404942AbgLJV1k (ORCPT ); Thu, 10 Dec 2020 16:27:40 -0500 From: Krzysztof Kozlowski Authentication-Results: mail.kernel.org; dkim=permerror (bad message/signature format) To: Chanwoo Choi , Krzysztof Kozlowski , Bartlomiej Zolnierkiewicz , Michael Turquette , Stephen Boyd , Rob Herring , Lee Jones , Sebastian Reichel , Liam Girdwood , Mark Brown , Andy Gross , Bjorn Andersson , Alessandro Zummo , Alexandre Belloni , linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org, devicetree@vger.kernel.org, linux-pm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-rtc@vger.kernel.org Cc: Iskren Chernev , Matheus Castello , Sebastian Krzyszkowiak , Angus Ainslie , Hans de Goede Subject: [RFC 16/18] power: supply: max17042: Do not enforce (incorrect) interrupt trigger type Date: Thu, 10 Dec 2020 22:25:32 +0100 Message-Id: <20201210212534.216197-16-krzk@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201210212534.216197-1-krzk@kernel.org> References: <20201210212534.216197-1-krzk@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- This patch should wait till DTS changes are merged, as it relies on proper Devicetree. --- drivers/power/supply/max17042_battery.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/power/supply/max17042_battery.c b/drivers/power/supply/max17042_battery.c index 79d4b5988360..8117ecabe31c 100644 --- a/drivers/power/supply/max17042_battery.c +++ b/drivers/power/supply/max17042_battery.c @@ -1104,7 +1104,7 @@ static int max17042_probe(struct i2c_client *client, } if (client->irq) { - unsigned int flags = IRQF_TRIGGER_FALLING | IRQF_ONESHOT; + unsigned int flags = IRQF_ONESHOT; /* * On ACPI systems the IRQ may be handled by ACPI-event code, -- 2.25.1