From patchwork Fri Mar 22 08:24:01 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Wahren X-Patchwork-Id: 10865245 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E548C13B5 for ; Fri, 22 Mar 2019 08:25:15 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BF97B2A244 for ; Fri, 22 Mar 2019 08:25:15 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id ACE472A362; Fri, 22 Mar 2019 08:25:15 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 454092A244 for ; Fri, 22 Mar 2019 08:25:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727581AbfCVIZK (ORCPT ); Fri, 22 Mar 2019 04:25:10 -0400 Received: from mout.kundenserver.de ([212.227.126.133]:59849 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725938AbfCVIZK (ORCPT ); Fri, 22 Mar 2019 04:25:10 -0400 Received: from stefan-Vostro-260.fritz.box ([109.104.35.112]) by mrelayeu.kundenserver.de (mreue012 [212.227.15.167]) with ESMTPSA (Nemesis) id 1MIyiY-1hRehm3YK2-00KPMi; Fri, 22 Mar 2019 09:24:24 +0100 From: Stefan Wahren To: Kamil Debski , Bartlomiej Zolnierkiewicz , Jean Delvare , Guenter Roeck , Rob Herring , Mark Rutland , Robin Murphy Cc: linux-hwmon@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Stefan Wahren Subject: [PATCH V3 1/3] dt-bindings: hwmon: Add tachometer interrupt to pwm-fan Date: Fri, 22 Mar 2019 09:24:01 +0100 Message-Id: <1553243043-19486-2-git-send-email-stefan.wahren@i2se.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1553243043-19486-1-git-send-email-stefan.wahren@i2se.com> References: <1553243043-19486-1-git-send-email-stefan.wahren@i2se.com> X-Provags-ID: V03:K1:nq8OyT1wg7dcG8eHRnTrK/K41jzHU5JOzyyFlAgAFvZJqsHNxSM warCX7BwYqtO5bkset+71PibLpJ4SnOLUSr+F/IXPQ2HNmW7et5Oe6gijrOu7Ud+YKuKO/f CZcKJBmGldl3Ja6cG7pYGofzo6ZtYgxRNb5N3O/eCODkUZDtiiNSQxVilN02V6ur6xeQrp2 1tVt/dOBgaHNfpxHNhqBQ== X-UI-Out-Filterresults: notjunk:1;V03:K0:OL9dj5Zfnz4=:0doaADnROYYwKRP+Besd91 K84IYNCCY/Y0CdcsfNKipoRZPbitoC4WEw1Y6ECuSqgjbzEliDu3oWMC2D1Aq2afxoRHIxV2O eIZ0sjJltLVJwWEJj+YewNN3uqg4+u3v19aFeAOTf7+3gLtY88X9Df9g+oRemHwaDv/WQfdu2 Wf25jeuNJt1cfGB8r++gU8DLmMB2vZjiAMb6wGl2xtQjrwxteWCga+C+0B0uJlz7XM7dt2yng T77gMKLRNiR/TkSeuv7BnrAfJfbeuxYRKAiCtvw69ww/+xX67iI28aSaI1a6ImRSdiW3zL5dv WRANPOChY2AaJUXVPED2VF8htuPE4pnuGi6Ovk2Z9ZlOFUFWdhpVqWgIrniRc4si5zcXEfZlX o9A9uUpw3UyXxF3H2tu6cb3P8ZAUlP/kSqwn0TuRYeN3JfBAv5CoY1KBEE8v6pg1mj5BcHnwG WcxsKcM1GkhvB8YMaJc2TC554fTpFdkS2zs1Gl4dN5Qxjt9e/eNhZS0mCViz0IEWAhaZH/gwy o1TxBOeVmXc5ViPkfNpjVujAwYxMCEteQNKTiCgrjAAu7mW8AUGay/jizaQdpGrbwQRvXWABu 6GfR+y8g853qQTHKVWLfYy3vwAer7CTeS1agxzVOBFyABUvw8Tk+KDCwl2rvh915b14UwQ8yN n1bW3rUDNYkzC7JfiwZl0OoF3uJGlOFgXpPoEgs7G1WKOh3orDsoQrkE5LkIzdx7+r2E6YMKD KnZ9+8JNWdcfI1QXwvNAc3qYSXEe1OnA9M9QAT8YDRC5Q/yBnChV67S4hP+qEPbGmkh48X4di rX6TjW6 Sender: linux-hwmon-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-hwmon@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This adds the tachometer interrupt to the pwm-fan binding, which is necessary for RPM support. Signed-off-by: Stefan Wahren Reviewed-by: Rob Herring --- .../devicetree/bindings/hwmon/pwm-fan.txt | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/Documentation/devicetree/bindings/hwmon/pwm-fan.txt b/Documentation/devicetree/bindings/hwmon/pwm-fan.txt index 49ca5d8..722005f 100644 --- a/Documentation/devicetree/bindings/hwmon/pwm-fan.txt +++ b/Documentation/devicetree/bindings/hwmon/pwm-fan.txt @@ -7,7 +7,16 @@ Required properties: which correspond to thermal cooling states Optional properties: -- fan-supply : phandle to the regulator that provides power to the fan +- fan-supply : phandle to the regulator that provides power to the fan +- interrupts : This contains a single interrupt specifier which + describes the tachometer output of the fan as an + interrupt source. The output signal must generate a + defined number of interrupts per fan revolution, which + require that it must be self resetting edge interrupts. + See interrupt-controller/interrupts.txt for the format. +- pulses-per-revolution : define the tachometer pulses per fan revolution as + an integer (default is 2 interrupts per revolution). + The value must be greater than zero. Example: fan0: pwm-fan { @@ -38,3 +47,14 @@ Example: }; }; }; + +Example 2: + fan0: pwm-fan { + fan0: pwm-fan { + compatible = "pwm-fan"; + pwms = <&pwm 0 40000 0>; + fan-supply = <®_fan>; + interrupt-parent = <&gpio5>; + interrupts = <1 IRQ_TYPE_EDGE_FALLING>; + pulses-per-revolution = <2>; + };