Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp518769pxu; Fri, 11 Dec 2020 07:45:54 -0800 (PST) X-Google-Smtp-Source: ABdhPJxKyKldDGZjuKDWlnVC0Vp3W8wKOgqDMl3kejqvjxQknhcq96Tt+aK3G5t4DG5kMNaGFTTp X-Received: by 2002:aa7:c884:: with SMTP id p4mr12058800eds.72.1607701553888; Fri, 11 Dec 2020 07:45:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607701553; cv=none; d=google.com; s=arc-20160816; b=G3TFhFAN/M33xl6d8vExiOzDwr1MRsMdr7EyQ0W/Aq0GWSrKtRo2bby9AgdjhiqZ/Y wHdRqoIHukzlMPUB4Ky2rrNZ1nML2FDWVpYOU8jOy3BoLNcmT1gHHf3paZgm+YmNYIkx f8QbqH5hdFwMtj7ynTfTUZPDWF0AZGjHycRxfBqIs95zakQLz7+imyngG8IutzTt9mRl ckJAciu/TkG2eJgOeqjypyNOWLmd/C6fNcyHAR5U1wLYxxSfaHia5y1sCSCXpEYGMIPB lNrm7d6mzv/WOzOZtQPtEtBxa+fWv5ncq9xchqy/JwiSSpGEokv7uvdn3CG2tZ4ZwmVN xfng== 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=f6dPA0Hg8788Issf+mBvbs9Id1z9Yg2mdYgh7TF2LyE=; b=mgM/OZLFuQ0JOM+JDZjw/EdW5oTXbxOKRSCjPhItr/Mkhm+lSKkdohVcNb48tZfYw2 m6TABxfjdyw7BK8bMqGYtzEsLoIbKEpgwHr4ADQ97X4/x1k5AVsHYr3/88svpt/I2jzz GNUNwcpZNJGekozclmtg7ha8x0l5eF1Y2iIDJfYsfk+6FY381ubZ6+KaiIJDRiaNH0gA vhtIK9anfcRLLM8SW6U6UGOSM9LH8msmBAdwao+Y/kEcmYS+wH4HSS2o6mWp2gKHXQw0 ygu4wbppbt2dTIABPLOljssRoepv4lGOGuC75UMS7BSL6FiyAlMLmThn/uFZZP5EfYN6 dQ8w== 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 s2si5111442edw.5.2020.12.11.07.45.29; Fri, 11 Dec 2020 07:45:53 -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 S2404979AbgLJV2K (ORCPT + 99 others); Thu, 10 Dec 2020 16:28:10 -0500 Received: from mail.kernel.org ([198.145.29.99]:38460 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2404944AbgLJV1l (ORCPT ); Thu, 10 Dec 2020 16:27:41 -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 18/18] power: supply: max17040: Do not enforce (incorrect) interrupt trigger type Date: Thu, 10 Dec 2020 22:25:34 +0100 Message-Id: <20201210212534.216197-18-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 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 --- This patch should wait till DTS changes are merged, as it relies on proper Devicetree. --- .../devicetree/bindings/power/supply/max17040_battery.txt | 2 +- drivers/power/supply/max17040_battery.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Documentation/devicetree/bindings/power/supply/max17040_battery.txt b/Documentation/devicetree/bindings/power/supply/max17040_battery.txt index c802f664b508..194eb9fe574d 100644 --- a/Documentation/devicetree/bindings/power/supply/max17040_battery.txt +++ b/Documentation/devicetree/bindings/power/supply/max17040_battery.txt @@ -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; }; diff --git a/drivers/power/supply/max17040_battery.c b/drivers/power/supply/max17040_battery.c index d956c67d5155..f737de0470de 100644 --- a/drivers/power/supply/max17040_battery.c +++ b/drivers/power/supply/max17040_battery.c @@ -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; -- 2.25.1