From patchwork Mon Feb 25 15:59:16 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Wahren X-Patchwork-Id: 10828799 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 9E7D91575 for ; Mon, 25 Feb 2019 16:00:41 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8B6BA2BCC1 for ; Mon, 25 Feb 2019 16:00:41 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7F86F2BCB8; Mon, 25 Feb 2019 16:00:41 +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 20FBD2BCC0 for ; Mon, 25 Feb 2019 16:00:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727973AbfBYQAg (ORCPT ); Mon, 25 Feb 2019 11:00:36 -0500 Received: from mout.kundenserver.de ([212.227.126.130]:37223 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727684AbfBYQAf (ORCPT ); Mon, 25 Feb 2019 11:00:35 -0500 Received: from stefan-Vostro-260.fritz.box ([109.104.53.79]) by mrelayeu.kundenserver.de (mreue010 [212.227.15.167]) with ESMTPSA (Nemesis) id 1MsI4Q-1hIrgs0fk2-00tohy; Mon, 25 Feb 2019 16:59:56 +0100 From: Stefan Wahren To: Kamil Debski , Bartlomiej Zolnierkiewicz , Jean Delvare , Guenter Roeck , Rob Herring , Mark Rutland Cc: linux-hwmon@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Stefan Wahren Subject: [PATCH RFC V2 0/3] hwmon: pwm-fan: Add RPM support Date: Mon, 25 Feb 2019 16:59:16 +0100 Message-Id: <1551110359-19860-1-git-send-email-stefan.wahren@i2se.com> X-Mailer: git-send-email 2.7.4 X-Provags-ID: V03:K1:Q8/2wU265bhgF+eFxUarnMhWaCIJ1lmFVPyLcidrBsAJ3B6gdg5 yy+2GXHMr5kht3ZLIGLImcgJb34PVPewlcJ8nmKwZrVnfGQotJzdu+QFFehH9SYibNW6/H3 eomXqpI2juPramGR4Bh1xForFRKyhU0HlXoghnpuSJmfy3/iWlLr15Zj7Fo9i+17XjJIidy LRHBzq02HcZIE3/FOGzXw== X-UI-Out-Filterresults: notjunk:1;V03:K0:RWnW3jjj8BE=:G4K/gohyYfd1CQ2bqyJYNU kLlkL72zSSa0M2zWIvOZEwRvilZqAbdrrMh6lvUtPF1sbN4CmKbTMNMzuvm6OrFKCJTKNI5h2 K14s8N0EgrbVstbf84PhS/AoTXa8Tbr8SJY2y9s68h2iPUiOjd9nnMS/A3Tp2lFLsDcCcPHxx f1FLhPZthhSXjG8WOwaejVHEfO0lh1dWOh8tER0Qs2miRa5nZYGDbGB7St6CJ7GeEzApdEmzx 6ya9mdUblDpSI8v3CbcZ4IDnJ3E0UymudBrq8x+RcJTyCiPx/2avTaSuThUXYzGfFarEzNBIN UmALIEKlEvTB+SAHxC20X8LTF5vJ5Cy5Zhm7cKqnE/G3U5EfOs8d1IVOorZUUCSvngwlByAhb MGHIl0r87tMPZemDO4yL06pE+ucI2CqvievwMz/7NEf8+PvI1SG5HtHQLSg3Gx+iBGu/LZwCg cn2WR8rkXIryE7+knuulBlaPpbnEYLYZen1PepjWHpXr0sW2Ole9asyzkPSypHgmRjamMzCM9 vDUOHrfr8k9WBX8j62kOR7693zds/ovT0nrulI3GS3bVyXYTvNoLHPZW0D24qtKsfNjhBWTdI HS5xaIl4tKGajYG0AlkqFCA8011SOMw5/TI1hjU6z9Oi/RroFm59GhzSShdbcUj/PcFMzXpDW 5tM2orAr+q7YX+oo6OxSwSfLd96UrSd3nJKJQbVP1+gnyXk6sKuUeAYzwBVLKmIooGYVj78Fx xvNr6nGjtc7ye5C7NIiPs01MOnJ5pldamVA+ewU70sSg5rrd8K48abCZsmM= 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 Contrary to the gpio-fan the pwm-fan driver isn't easy to setup with pwmconfig/fancontrol because of the missing hwmon sysfs entry for actual revolutions per minute. This series adds this feature. Changes in V2: - address Guenter's comments: - improve description of interrupts - use atomic_t to avoid races of the pulse counter - measure sample time to make rpm more reliable under load - make sysfs entry fan1_input conditional - add dt-property to define interrupts per fan revolution - example for fan with RPM support Stefan Wahren (3): dt-bindings: hwmon: Add tachometer interrupt to pwm-fan Documentation: pwm-fan: Add description for RPM support hwmon: pwm-fan: Add RPM support via external interrupt .../devicetree/bindings/hwmon/pwm-fan.txt | 19 +++++ Documentation/hwmon/pwm-fan | 3 + drivers/hwmon/pwm-fan.c | 94 +++++++++++++++++++++- 3 files changed, 115 insertions(+), 1 deletion(-)