Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp454375img; Fri, 22 Mar 2019 01:27:09 -0700 (PDT) X-Google-Smtp-Source: APXvYqzRZgFYhiG5VWCmw5WIzSHa2EAK968GxMSOPUx35msJ3uJ5k+Mv6GrnIS/FmZeSFqKswAzF X-Received: by 2002:a17:902:7b93:: with SMTP id w19mr8186400pll.141.1553243229382; Fri, 22 Mar 2019 01:27:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553243229; cv=none; d=google.com; s=arc-20160816; b=NTXiISIEQgKwimD7Rkm9PuV0FNfkNKALt1Qbij718uLU5seCz8Du8CqgjAUiGHF7R6 /FE8+BPeJqDp9JDtWL69c1ebHZ1LCs0z5Uw5M/XQq9TaLpOdG+GCcejB1MeOgdEXxIBy lQdrb0rgqb8DBN3IJan3SaxTVGA2rIlW/pL5uVUx7nWzfyZ0fFEiX/9Od+MDVYlT4Fxe 36iWq6xI6++6LMEbetdikj/Xz07smS3vbnB5WsFLOYa5jZWJur8uTNpd+7KFCkBF3gan VO4DWjXJvYRWKXJhzeitDcIh8XnEh4rBe14qEmnhMU7uwEx7QJQXMEb/wSTkjht1g6mD YA+w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from; bh=BDoWzIFmLnRezWAPxdCzyEyxSW4serYoNklCca0U4XE=; b=yOywMLD76SnPa8ZtuA/6vhz+h08aTZBmHREvA1y0m0+TCv6xIuUUO/Zz73y7Ke0s6y CDI277nAkztOWs/cRixcBW21uia+90c1w248ocn7J/b9XctszVyyOYzBc9wU6Mpbb5VE /Mz8T5Lp+N5QXORlfLRAPV0yUAlSPrvULm8Q/SoPLi9nXz104u3jIVcFOk8haXm47INN xmiMHncFmj5umVSMKaHEJ22OJISSIBD6unmM/tVDBB0DS1YuflVE/8musWs4RMW0/kr9 eymKeGG7SLh78unkQzSb893YKvsewv6mAzLfMIGA0thEpMzspMW2vgmFpONCEHc3xr5G RA5A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q18si6092442pgh.498.2019.03.22.01.26.54; Fri, 22 Mar 2019 01:27:09 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727764AbfCVIZa (ORCPT + 99 others); Fri, 22 Mar 2019 04:25:30 -0400 Received: from mout.kundenserver.de ([212.227.126.130]:42285 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726667AbfCVIZa (ORCPT ); Fri, 22 Mar 2019 04:25:30 -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 1M91Tq-1h2Hew2DKQ-0069k0; 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 0/3] hwmon: pwm-fan: Add RPM support Date: Fri, 22 Mar 2019 09:24:00 +0100 Message-Id: <1553243043-19486-1-git-send-email-stefan.wahren@i2se.com> X-Mailer: git-send-email 2.7.4 X-Provags-ID: V03:K1:wHI4PaDmNNvLUCA0YRlKcLYLznYLu1th0lZPCFhA1N1F7ev/uIh RSxAHtuFFUvNeYewA/zg1TYq8PmpfeF2CBpvl/glxpkwaFvnLNoEGWV0YiV7dxQe+HHmB24 SuXc+FuIqUrMqbbDOGJeZ15FvsQFk/Ey5stzh7LFxvHX6akus1lKYszg7WXAYVy/iwGfa1F TebBih+CfFjCUOuuwD6Qg== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:Zj/weAfWClI=:LB244jBP6rzCySyt+0JT+M r+iTT1KpSwkHvENIonbRXRNpk67/r01eiH/hutAxJipJWQuw4QiS0aDlv3FQy6u37EZmxOzjY gIV5QR7eQhDQwsWzfHubL4grtGi04GLEuuEsiMGXF6/cMhZa+U/+gNb2+RVl2O036nnaQNMCQ dGLnxiSIej6GReIKU9ln/3YV2Y+jbXY7/zHCUbAEugxY2xL8OLUhP+3snsF3ViAz/3cUlRYoO hoyRzXW4NjAo86rZ4Yz77UtvHMZmv3n6/P/cRoPypvizNbAqBvozsQ5u19OWynaIQQ++iUsWq xTIvuBbgK+jF0989MDac1rAeRzn3lAY3NNN64eVr7akF5uL2i4qUPdrPAVXosHKlJrZFf1ENN lHNH3lNk6b9NbLwQYT20wa4pmWxdzJVCW4gGc2R1QbhbaC47t/3QiVkK3bJK550tQQdpx5vL6 S2UwX2uP+4Hhg4fdp+P/NVw/FI4QpPRiIAuIpED4cUgcPLvXLzI+HZUKy+94Tx/vlaUIHKgVL vm19aEWoXEvb7Hbf3andgMBkQkhor9zU4Fq6S3sGq8Y6tYfL69fCSNo4opEHZPOhTrfIGyJrd RQlgoat9pVPv12FxOsaXmUPjXNs/iqsZSsxcBd36gOfNRqDSQZ9qvKO4D8sYVaQ2+iZCCuBRf QHoapvazCS/QDL9DD83oJfH/8n4ldrEDb6aRzkpVqlyQIUGqAZXr9PZK9mq4iDC319LDjw//X j6rqovzFginAJPF3sN+bF9kenF2tRi0POuLqTLkCPkBlU/QkRsx9E/H2NsI= Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 V3: - rename property interrupt-ratio to pulses-per-revolution to avoid confusion with interrupt binding - handle error case pulses-per-revolution = 0 - bail out properly in case we are unable to request the irq 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 | 22 ++++- Documentation/hwmon/pwm-fan | 3 + drivers/hwmon/pwm-fan.c | 100 ++++++++++++++++++++- 3 files changed, 123 insertions(+), 2 deletions(-) -- 2.7.4