From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-14.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3AA00C4361B for ; Fri, 11 Dec 2020 07:49:24 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id E338E23DE3 for ; Fri, 11 Dec 2020 07:49:23 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E338E23DE3 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References:Message-ID: Subject:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=MJEI44wDiPjyLuXrlowJSbefFpgiFupIooGK/L8Divk=; b=AGXkqJF0fWYwzvVOkdRzJs06a 8yjyyobXraItikKlYaWfOx9nhXjMMFSCr+16FhsJj9g56KfCHO7q7ed3dSTbO1499TRc6ReKR9D1I 4txunjop+w9axRFosmUDygLD0II6wjXKrTLQGAvgqcz4W/47nR5IWKU0p1nCVpCeSezTp/NoB50rn tfXkHfeJ3UIX7DJ66ajkUGuYO6YtC3FVoqnKE0sILszaPOokIvk1szT92JhQE0ii19yY4fjMQt7Fg On8H/6De7ia1G5A49ZiS8fo2EB7ZjNi0KD7xyvDoIZ9jxvmWXC8PIp1gEP7ndMhHJ8V+z92f01Ox2 T0SVq6wtQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1knd9l-0005MM-MU; Fri, 11 Dec 2020 07:48:01 +0000 Received: from mail-ed1-f66.google.com ([209.85.208.66]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1knd9j-0005Lz-CT for linux-arm-kernel@lists.infradead.org; Fri, 11 Dec 2020 07:48:00 +0000 Received: by mail-ed1-f66.google.com with SMTP id q16so8318061edv.10 for ; Thu, 10 Dec 2020 23:47:58 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=P0wPTNnTMMvMYQoXIJsxDc+GGcUdhHlmPr5EHW78xzw=; b=SN4PvqJikmshM1HN/oNAaQOh5la7COiOGEN9HW2kAM9ir3v31EmGWxYOCZgX9Dv0HC S+uUvyyb5iHAy2cz5cu7BaaxzjnNMgA84X2jNjYL9dxXMqCKxZIT88dJ57qSRAaAvD/e /3lgRqYtv0vomH/yhKfWRt2OdMEQuuhKxXdLoUsYcq+kU7cm30HugQ2zgGuJdOG3EotL y01nfj0CFsahbYIHOD0qYpxE0XcCoQG13r9ZgzKvlAZKmHhSoTcutOe1i/8z02i4agAB si2mo4awMLqxAjLpbKtyDHEurRY+RiNTT9MPpwK4H+m99OEtJvCdgItYfSxYjnLtLo3l YVWQ== X-Gm-Message-State: AOAM533xJvPPA3QzCe/hp+6BkMvy+5LIssrkIrifOqd6agQBJJq63XL6 jd5pGlEudqGXbCpQoVxvFSc= X-Google-Smtp-Source: ABdhPJx/k/HGToQvr22UR3Xq7vPsj2TvNmpm8kE7Hr4dtKfaS9AYncLFODFCgjOBi92luTKLln+RDw== X-Received: by 2002:a50:e688:: with SMTP id z8mr10777681edm.129.1607672878059; Thu, 10 Dec 2020 23:47:58 -0800 (PST) Received: from kozik-lap (adsl-84-226-167-205.adslplus.ch. [84.226.167.205]) by smtp.googlemail.com with ESMTPSA id qn4sm6333309ejb.50.2020.12.10.23.47.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Dec 2020 23:47:57 -0800 (PST) Date: Fri, 11 Dec 2020 08:47:55 +0100 From: Krzysztof Kozlowski To: Chanwoo Choi , 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 Subject: Re: [RFC 18/18] power: supply: max17040: Do not enforce (incorrect) interrupt trigger type Message-ID: <20201211074755.GA4346@kozik-lap> References: <20201210212534.216197-1-krzk@kernel.org> <20201210212534.216197-18-krzk@kernel.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20201210212534.216197-18-krzk@kernel.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201211_024759_456543_2FB0FBC5 X-CRM114-Status: GOOD ( 23.59 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Angus Ainslie , Hans de Goede , Sebastian Krzyszkowiak , Iskren Chernev , Matheus Castello Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Thu, Dec 10, 2020 at 10:25:34PM +0100, Krzysztof Kozlowski wrote: > 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; This has to be removed. I will fix it in v2. Best regards, Krzysztof > 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 > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel