Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp1353884yba; Tue, 2 Apr 2019 07:23:54 -0700 (PDT) X-Google-Smtp-Source: APXvYqx0R4cjnGBLQHTPQNyhvCwp36+T/dV/HAU91kLsNW9DE4qOK+y3DkwxVXOKHdjb4QndMf6L X-Received: by 2002:a63:4e10:: with SMTP id c16mr68011482pgb.302.1554215034459; Tue, 02 Apr 2019 07:23:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554215034; cv=none; d=google.com; s=arc-20160816; b=NZ2eqbXrxmAXr7pcT4pSCE1FIWBaUUyoIHKDw88oL3IrcSb7t0tkKsMf+zTM3eO/PK u11saKCymqNaxHbi8ZtA9ELuplrrRqYXOz2lbUA3aRysQLJM3YBUaQ61n25Rsail0gVm T6JJmcxrh02hATmS1vXa6torOEiAtCLcMv8A8vib+CbH9kaKQ3Wvu8vtJ80HL2AplECw UXl8tEKcG89LZvo94RhFGLBwW5oU/nrsX6BuLt08186E2KfRUdELFN38AOjhmmK6oEf8 x7x9UrUPn/7AbMNj1uchyzAw6fTxyW7mJWSkZgSwWnMZO6bCzpMdOOPSyrDL/76MseUK 6wPg== 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=9Lbf/CzzkVHIwJsK2jRvT23nROihPYMMzCp7H5jRY5w=; b=SnmE0QPVSAq5FvU8BMAjsrfUTH33N52T+jpkO0389BW4LVrg3JMuQRsRJgmM4Z6vYK zurIv7clEGgL0Gd8028futo7L6rWuiLfsicMXDNiR0Cyz0CZoW6DsbTFlgSWmATBZvhf C3A+wMBKIQ/TIFsxE3gPJrBPBpl7hBkUMixXQHxxOfJXCllKvqHlF2tRJ4rzpXIz+Gi1 BG2yv5mGH2TQuSn2DV5Q+2TJVnAFeZD96lb9PlhqBfjgrLW7FBotJ30wCakCt56KL/je weCTsCF6T79ZQSH10a9MzV82i+zOUpTZAM7bLs82e9/uzRLNwdFx0OCxCfWPizxB6oSm 8CzA== 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 v10si11956575pgj.576.2019.04.02.07.23.38; Tue, 02 Apr 2019 07:23:54 -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 S1731195AbfDBOWs (ORCPT + 99 others); Tue, 2 Apr 2019 10:22:48 -0400 Received: from mout.kundenserver.de ([212.227.17.24]:34443 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726903AbfDBOWr (ORCPT ); Tue, 2 Apr 2019 10:22:47 -0400 Received: from stefan-Vostro-260.fritz.box ([109.104.50.84]) by mrelayeu.kundenserver.de (mreue107 [212.227.15.183]) with ESMTPSA (Nemesis) id 1MHWvH-1h6bLP0mtV-00DZCU; Tue, 02 Apr 2019 16:22:10 +0200 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 V4 0/3] hwmon: pwm-fan: Add RPM support Date: Tue, 2 Apr 2019 16:21:47 +0200 Message-Id: <1554214910-29925-1-git-send-email-stefan.wahren@i2se.com> X-Mailer: git-send-email 2.7.4 X-Provags-ID: V03:K1:u9hpHqCTnUjn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rQ= 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 V4: - remove copy & paste artifact in dt-binding example - switch to u64 for rpm calculation - drop overflow handling and init atomic - handle 0 not as valid irq - reduce range of pulses_per_revolution - handle probe defer of platform_get_irq - delete timer properly in bail-out path 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 | 21 +++- Documentation/hwmon/pwm-fan | 3 + drivers/hwmon/pwm-fan.c | 111 ++++++++++++++++++++- 3 files changed, 130 insertions(+), 5 deletions(-) -- 2.7.4