From patchwork Wed May 26 17:20:31 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 448347 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=-16.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT 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 48EFEC47094 for ; Wed, 26 May 2021 17:20:56 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 28F83613D2 for ; Wed, 26 May 2021 17:20:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234365AbhEZRW0 (ORCPT ); Wed, 26 May 2021 13:22:26 -0400 Received: from youngberry.canonical.com ([91.189.89.112]:36712 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234373AbhEZRWY (ORCPT ); Wed, 26 May 2021 13:22:24 -0400 Received: from mail-ua1-f69.google.com ([209.85.222.69]) by youngberry.canonical.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.93) (envelope-from ) id 1llxD9-0003Vs-Ai for devicetree@vger.kernel.org; Wed, 26 May 2021 17:20:51 +0000 Received: by mail-ua1-f69.google.com with SMTP id k17-20020ab071510000b02902351d1972d8so1086935uao.19 for ; Wed, 26 May 2021 10:20:51 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=YMY2yvxHNG1nkzYJPg4/G4TbXbdFqsqs8hq2uBFV7DI=; b=IQ8xBJXKZaccjSC8RoyLSipIsRcdWEgbetrYcQ0Cp5HFtVLRveXp58C0nTPpJjUHBV zE+dN6h8mydY95R4PI8NMPQ1bYMA+aMpoLweK+Lfit+2c8SAMInQMgB3EEyUBckb/2uO AYGLorlTrkVEqtW0Np98hIvJuYqn/efysPSFCR/J8e6h5MPzg3I2F0RQWCh2t4c2RgT6 ov6M/Cwtu7E6roQFOz93RC/JphofflIQh4atgSHyQwA9849BoK6tr9aDy7F85DHO036B /TB/D4Rni61ykSgi2hBTb8K8JGViA+HVG1vbiwAYbpwxo4bneA8O78FbflvMSBd/C4oQ Zkgg== X-Gm-Message-State: AOAM532cI5lq6OmRJy5pfrqRvmoFvHDJdeBjtK1FgRJWGcIf+lJPeiY7 UnqQ4q1PqGAbIV9PpebaE8Yrs/uRBj5WaMlZB3yQhcT+jYj02ZG1myDp+D+60hegKJTdEnoLWXw 9JgGSnC/gRv/rA8ziyEDaNeUJwsZr+8DbKkdkJ2w= X-Received: by 2002:ab0:60c5:: with SMTP id g5mr33849466uam.5.1622049650421; Wed, 26 May 2021 10:20:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJybUIvC2EVKiQpagnKWUZU70TWT6eIvSvzu8uRFmvzo4oT1pL7W1A2sY8ZZ5oe7mDhPI5A4nw== X-Received: by 2002:ab0:60c5:: with SMTP id g5mr33849422uam.5.1622049650219; Wed, 26 May 2021 10:20:50 -0700 (PDT) Received: from localhost.localdomain ([45.237.48.6]) by smtp.gmail.com with ESMTPSA id u195sm2036032vsc.10.2021.05.26.10.20.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 May 2021 10:20:49 -0700 (PDT) From: Krzysztof Kozlowski To: Chanwoo Choi , Krzysztof Kozlowski , Bartlomiej Zolnierkiewicz , Michael Turquette , Stephen Boyd , Rob Herring , Lee Jones , Sebastian Reichel , Liam Girdwood , Mark Brown , Alessandro Zummo , Alexandre Belloni , linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org, devicetree@vger.kernel.org, linux-pm@vger.kernel.org, linux-samsung-soc@vger.kernel.org, linux-rtc@vger.kernel.org Cc: Krzysztof Kozlowski , Rob Herring Subject: [PATCH v2 2/7] mfd: max77686: Do not enforce (incorrect) interrupt trigger type Date: Wed, 26 May 2021 13:20:31 -0400 Message-Id: <20210526172036.183223-3-krzysztof.kozlowski@canonical.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20210526172036.183223-1-krzysztof.kozlowski@canonical.com> References: <20210526172036.183223-1-krzysztof.kozlowski@canonical.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org From: Krzysztof Kozlowski 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 77686 datasheet describes 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 Acked-by: Rob Herring Acked-by: Stephen Boyd # clock binding --- Changes since v1: 1. Add ack. --- Documentation/devicetree/bindings/clock/maxim,max77686.txt | 4 ++-- Documentation/devicetree/bindings/mfd/max77686.txt | 2 +- Documentation/devicetree/bindings/regulator/max77686.txt | 2 +- drivers/mfd/max77686.c | 3 +-- 4 files changed, 5 insertions(+), 6 deletions(-) diff --git a/Documentation/devicetree/bindings/clock/maxim,max77686.txt b/Documentation/devicetree/bindings/clock/maxim,max77686.txt index 3472b461ca93..c10849efb444 100644 --- a/Documentation/devicetree/bindings/clock/maxim,max77686.txt +++ b/Documentation/devicetree/bindings/clock/maxim,max77686.txt @@ -49,7 +49,7 @@ Example: max77686: max77686@9 { compatible = "maxim,max77686"; interrupt-parent = <&wakeup_eint>; - interrupts = <26 0>; + interrupts = <26 IRQ_TYPE_LEVEL_LOW>; reg = <0x09>; #clock-cells = <1>; @@ -74,7 +74,7 @@ Example: max77802: max77802@9 { compatible = "maxim,max77802"; interrupt-parent = <&wakeup_eint>; - interrupts = <26 0>; + interrupts = <26 IRQ_TYPE_LEVEL_LOW>; reg = <0x09>; #clock-cells = <1>; diff --git a/Documentation/devicetree/bindings/mfd/max77686.txt b/Documentation/devicetree/bindings/mfd/max77686.txt index 42968b7144e0..4447d074894a 100644 --- a/Documentation/devicetree/bindings/mfd/max77686.txt +++ b/Documentation/devicetree/bindings/mfd/max77686.txt @@ -21,6 +21,6 @@ Example: max77686: pmic@9 { compatible = "maxim,max77686"; interrupt-parent = <&wakeup_eint>; - interrupts = <26 0>; + interrupts = <26 IRQ_TYPE_LEVEL_LOW>; reg = <0x09>; }; diff --git a/Documentation/devicetree/bindings/regulator/max77686.txt b/Documentation/devicetree/bindings/regulator/max77686.txt index e9f7578ca09a..ff3d2dec8c4b 100644 --- a/Documentation/devicetree/bindings/regulator/max77686.txt +++ b/Documentation/devicetree/bindings/regulator/max77686.txt @@ -43,7 +43,7 @@ Example: max77686: pmic@9 { compatible = "maxim,max77686"; interrupt-parent = <&wakeup_eint>; - interrupts = <26 IRQ_TYPE_NONE>; + interrupts = <26 IRQ_TYPE_LEVEL_LOW>; reg = <0x09>; voltage-regulators { diff --git a/drivers/mfd/max77686.c b/drivers/mfd/max77686.c index 2ad554b921d9..f9e12ab2bc75 100644 --- a/drivers/mfd/max77686.c +++ b/drivers/mfd/max77686.c @@ -209,8 +209,7 @@ static int max77686_i2c_probe(struct i2c_client *i2c) ret = devm_regmap_add_irq_chip(&i2c->dev, max77686->regmap, max77686->irq, - IRQF_TRIGGER_FALLING | IRQF_ONESHOT | - IRQF_SHARED, 0, irq_chip, + IRQF_ONESHOT | IRQF_SHARED, 0, irq_chip, &max77686->irq_data); if (ret < 0) { dev_err(&i2c->dev, "failed to add PMIC irq chip: %d\n", ret); From patchwork Wed May 26 17:20:34 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 448345 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=-16.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT 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 756D6C47082 for ; Wed, 26 May 2021 17:21:32 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 5925B613ED for ; Wed, 26 May 2021 17:21:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232173AbhEZRXB (ORCPT ); Wed, 26 May 2021 13:23:01 -0400 Received: from youngberry.canonical.com ([91.189.89.112]:36766 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234849AbhEZRWd (ORCPT ); Wed, 26 May 2021 13:22:33 -0400 Received: from mail-ua1-f72.google.com ([209.85.222.72]) by youngberry.canonical.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.93) (envelope-from ) id 1llxDI-0003ae-QI for devicetree@vger.kernel.org; Wed, 26 May 2021 17:21:00 +0000 Received: by mail-ua1-f72.google.com with SMTP id d22-20020ab031960000b0290223019877e7so1102722uan.11 for ; Wed, 26 May 2021 10:21:00 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=SNm8r3qL/2kiXiJIVKuFq4DIG33CzdI9IizzknKRELw=; b=Qk6dAGV2buEcU1+YxQJb92M5IU+QUe0BNm4ZYy5TYaqBCt87dQUz1jzTik8iUQGVPb Sfhwm0XuFcD3UieZBJLP9qK13kUuDXwQKsSvWLOROO8MM5D2hoRVhPXwStuV2CMmwjgt hej5nDCBw+uh1jC8ZBrZ+H2E6EhwwlHjCnKY09PKr3kfoLWx9HV8g7kDL2SRODM3lmv+ w+sLgu2KTnTBaEKdUSKSJF6nk18M3pHe9kC8rV7xnYQ9o2oXpGqT2IdX29/j8FSQNmfv X60NBQ99kN4B3oGTT/3MqbArN2/dtD98Gk6e+pND/BNnuyFNQGqDu8M7FBcyXX83/WWh Qvbg== X-Gm-Message-State: AOAM531SYtMlgpaDhED7fx/0WW/8h27DJqewIIsM3ZAI3bhv2Okj3RkK o+uLkQTvcfpAdlLTT+HoDWlXlh0ZwXd5+R/Ock93ap57YoC+1NDdpSAQekBjrnYd18MSEwXY1yc uM4gCvBfRgS9eTet7lNCVT+QZbxDm4mnNI8Si8nU= X-Received: by 2002:ab0:6d8c:: with SMTP id m12mr21071488uah.49.1622049659959; Wed, 26 May 2021 10:20:59 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyKbreCdzxPHok0y1tVuHyOgZULUrZT2VgOqfxTb2af4jPjxbiLuaf5zi62GiVO/GnTLXh37w== X-Received: by 2002:ab0:6d8c:: with SMTP id m12mr21071448uah.49.1622049659760; Wed, 26 May 2021 10:20:59 -0700 (PDT) Received: from localhost.localdomain ([45.237.48.6]) by smtp.gmail.com with ESMTPSA id u195sm2036032vsc.10.2021.05.26.10.20.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 May 2021 10:20:58 -0700 (PDT) From: Krzysztof Kozlowski To: Chanwoo Choi , Krzysztof Kozlowski , Bartlomiej Zolnierkiewicz , Michael Turquette , Stephen Boyd , Rob Herring , Lee Jones , Sebastian Reichel , Liam Girdwood , Mark Brown , Alessandro Zummo , Alexandre Belloni , linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org, devicetree@vger.kernel.org, linux-pm@vger.kernel.org, linux-samsung-soc@vger.kernel.org, linux-rtc@vger.kernel.org Cc: Krzysztof Kozlowski Subject: [PATCH v2 5/7] rtc: max77686: Do not enforce (incorrect) interrupt trigger type Date: Wed, 26 May 2021 13:20:34 -0400 Message-Id: <20210526172036.183223-6-krzysztof.kozlowski@canonical.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20210526172036.183223-1-krzysztof.kozlowski@canonical.com> References: <20210526172036.183223-1-krzysztof.kozlowski@canonical.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org From: Krzysztof Kozlowski 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 77686 datasheet describes 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 --- Changes since v1: 1. None --- drivers/rtc/rtc-max77686.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/rtc/rtc-max77686.c b/drivers/rtc/rtc-max77686.c index d51cc12114cb..eae7cb9faf1e 100644 --- a/drivers/rtc/rtc-max77686.c +++ b/drivers/rtc/rtc-max77686.c @@ -717,8 +717,8 @@ static int max77686_init_rtc_regmap(struct max77686_rtc_info *info) add_rtc_irq: ret = regmap_add_irq_chip(info->rtc_regmap, info->rtc_irq, - IRQF_TRIGGER_FALLING | IRQF_ONESHOT | - IRQF_SHARED, 0, info->drv_data->rtc_irq_chip, + IRQF_ONESHOT | IRQF_SHARED, + 0, info->drv_data->rtc_irq_chip, &info->rtc_irq_data); if (ret < 0) { dev_err(info->dev, "Failed to add RTC irq chip: %d\n", ret); From patchwork Wed May 26 17:20:36 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 448344 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=-16.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham 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 7503EC47088 for ; Wed, 26 May 2021 17:21:45 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 5D6D3613C3 for ; Wed, 26 May 2021 17:21:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235168AbhEZRXP (ORCPT ); Wed, 26 May 2021 13:23:15 -0400 Received: from youngberry.canonical.com ([91.189.89.112]:36804 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235178AbhEZRWj (ORCPT ); Wed, 26 May 2021 13:22:39 -0400 Received: from mail-vs1-f69.google.com ([209.85.217.69]) by youngberry.canonical.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.93) (envelope-from ) id 1llxDN-0003eF-D1 for devicetree@vger.kernel.org; Wed, 26 May 2021 17:21:06 +0000 Received: by mail-vs1-f69.google.com with SMTP id q16-20020a67d7900000b0290228198e77b6so553480vsj.23 for ; Wed, 26 May 2021 10:21:05 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=YYv9QSwtcmYn0218F0zCf1aEruGYQ8/WBysY7w5EfCc=; b=jzbNqhY0O1C6rMTvJrLa8BDbT6poHGDTMxC3TU7fUcijY7077eZICvQnycHdwM+tf/ V6ipfaoERNpgiS0c02ree4WoKO9MjH7vMME8KhqBeUlU/B2hEtNb9rro50tcf18vlnU1 Z5UrluuOTfDZDyGrLjLmj8dFCJvbJqlNQNib348+XL4sRAaDYUnn8cwjtGNBuQhdaOHu uq2vI47q1Pu2gsRbTiB5Jcszl4cxydsBhQeZMMOcALtOSU1KNRM8nP41Da+6dANnU/jv CabrW4+fvgEhGj7oK0HUgbvv6OoB/3I5G1NJ3R4iHPQ3AbbfpMfqD8xX7HVO5qWxtkSg gsPA== X-Gm-Message-State: AOAM533aWTwZv4Ot2OmgxQdKJMFBkvngFkH+nBQq1khzCkmC38n4En0R O39xt5z4UHX13j+lbCEHUfbjg7jKcCO2e3l6bVIPuBfXs6dA+OOkdpuM6PeqSSxbK0A00jp1V1/ +ch2GHYB5BPnNcpsFuLWxJqjDBSbOtfkSgVm5uI0= X-Received: by 2002:ac5:c382:: with SMTP id s2mr31980829vkk.24.1622049664527; Wed, 26 May 2021 10:21:04 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyBWWyrs1VJTSEVr7gNlAWxnMbfMY4X+d68llpnvHKbyCP4O8ma7yU99jBXSJa7bdYyXsWV8g== X-Received: by 2002:ac5:c382:: with SMTP id s2mr31980793vkk.24.1622049664379; Wed, 26 May 2021 10:21:04 -0700 (PDT) Received: from localhost.localdomain ([45.237.48.6]) by smtp.gmail.com with ESMTPSA id u195sm2036032vsc.10.2021.05.26.10.21.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 May 2021 10:21:03 -0700 (PDT) From: Krzysztof Kozlowski To: Chanwoo Choi , Krzysztof Kozlowski , Bartlomiej Zolnierkiewicz , Michael Turquette , Stephen Boyd , Rob Herring , Lee Jones , Sebastian Reichel , Liam Girdwood , Mark Brown , Alessandro Zummo , Alexandre Belloni , linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org, devicetree@vger.kernel.org, linux-pm@vger.kernel.org, linux-samsung-soc@vger.kernel.org, linux-rtc@vger.kernel.org Cc: Krzysztof Kozlowski , Iskren Chernev Subject: [PATCH v2 7/7] power: supply: max17040: Do not enforce (incorrect) interrupt trigger type Date: Wed, 26 May 2021 13:20:36 -0400 Message-Id: <20210526172036.183223-8-krzysztof.kozlowski@canonical.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20210526172036.183223-1-krzysztof.kozlowski@canonical.com> References: <20210526172036.183223-1-krzysztof.kozlowski@canonical.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org From: Krzysztof Kozlowski 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 Acked-by: Iskren Chernev Acked-by: Rob Herring --- Changes since v1: 1. Remove the 'flags' variable. 2. Added ack. 3. Rebase - the bindings were converted to dtschema. --- .../devicetree/bindings/power/supply/maxim,max17040.yaml | 2 +- drivers/power/supply/max17040_battery.c | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/Documentation/devicetree/bindings/power/supply/maxim,max17040.yaml b/Documentation/devicetree/bindings/power/supply/maxim,max17040.yaml index de91cf3f058c..f792d06db413 100644 --- a/Documentation/devicetree/bindings/power/supply/maxim,max17040.yaml +++ b/Documentation/devicetree/bindings/power/supply/maxim,max17040.yaml @@ -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; }; }; diff --git a/drivers/power/supply/max17040_battery.c b/drivers/power/supply/max17040_battery.c index 1aab868adabf..e80dd9141ae7 100644 --- a/drivers/power/supply/max17040_battery.c +++ b/drivers/power/supply/max17040_battery.c @@ -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;