aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation/thinkpad-acpi.txt
diff options
context:
space:
mode:
authorHenrique de Moraes Holschuh <hmh@hmh.eng.br>2007-04-24 10:48:17 -0400
committerLen Brown <len.brown@intel.com>2007-04-25 02:00:27 -0400
commitfe98a52ce7540fb3a19d57488a08864110cf4d5c (patch)
tree8a9ba42e5a4d4ff208297cd18782aa85fef27164 /Documentation/thinkpad-acpi.txt
parent2c37aa4e22dd55070c608290c5031f2ee93e69ce (diff)
ACPI: thinkpad-acpi: add sysfs support to fan subdriver
Export sysfs attributes to monitor and control the internal thinkpad fan (some thinkpads have more than one fan, but thinkpad-acpi doesn't support the second fan yet). The sysfs interface follows the hwmon design guide for fan devices. Also, fix some stray "thermal" files in the fan procfs description that have been there forever, and officially support "full-speed" as the name for the PWM-disabled state of the fan controller to keep it in line with the hwmon interface. It is much better a name for that mode than the unobvious "disengaged" anyway. Change the procfs interface to also accept full-speed as a fan level, but still report it as disengaged for backwards compatibility. Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br> Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'Documentation/thinkpad-acpi.txt')
-rw-r--r--Documentation/thinkpad-acpi.txt157
1 files changed, 106 insertions, 51 deletions
diff --git a/Documentation/thinkpad-acpi.txt b/Documentation/thinkpad-acpi.txt
index 80c0bf28e392..339ce21e59df 100644
--- a/Documentation/thinkpad-acpi.txt
+++ b/Documentation/thinkpad-acpi.txt
@@ -642,8 +642,11 @@ distinct. The unmute the volume after the mute command, use either the
642up or down command (the level command will not unmute the volume). 642up or down command (the level command will not unmute the volume).
643The current volume level and mute state is shown in the file. 643The current volume level and mute state is shown in the file.
644 644
645EXPERIMENTAL: fan speed, fan enable/disable -- /proc/acpi/ibm/fan 645EXPERIMENTAL: fan speed, fan enable/disable
646----------------------------------------------------------------- 646-------------------------------------------
647
648procfs: /proc/acpi/ibm/fan
649sysfs device attributes: (hwmon) fan_input, pwm1, pwm1_enable
647 650
648This feature is marked EXPERIMENTAL because the implementation 651This feature is marked EXPERIMENTAL because the implementation
649directly accesses hardware registers and may not work as expected. USE 652directly accesses hardware registers and may not work as expected. USE
@@ -656,27 +659,26 @@ from the hardware registers of the embedded controller. This is known
656to work on later R, T and X series ThinkPads but may show a bogus 659to work on later R, T and X series ThinkPads but may show a bogus
657value on other models. 660value on other models.
658 661
659Most ThinkPad fans work in "levels". Level 0 stops the fan. The higher 662Fan levels:
660the level, the higher the fan speed, although adjacent levels often map
661to the same fan speed. 7 is the highest level, where the fan reaches
662the maximum recommended speed. Level "auto" means the EC changes the
663fan level according to some internal algorithm, usually based on
664readings from the thermal sensors. Level "disengaged" means the EC
665disables the speed-locked closed-loop fan control, and drives the fan as
666fast as it can go, which might exceed hardware limits, so use this level
667with caution.
668 663
669The fan usually ramps up or down slowly from one speed to another, 664Most ThinkPad fans work in "levels" at the firmware interface. Level 0
670and it is normal for the EC to take several seconds to react to fan 665stops the fan. The higher the level, the higher the fan speed, although
671commands. 666adjacent levels often map to the same fan speed. 7 is the highest
667level, where the fan reaches the maximum recommended speed.
672 668
673The fan may be enabled or disabled with the following commands: 669Level "auto" means the EC changes the fan level according to some
670internal algorithm, usually based on readings from the thermal sensors.
674 671
675 echo enable >/proc/acpi/ibm/fan 672There is also a "full-speed" level, also known as "disengaged" level.
676 echo disable >/proc/acpi/ibm/fan 673In this level, the EC disables the speed-locked closed-loop fan control,
674and drives the fan as fast as it can go, which might exceed hardware
675limits, so use this level with caution.
677 676
678Placing a fan on level 0 is the same as disabling it. Enabling a fan 677The fan usually ramps up or down slowly from one speed to another, and
679will try to place it in a safe level if it is too slow or disabled. 678it is normal for the EC to take several seconds to react to fan
679commands. The full-speed level may take up to two minutes to ramp up to
680maximum speed, and in some ThinkPads, the tachometer readings go stale
681while the EC is transitioning to the full-speed level.
680 682
681WARNING WARNING WARNING: do not leave the fan disabled unless you are 683WARNING WARNING WARNING: do not leave the fan disabled unless you are
682monitoring all of the temperature sensor readings and you are ready to 684monitoring all of the temperature sensor readings and you are ready to
@@ -694,48 +696,101 @@ fan is turned off when the CPU temperature drops to 49 degrees and the
694HDD temperature drops to 41 degrees. These thresholds cannot 696HDD temperature drops to 41 degrees. These thresholds cannot
695currently be controlled. 697currently be controlled.
696 698
699The ThinkPad's ACPI DSDT code will reprogram the fan on its own when
700certain conditions are met. It will override any fan programming done
701through thinkpad-acpi.
702
703The thinkpad-acpi kernel driver can be programmed to revert the fan
704level to a safe setting if userspace does not issue one of the procfs
705fan commands: "enable", "disable", "level" or "watchdog", or if there
706are no writes to pwm1_enable (or to pwm1 *if and only if* pwm1_enable is
707set to 1, manual mode) within a configurable amount of time of up to
708120 seconds. This functionality is called fan safety watchdog.
709
710Note that the watchdog timer stops after it enables the fan. It will be
711rearmed again automatically (using the same interval) when one of the
712above mentioned fan commands is received. The fan watchdog is,
713therefore, not suitable to protect against fan mode changes made through
714means other than the "enable", "disable", and "level" procfs fan
715commands, or the hwmon fan control sysfs interface.
716
717Procfs notes:
718
719The fan may be enabled or disabled with the following commands:
720
721 echo enable >/proc/acpi/ibm/fan
722 echo disable >/proc/acpi/ibm/fan
723
724Placing a fan on level 0 is the same as disabling it. Enabling a fan
725will try to place it in a safe level if it is too slow or disabled.
726
697The fan level can be controlled with the command: 727The fan level can be controlled with the command:
698 728
699 echo 'level <level>' > /proc/acpi/ibm/thermal 729 echo 'level <level>' > /proc/acpi/ibm/fan
700 730
701Where <level> is an integer from 0 to 7, or one of the words "auto" 731Where <level> is an integer from 0 to 7, or one of the words "auto" or
702or "disengaged" (without the quotes). Not all ThinkPads support the 732"full-speed" (without the quotes). Not all ThinkPads support the "auto"
703"auto" and "disengaged" levels. 733and "full-speed" levels. The driver accepts "disengaged" as an alias for
734"full-speed", and reports it as "disengaged" for backwards
735compatibility.
704 736
705On the X31 and X40 (and ONLY on those models), the fan speed can be 737On the X31 and X40 (and ONLY on those models), the fan speed can be
706controlled to a certain degree. Once the fan is running, it can be 738controlled to a certain degree. Once the fan is running, it can be
707forced to run faster or slower with the following command: 739forced to run faster or slower with the following command:
708 740
709 echo 'speed <speed>' > /proc/acpi/ibm/thermal 741 echo 'speed <speed>' > /proc/acpi/ibm/fan
710 742
711The sustainable range of fan speeds on the X40 appears to be from 743The sustainable range of fan speeds on the X40 appears to be from about
712about 3700 to about 7350. Values outside this range either do not have 7443700 to about 7350. Values outside this range either do not have any
713any effect or the fan speed eventually settles somewhere in that 745effect or the fan speed eventually settles somewhere in that range. The
714range. The fan cannot be stopped or started with this command. 746fan cannot be stopped or started with this command. This functionality
747is incomplete, and not available through the sysfs interface.
715 748
716The ThinkPad's ACPI DSDT code will reprogram the fan on its own when 749To program the safety watchdog, use the "watchdog" command.
717certain conditions are met. It will override any fan programming done 750
718through thinkpad-acpi. 751 echo 'watchdog <interval in seconds>' > /proc/acpi/ibm/fan
752
753If you want to disable the watchdog, use 0 as the interval.
754
755Sysfs notes:
756
757The sysfs interface follows the hwmon subsystem guidelines for the most
758part, and the exception is the fan safety watchdog.
759
760hwmon device attribute pwm1_enable:
761 0: PWM offline (fan is set to full-speed mode)
762 1: Manual PWM control (use pwm1 to set fan level)
763 2: Hardware PWM control (EC "auto" mode)
764 3: reserved (Software PWM control, not implemented yet)
765
766 Modes 0 and 2 are not supported by all ThinkPads, and the driver
767 is not always able to detect this. If it does know a mode is
768 unsupported, it will return -EINVAL.
769
770hwmon device attribute pwm1:
771 Fan level, scaled from the firmware values of 0-7 to the hwmon
772 scale of 0-255. 0 means fan stopped, 255 means highest normal
773 speed (level 7).
774
775 This attribute only commands the fan if pmw1_enable is set to 1
776 (manual PWM control).
777
778hwmon device attribute fan1_input:
779 Fan tachometer reading, in RPM. May go stale on certain
780 ThinkPads while the EC transitions the PWM to offline mode,
781 which can take up to two minutes. May return rubbish on older
782 ThinkPads.
783
784driver attribute fan_watchdog:
785 Fan safety watchdog timer interval, in seconds. Minimum is
786 1 second, maximum is 120 seconds. 0 disables the watchdog.
787
788To stop the fan: set pwm1 to zero, and pwm1_enable to 1.
789
790To start the fan in a safe mode: set pwm1_enable to 2. If that fails
791with ENOTSUP, set it to 1 and set pwm1 to at least 128 (255 would be the
792safest choice, though).
719 793
720The thinkpad-acpi kernel driver can be programmed to revert the fan
721level to a safe setting if userspace does not issue one of the fan
722commands: "enable", "disable", "level" or "watchdog" within a
723configurable ammount of time. To do this, use the "watchdog" command.
724
725 echo 'watchdog <interval>' > /proc/acpi/ibm/fan
726
727Interval is the ammount of time in seconds to wait for one of the
728above mentioned fan commands before reseting the fan level to a safe
729one. If set to zero, the watchdog is disabled (default). When the
730watchdog timer runs out, it does the exact equivalent of the "enable"
731fan command.
732
733Note that the watchdog timer stops after it enables the fan. It will
734be rearmed again automatically (using the same interval) when one of
735the above mentioned fan commands is received. The fan watchdog is,
736therefore, not suitable to protect against fan mode changes made
737through means other than the "enable", "disable", and "level" fan
738commands.
739 794
740EXPERIMENTAL: WAN -- /proc/acpi/ibm/wan 795EXPERIMENTAL: WAN -- /proc/acpi/ibm/wan
741--------------------------------------- 796---------------------------------------