linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Václav Kubernát" <kubernat@cesnet.cz>
To: unlisted-recipients:; (no To-header on input)
Cc: "Václav Kubernát" <kubernat@cesnet.cz>,
	"Jean Delvare" <jdelvare@suse.com>,
	"Guenter Roeck" <linux@roeck-us.net>,
	"Jonathan Corbet" <corbet@lwn.net>,
	linux-hwmon@vger.kernel.org, linux-doc@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: [PATCH v2 5/5] hwmon: (max31790) Update documentation
Date: Tue, 13 Apr 2021 04:59:48 +0200	[thread overview]
Message-ID: <20210413025948.901867-5-kubernat@cesnet.cz> (raw)
In-Reply-To: <20210413025948.901867-1-kubernat@cesnet.cz>

The conditions for fan fault and its connection to the PWM mode are now
documented.

The pwm_rate_of_change and fan_window are now mentioned. According to
our testing with Sunon PF36281BX-000U-S99, these values are crucial in
how RPM mode works and how long it takes for the RPM to stabilize. For
example, setting 5000 RPM (the fan goes up to 23000), the
pwm_rate_of_change needed to be changed to the lowest possible value,
otherwise the chip would just go from pwm 0 to pwm 60 back and forth and
never achieving 5000 RPM (and also signaling fan fault). Based on this
testing, we found out that the pwm_rate_of_change and fan_window values
need to be changed manually by the user, based on the user's exact fan
configuration.

Signed-off-by: Václav Kubernát <kubernat@cesnet.cz>
---
 Documentation/hwmon/max31790.rst | 41 +++++++++++++++++++++++++++++++-
 1 file changed, 40 insertions(+), 1 deletion(-)

diff --git a/Documentation/hwmon/max31790.rst b/Documentation/hwmon/max31790.rst
index 2979addeac8f..6056b67c3a95 100644
--- a/Documentation/hwmon/max31790.rst
+++ b/Documentation/hwmon/max31790.rst
@@ -30,6 +30,44 @@ monitoring and control of fan RPM as well as detection of fan failure.
 Six pins are dedicated tachometer inputs. Any of the six PWM outputs can
 also be configured to serve as tachometer inputs.
 
+About pwm[1-6]_enable
+---------------------
+0 - full-speed
+    The chip doesn't have a specific way to set "full speed", so setting
+    pwm[1-6]_enable to 0 is just "set PWM mode with 255 duty cycle".
+1 - PWM mode
+    Fan speed is controlled by writing a value to pwm[1-6].
+2 - RPM mode
+    Fan speed is controlled by writing a value to fan[1-6]_target.
+
+About fan[1-6]_fault
+--------------------
+In PWM (or full-speed) mode, if the input RPM goes below what is set
+in fan[1-6]_target, fan[1-6]_fault gets set to 1. In other words,
+fan[1-6]_target works as the minimum input RPM before a fan fault goes off.
+
+In RPM mode, fan fault is set when the fan spins "too slowly" (exact
+conditions are in the datasheet). RPM mode depends on four variables:
+    target_speed:        This is set by fan[1-6]_target.
+    speed_range:         This is set automatically when setting target_speed
+                         or manually by fan[1-12]_div.
+    pwm_rate_of_change:  NOT set by the driver.
+    fan_window:          NOT set by the driver.
+
+The last two values are not set by the driver, because there's no generic way to
+compute them. You should set them manually through i2c (in the bootloader for
+example). Check the datasheet for details.
+
+The fan fault value latches, to reset it, set a value to pwm[1-6]
+or fan[1-6]_target.
+
+About fan[1-12]_div
+-------------------
+This value affects the measurable range of the chip. The driver sets this value
+automatically in RPM based on fan[1-6]_target. In PWM mode, you should set this
+value manually based on the details from the datasheet. Setting the speed range
+is disabled while in RPM mode to prevent overwriting the automatically
+calculated value.
 
 Sysfs entries
 -------------
@@ -39,7 +77,8 @@ fan[1-12]_enable   RW  enable fan speed monitoring
 fan[1-12]_input    RO  fan tachometer speed in RPM
 fan[1-12]_fault    RO  fan experienced fault
 fan[1-12]_div      RW  set the measurable speed range, not available in RPM mode
-fan[1-6]_target    RW  desired fan speed in RPM
+fan[1-6]_target    RW  RPM mode = desired fan speed
+                       PWM mode = minimum fan speed until fault
 pwm[1-6]_enable    RW  regulator mode, 0=full speed, 1=manual (pwm) mode, 2=rpm mode
                        setting rpm mode sets fan*_enable to 1
 pwm[1-6]           RW  fan target duty cycle (0-255)
-- 
2.31.1


  parent reply	other threads:[~2021-04-13  3:02 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-13  2:59 [PATCH v2 1/5] hwmon: (max31790) Rework to use regmap Václav Kubernát
2021-04-13  2:59 ` [PATCH v2 2/5] hwmon: (max31790) Fix and split pwm*_enable Václav Kubernát
     [not found]   ` <20210419223340.GA229491@roeck-us.net>
2021-04-22  0:26     ` Václav Kubernát
2021-04-13  2:59 ` [PATCH v2 3/5] hwmon: (max31790) Show 0 RPM/fault when input disabled Václav Kubernát
2021-04-13  2:59 ` [PATCH v2 4/5] hwmon: (max31790) Allow setting fan*_div Václav Kubernát
2021-04-13  2:59 ` Václav Kubernát [this message]
2021-04-13  3:10 ` [PATCH v2 1/5] hwmon: (max31790) Rework to use regmap Václav Kubernát
2021-04-22  1:27 ` Guenter Roeck
2021-04-23 10:55   ` Václav Kubernát
2021-04-26 12:46   ` Václav Kubernát
2021-04-26 14:17     ` Guenter Roeck
2021-04-26 14:29       ` Václav Kubernát
2021-04-26 14:35         ` Guenter Roeck
2021-04-26 12:37 ` [PATCH v4 " Václav Kubernát
2021-04-26 12:37   ` [PATCH v4 2/5] hwmon: (max31790) Fix and split pwm*_enable Václav Kubernát
2021-04-26 12:37   ` [PATCH v4 3/5] hwmon: (max31790) Show 0 RPM/fault when input disabled Václav Kubernát
2021-04-26 12:37   ` [PATCH v4 4/5] hwmon: (max31790) Allow setting fan*_div Václav Kubernát
2021-04-26 12:37   ` [PATCH v4 5/5] hwmon: (max31790) Update documentation Václav Kubernát
  -- strict thread matches above, loose matches on Subject: below --
2021-03-16 17:54 [PATCH v2 1/5] hwmon: (max31790) Rework to use regmap Václav Kubernát
2021-03-16 17:55 ` [PATCH v2 5/5] hwmon: (max31790) Update documentation Václav Kubernát

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210413025948.901867-5-kubernat@cesnet.cz \
    --to=kubernat@cesnet.cz \
    --cc=corbet@lwn.net \
    --cc=jdelvare@suse.com \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-hwmon@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@roeck-us.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).