<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://www.thinkwiki.org/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Dimeco</id>
	<title>ThinkWiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://www.thinkwiki.org/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Dimeco"/>
	<link rel="alternate" type="text/html" href="https://www.thinkwiki.org/wiki/Special:Contributions/Dimeco"/>
	<updated>2026-05-01T06:10:48Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.31.12</generator>
	<entry>
		<id>https://www.thinkwiki.org/w/index.php?title=Patch_for_controlling_fan_speed&amp;diff=24325</id>
		<title>Patch for controlling fan speed</title>
		<link rel="alternate" type="text/html" href="https://www.thinkwiki.org/w/index.php?title=Patch_for_controlling_fan_speed&amp;diff=24325"/>
		<updated>2006-08-22T11:36:36Z</updated>

		<summary type="html">&lt;p&gt;Dimeco: /* for ibm-acpi 0.12a as found in kernel 2.6.14 and 2.6.17 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Overview==&lt;br /&gt;
&lt;br /&gt;
This patch extends the [[ibm-acpi]] Linux kernel module to control fan speed. It can be used to reduce [[Problem with fan noise|fan noise]] (both speed and pulsing) and to decrease fan power consumption.&lt;br /&gt;
&lt;br /&gt;
When this patch is applied and the &amp;lt;tt&amp;gt;ibm-acpi&amp;lt;/tt&amp;gt; module is loaded with the &amp;lt;tt&amp;gt;experimental=1&amp;lt;/tt&amp;gt; module parameter, the following new capabilities are added to {{path|/proc/acpi/ibm/fan}}:&lt;br /&gt;
* {{cmdroot|echo level LEVEL &amp;gt; /proc/acpi/ibm/fan}} sets a fan speed level between 0 and 7, where &amp;lt;tt&amp;gt;LEVEL&amp;lt;/TT&amp;gt;=0 means fan off and &amp;lt;tt&amp;gt;LEVEL&amp;lt;/tt&amp;gt;=7 is the fastest speed.&lt;br /&gt;
* {{cmdroot|echo level auto &amp;gt; /proc/acpi/ibm/fan}} tells the embedded controller to set the fan speed automatically according to system temperatures (this is the default).&lt;br /&gt;
* {{cmdroot|echo level disengaged &amp;gt; /proc/acpi/ibm/fan}} tells the embedded controller to disengage fan speed control (see specs below).&lt;br /&gt;
* {{cmdroot|cat /proc/acpi/ibm/fan}} shows the current fan level (in addition to the fan speed in RPM).&lt;br /&gt;
&lt;br /&gt;
For example:&lt;br /&gt;
&lt;br /&gt;
 '''#cat /proc/acpi/ibm/fan'''&lt;br /&gt;
 status:         enabled&lt;br /&gt;
 level:          auto&lt;br /&gt;
 speed:          4219&lt;br /&gt;
 commands:       enable, disable, level &amp;lt;level&amp;gt;&lt;br /&gt;
                 (&amp;lt;level&amp;gt; is 0-7, auto or disengaged)&lt;br /&gt;
 &lt;br /&gt;
 '''#echo level 2 &amp;gt; /proc/acpi/ibm/fan'''&lt;br /&gt;
 &lt;br /&gt;
 '''#cat /proc/acpi/ibm/fan'''&lt;br /&gt;
 status:         enabled&lt;br /&gt;
 level:          2&lt;br /&gt;
 speed:          3142&lt;br /&gt;
 commands:       enable, disable, level &amp;lt;level&amp;gt;&lt;br /&gt;
                 (&amp;lt;level&amp;gt; is 0-7, auto or disengaged)&lt;br /&gt;
&lt;br /&gt;
This patch is best used with an [[ACPI fan control script#Variable speed control scripts|ACPI fan control script]] that monitors system temperature and sets the fan speed accordingly.&lt;br /&gt;
&lt;br /&gt;
{{WARN|Overriding the system's automatic temperature control may cause permanent hardware damage. Even when using temperature monitoring software, it is not clear whether the software can access all temperature sensor accessible to the embedded controller and understand them correctly. Moreover, this patch relies on an undocumented hardware interface, and may thus have arbitrary effects (especially on models it wasn't tested on).}}&lt;br /&gt;
&lt;br /&gt;
==The patch==&lt;br /&gt;
&lt;br /&gt;
===for ibm-acpi 0.11===&lt;br /&gt;
{{CodeRef|ibm-acpi-0.11-2.6.13-fan.patch}}&lt;br /&gt;
&lt;br /&gt;
This also includes a minor fix (rename of &amp;lt;tt&amp;gt;device_add&amp;lt;/tt&amp;gt;) to make [[ibm-acpi]] 0.11 compile on kernel 2.6.13.&lt;br /&gt;
&lt;br /&gt;
===for ibm-acpi 0.12a as found in kernels 2.6.14 and 2.6.17===&lt;br /&gt;
&lt;br /&gt;
A slightly modified version which also keeps the lines in the format expected by the gkrellm plugin.&lt;br /&gt;
&lt;br /&gt;
{{CodeRef|ibm-acpi-0.12a-2.6.14-fan.patch}}&lt;br /&gt;
&lt;br /&gt;
{{CodeRef|ibm-acpi-0.12a-2.6.17-fan.patch}}&lt;br /&gt;
&lt;br /&gt;
{{NOTE|In order to patch the ibm_acpi.c file you have tu issue the following command: &amp;lt;code&amp;gt;patch -p0 -l &amp;lt; fanpatch&amp;lt;/code&amp;gt;. The '-l' option is important because if the patch pasted here doesn't have any tabs any more. Another advice: Always try to patch the files first before really patching it. That is done by adding --dry-run to the command.}}&lt;br /&gt;
&lt;br /&gt;
===Ideas for improvement===&lt;br /&gt;
&lt;br /&gt;
* When fan speed is controlled from userspace (e.g., by the [[ACPI fan control script#Variable speed control scripts|ACPI fan control scripts]]), the userspace component may die (for whatever reason) leaving the fan at a low speed, potentially leading to damage. We can add a watchdog to the kernel component, which resets the fan to Embedded Controller control (&amp;lt;tt&amp;gt;leve: auto&amp;lt;/tt&amp;gt;) if {{path|/proc/acpi/ibm/fan}} was not written to for ''N'' seconds.&lt;br /&gt;
&lt;br /&gt;
==Alternative methods and hardware specs==&lt;br /&gt;
&lt;br /&gt;
See [[How to control fan speed]].&lt;br /&gt;
&lt;br /&gt;
==Supported models==&lt;br /&gt;
&lt;br /&gt;
See [[How to control fan speed]].&lt;br /&gt;
&lt;br /&gt;
[[Category:Patches]]&lt;/div&gt;</summary>
		<author><name>Dimeco</name></author>
		
	</entry>
	<entry>
		<id>https://www.thinkwiki.org/w/index.php?title=Patch_for_controlling_fan_speed&amp;diff=24324</id>
		<title>Patch for controlling fan speed</title>
		<link rel="alternate" type="text/html" href="https://www.thinkwiki.org/w/index.php?title=Patch_for_controlling_fan_speed&amp;diff=24324"/>
		<updated>2006-08-22T11:36:22Z</updated>

		<summary type="html">&lt;p&gt;Dimeco: /* for ibm-acpi 0.12a as found in kernel 2.6.14 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Overview==&lt;br /&gt;
&lt;br /&gt;
This patch extends the [[ibm-acpi]] Linux kernel module to control fan speed. It can be used to reduce [[Problem with fan noise|fan noise]] (both speed and pulsing) and to decrease fan power consumption.&lt;br /&gt;
&lt;br /&gt;
When this patch is applied and the &amp;lt;tt&amp;gt;ibm-acpi&amp;lt;/tt&amp;gt; module is loaded with the &amp;lt;tt&amp;gt;experimental=1&amp;lt;/tt&amp;gt; module parameter, the following new capabilities are added to {{path|/proc/acpi/ibm/fan}}:&lt;br /&gt;
* {{cmdroot|echo level LEVEL &amp;gt; /proc/acpi/ibm/fan}} sets a fan speed level between 0 and 7, where &amp;lt;tt&amp;gt;LEVEL&amp;lt;/TT&amp;gt;=0 means fan off and &amp;lt;tt&amp;gt;LEVEL&amp;lt;/tt&amp;gt;=7 is the fastest speed.&lt;br /&gt;
* {{cmdroot|echo level auto &amp;gt; /proc/acpi/ibm/fan}} tells the embedded controller to set the fan speed automatically according to system temperatures (this is the default).&lt;br /&gt;
* {{cmdroot|echo level disengaged &amp;gt; /proc/acpi/ibm/fan}} tells the embedded controller to disengage fan speed control (see specs below).&lt;br /&gt;
* {{cmdroot|cat /proc/acpi/ibm/fan}} shows the current fan level (in addition to the fan speed in RPM).&lt;br /&gt;
&lt;br /&gt;
For example:&lt;br /&gt;
&lt;br /&gt;
 '''#cat /proc/acpi/ibm/fan'''&lt;br /&gt;
 status:         enabled&lt;br /&gt;
 level:          auto&lt;br /&gt;
 speed:          4219&lt;br /&gt;
 commands:       enable, disable, level &amp;lt;level&amp;gt;&lt;br /&gt;
                 (&amp;lt;level&amp;gt; is 0-7, auto or disengaged)&lt;br /&gt;
 &lt;br /&gt;
 '''#echo level 2 &amp;gt; /proc/acpi/ibm/fan'''&lt;br /&gt;
 &lt;br /&gt;
 '''#cat /proc/acpi/ibm/fan'''&lt;br /&gt;
 status:         enabled&lt;br /&gt;
 level:          2&lt;br /&gt;
 speed:          3142&lt;br /&gt;
 commands:       enable, disable, level &amp;lt;level&amp;gt;&lt;br /&gt;
                 (&amp;lt;level&amp;gt; is 0-7, auto or disengaged)&lt;br /&gt;
&lt;br /&gt;
This patch is best used with an [[ACPI fan control script#Variable speed control scripts|ACPI fan control script]] that monitors system temperature and sets the fan speed accordingly.&lt;br /&gt;
&lt;br /&gt;
{{WARN|Overriding the system's automatic temperature control may cause permanent hardware damage. Even when using temperature monitoring software, it is not clear whether the software can access all temperature sensor accessible to the embedded controller and understand them correctly. Moreover, this patch relies on an undocumented hardware interface, and may thus have arbitrary effects (especially on models it wasn't tested on).}}&lt;br /&gt;
&lt;br /&gt;
==The patch==&lt;br /&gt;
&lt;br /&gt;
===for ibm-acpi 0.11===&lt;br /&gt;
{{CodeRef|ibm-acpi-0.11-2.6.13-fan.patch}}&lt;br /&gt;
&lt;br /&gt;
This also includes a minor fix (rename of &amp;lt;tt&amp;gt;device_add&amp;lt;/tt&amp;gt;) to make [[ibm-acpi]] 0.11 compile on kernel 2.6.13.&lt;br /&gt;
&lt;br /&gt;
===for ibm-acpi 0.12a as found in kernel 2.6.14 and 2.6.17===&lt;br /&gt;
&lt;br /&gt;
A slightly modified version which also keeps the lines in the format expected by the gkrellm plugin.&lt;br /&gt;
&lt;br /&gt;
{{CodeRef|ibm-acpi-0.12a-2.6.14-fan.patch}}&lt;br /&gt;
&lt;br /&gt;
{{CodeRef|ibm-acpi-0.12a-2.6.17-fan.patch}}&lt;br /&gt;
&lt;br /&gt;
{{NOTE|In order to patch the ibm_acpi.c file you have tu issue the following command: &amp;lt;code&amp;gt;patch -p0 -l &amp;lt; fanpatch&amp;lt;/code&amp;gt;. The '-l' option is important because if the patch pasted here doesn't have any tabs any more. Another advice: Always try to patch the files first before really patching it. That is done by adding --dry-run to the command.}}&lt;br /&gt;
&lt;br /&gt;
===Ideas for improvement===&lt;br /&gt;
&lt;br /&gt;
* When fan speed is controlled from userspace (e.g., by the [[ACPI fan control script#Variable speed control scripts|ACPI fan control scripts]]), the userspace component may die (for whatever reason) leaving the fan at a low speed, potentially leading to damage. We can add a watchdog to the kernel component, which resets the fan to Embedded Controller control (&amp;lt;tt&amp;gt;leve: auto&amp;lt;/tt&amp;gt;) if {{path|/proc/acpi/ibm/fan}} was not written to for ''N'' seconds.&lt;br /&gt;
&lt;br /&gt;
==Alternative methods and hardware specs==&lt;br /&gt;
&lt;br /&gt;
See [[How to control fan speed]].&lt;br /&gt;
&lt;br /&gt;
==Supported models==&lt;br /&gt;
&lt;br /&gt;
See [[How to control fan speed]].&lt;br /&gt;
&lt;br /&gt;
[[Category:Patches]]&lt;/div&gt;</summary>
		<author><name>Dimeco</name></author>
		
	</entry>
	<entry>
		<id>https://www.thinkwiki.org/w/index.php?title=Patch_for_controlling_fan_speed&amp;diff=24323</id>
		<title>Patch for controlling fan speed</title>
		<link rel="alternate" type="text/html" href="https://www.thinkwiki.org/w/index.php?title=Patch_for_controlling_fan_speed&amp;diff=24323"/>
		<updated>2006-08-22T11:35:55Z</updated>

		<summary type="html">&lt;p&gt;Dimeco: /* for ibm-acpi 0.12a as found in kernel 2.6.14 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Overview==&lt;br /&gt;
&lt;br /&gt;
This patch extends the [[ibm-acpi]] Linux kernel module to control fan speed. It can be used to reduce [[Problem with fan noise|fan noise]] (both speed and pulsing) and to decrease fan power consumption.&lt;br /&gt;
&lt;br /&gt;
When this patch is applied and the &amp;lt;tt&amp;gt;ibm-acpi&amp;lt;/tt&amp;gt; module is loaded with the &amp;lt;tt&amp;gt;experimental=1&amp;lt;/tt&amp;gt; module parameter, the following new capabilities are added to {{path|/proc/acpi/ibm/fan}}:&lt;br /&gt;
* {{cmdroot|echo level LEVEL &amp;gt; /proc/acpi/ibm/fan}} sets a fan speed level between 0 and 7, where &amp;lt;tt&amp;gt;LEVEL&amp;lt;/TT&amp;gt;=0 means fan off and &amp;lt;tt&amp;gt;LEVEL&amp;lt;/tt&amp;gt;=7 is the fastest speed.&lt;br /&gt;
* {{cmdroot|echo level auto &amp;gt; /proc/acpi/ibm/fan}} tells the embedded controller to set the fan speed automatically according to system temperatures (this is the default).&lt;br /&gt;
* {{cmdroot|echo level disengaged &amp;gt; /proc/acpi/ibm/fan}} tells the embedded controller to disengage fan speed control (see specs below).&lt;br /&gt;
* {{cmdroot|cat /proc/acpi/ibm/fan}} shows the current fan level (in addition to the fan speed in RPM).&lt;br /&gt;
&lt;br /&gt;
For example:&lt;br /&gt;
&lt;br /&gt;
 '''#cat /proc/acpi/ibm/fan'''&lt;br /&gt;
 status:         enabled&lt;br /&gt;
 level:          auto&lt;br /&gt;
 speed:          4219&lt;br /&gt;
 commands:       enable, disable, level &amp;lt;level&amp;gt;&lt;br /&gt;
                 (&amp;lt;level&amp;gt; is 0-7, auto or disengaged)&lt;br /&gt;
 &lt;br /&gt;
 '''#echo level 2 &amp;gt; /proc/acpi/ibm/fan'''&lt;br /&gt;
 &lt;br /&gt;
 '''#cat /proc/acpi/ibm/fan'''&lt;br /&gt;
 status:         enabled&lt;br /&gt;
 level:          2&lt;br /&gt;
 speed:          3142&lt;br /&gt;
 commands:       enable, disable, level &amp;lt;level&amp;gt;&lt;br /&gt;
                 (&amp;lt;level&amp;gt; is 0-7, auto or disengaged)&lt;br /&gt;
&lt;br /&gt;
This patch is best used with an [[ACPI fan control script#Variable speed control scripts|ACPI fan control script]] that monitors system temperature and sets the fan speed accordingly.&lt;br /&gt;
&lt;br /&gt;
{{WARN|Overriding the system's automatic temperature control may cause permanent hardware damage. Even when using temperature monitoring software, it is not clear whether the software can access all temperature sensor accessible to the embedded controller and understand them correctly. Moreover, this patch relies on an undocumented hardware interface, and may thus have arbitrary effects (especially on models it wasn't tested on).}}&lt;br /&gt;
&lt;br /&gt;
==The patch==&lt;br /&gt;
&lt;br /&gt;
===for ibm-acpi 0.11===&lt;br /&gt;
{{CodeRef|ibm-acpi-0.11-2.6.13-fan.patch}}&lt;br /&gt;
&lt;br /&gt;
This also includes a minor fix (rename of &amp;lt;tt&amp;gt;device_add&amp;lt;/tt&amp;gt;) to make [[ibm-acpi]] 0.11 compile on kernel 2.6.13.&lt;br /&gt;
&lt;br /&gt;
===for ibm-acpi 0.12a as found in kernel 2.6.14===&lt;br /&gt;
&lt;br /&gt;
A slightly modified version which also keeps the lines in the format expected by the gkrellm plugin.&lt;br /&gt;
&lt;br /&gt;
{{CodeRef|ibm-acpi-0.12a-2.6.14-fan.patch}}&lt;br /&gt;
&lt;br /&gt;
(updated for kernel 2.6.17: {{CodeRef|ibm-acpi-0.12a-2.6.17-fan.patch}})&lt;br /&gt;
&lt;br /&gt;
{{NOTE|In order to patch the ibm_acpi.c file you have tu issue the following command: &amp;lt;code&amp;gt;patch -p0 -l &amp;lt; fanpatch&amp;lt;/code&amp;gt;. The '-l' option is important because if the patch pasted here doesn't have any tabs any more. Another advice: Always try to patch the files first before really patching it. That is done by adding --dry-run to the command.}}&lt;br /&gt;
&lt;br /&gt;
===Ideas for improvement===&lt;br /&gt;
&lt;br /&gt;
* When fan speed is controlled from userspace (e.g., by the [[ACPI fan control script#Variable speed control scripts|ACPI fan control scripts]]), the userspace component may die (for whatever reason) leaving the fan at a low speed, potentially leading to damage. We can add a watchdog to the kernel component, which resets the fan to Embedded Controller control (&amp;lt;tt&amp;gt;leve: auto&amp;lt;/tt&amp;gt;) if {{path|/proc/acpi/ibm/fan}} was not written to for ''N'' seconds.&lt;br /&gt;
&lt;br /&gt;
==Alternative methods and hardware specs==&lt;br /&gt;
&lt;br /&gt;
See [[How to control fan speed]].&lt;br /&gt;
&lt;br /&gt;
==Supported models==&lt;br /&gt;
&lt;br /&gt;
See [[How to control fan speed]].&lt;br /&gt;
&lt;br /&gt;
[[Category:Patches]]&lt;/div&gt;</summary>
		<author><name>Dimeco</name></author>
		
	</entry>
	<entry>
		<id>https://www.thinkwiki.org/w/index.php?title=Talk:Code/ibm-acpi-0.11-2.6.13-fan.patch&amp;diff=24322</id>
		<title>Talk:Code/ibm-acpi-0.11-2.6.13-fan.patch</title>
		<link rel="alternate" type="text/html" href="https://www.thinkwiki.org/w/index.php?title=Talk:Code/ibm-acpi-0.11-2.6.13-fan.patch&amp;diff=24322"/>
		<updated>2006-08-22T11:34:43Z</updated>

		<summary type="html">&lt;p&gt;Dimeco: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Dimeco</name></author>
		
	</entry>
	<entry>
		<id>https://www.thinkwiki.org/w/index.php?title=Code/ibm-acpi-0.12a-2.6.17-fan.patch&amp;diff=24320</id>
		<title>Code/ibm-acpi-0.12a-2.6.17-fan.patch</title>
		<link rel="alternate" type="text/html" href="https://www.thinkwiki.org/w/index.php?title=Code/ibm-acpi-0.12a-2.6.17-fan.patch&amp;diff=24320"/>
		<updated>2006-08-22T11:33:57Z</updated>

		<summary type="html">&lt;p&gt;Dimeco: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;--- drivers/acpi/ibm_acpi.c.orig        2006-08-22 19:04:43.000000000 +0900&lt;br /&gt;
+++ drivers/acpi/ibm_acpi.c     2006-08-22 19:10:28.000000000 +0900&lt;br /&gt;
@@ -1466,6 +1466,7 @@&lt;br /&gt;
 {&lt;br /&gt;
        int len = 0;&lt;br /&gt;
        int s;&lt;br /&gt;
+       char status_read = 0;&lt;br /&gt;
        u8 lo, hi, status;&lt;br /&gt;
&lt;br /&gt;
        if (gfan_handle) {&lt;br /&gt;
@@ -1479,8 +1480,11 @@&lt;br /&gt;
                if (!acpi_ec_read(fan_status_offset, &amp;amp;status))&lt;br /&gt;
                        len += sprintf(p + len, &amp;quot;status:\t\tunreadable\n&amp;quot;);&lt;br /&gt;
                else&lt;br /&gt;
+               {&lt;br /&gt;
                        len += sprintf(p + len, &amp;quot;status:\t\t%s\n&amp;quot;,&lt;br /&gt;
-                                      enabled(status, 7));&lt;br /&gt;
+                                       status ? &amp;quot;enabled&amp;quot; : &amp;quot;disabled&amp;quot; );&lt;br /&gt;
+                       status_read = 1;&lt;br /&gt;
+               }&lt;br /&gt;
&lt;br /&gt;
                if (!acpi_ec_read(fan_rpm_offset, &amp;amp;lo) ||&lt;br /&gt;
                    !acpi_ec_read(fan_rpm_offset + 1, &amp;amp;hi))&lt;br /&gt;
@@ -1488,6 +1492,16 @@&lt;br /&gt;
                else&lt;br /&gt;
                        len += sprintf(p + len, &amp;quot;speed:\t\t%d\n&amp;quot;,&lt;br /&gt;
                                       (hi &amp;lt;&amp;lt; 8) + lo);&lt;br /&gt;
+&lt;br /&gt;
+               if (status_read) {&lt;br /&gt;
+                       if (status &amp;amp; 0x40)&lt;br /&gt;
+                               len += sprintf(p + len, &amp;quot;level:\t\tdisengaged\n&amp;quot;);&lt;br /&gt;
+                       else if (status &amp;amp; 0x80)&lt;br /&gt;
+                               len += sprintf(p + len, &amp;quot;level:\t\tauto\n&amp;quot;);&lt;br /&gt;
+                       else&lt;br /&gt;
+                               len += sprintf(p + len, &amp;quot;level:\t\t%d\n&amp;quot;, status);&lt;br /&gt;
+               }&lt;br /&gt;
+&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        if (sfan_handle)&lt;br /&gt;
@@ -1496,7 +1510,10 @@&lt;br /&gt;
                               &amp;quot; (&amp;lt;level&amp;gt; is 0-7)\n&amp;quot;);&lt;br /&gt;
        if (!gfan_handle)&lt;br /&gt;
                /* all except 570, 600e/x, 770e, 770x */&lt;br /&gt;
-               len += sprintf(p + len, &amp;quot;commands:\tenable, disable\n&amp;quot;);&lt;br /&gt;
+                len += sprintf(p + len, &lt;br /&gt;
+                             &amp;quot;commands:\tenable, disable, level &amp;lt;level&amp;gt;\n&amp;quot;&lt;br /&gt;
+                             &amp;quot;         \t(&amp;lt;level&amp;gt; is 0-7, auto &amp;quot;&lt;br /&gt;
+                             &amp;quot;or disengaged)\n&amp;quot;);&lt;br /&gt;
        if (fans_handle)&lt;br /&gt;
                /* X31, X40 */&lt;br /&gt;
                len += sprintf(p + len, &amp;quot;commands:\tspeed &amp;lt;speed&amp;gt;&amp;quot;&lt;br /&gt;
@@ -1517,7 +1534,8 @@&lt;br /&gt;
                        /* 570, 770x-JL */&lt;br /&gt;
                        if (!acpi_evalf(sfan_handle, NULL, NULL, &amp;quot;vd&amp;quot;, level))&lt;br /&gt;
                                return -EIO;&lt;br /&gt;
-               } else if (!gfan_handle &amp;amp;&amp;amp; strlencmp(cmd, &amp;quot;enable&amp;quot;) == 0) {&lt;br /&gt;
+               } else if (!gfan_handle &amp;amp;&amp;amp; ( (strlencmp(cmd, &amp;quot;enable&amp;quot;) == 0) || &lt;br /&gt;
+                               (strlencmp(cmd, &amp;quot;level auto&amp;quot;) == 0) ) ) {&lt;br /&gt;
                        /* all except 570, 600e/x, 770e, 770x */&lt;br /&gt;
                        if (!acpi_ec_write(fan_status_offset, 0x80))&lt;br /&gt;
                                return -EIO;&lt;br /&gt;
@@ -1525,6 +1543,17 @@&lt;br /&gt;
                        /* all except 570, 600e/x, 770e, 770x */&lt;br /&gt;
                        if (!acpi_ec_write(fan_status_offset, 0x00))&lt;br /&gt;
                                return -EIO;&lt;br /&gt;
+                } else if (!gfan_handle &amp;amp;&amp;amp;&lt;br /&gt;
+                          strlencmp(cmd, &amp;quot;level disengaged&amp;quot;) == 0) {&lt;br /&gt;
+                       /* all except 570, 600e/x, 770e, 770x */&lt;br /&gt;
+                       if (!acpi_ec_write(fan_status_offset, 0x40))&lt;br /&gt;
+                               return -EIO;&lt;br /&gt;
+               } else if (!gfan_handle &amp;amp;&amp;amp;&lt;br /&gt;
+                   sscanf(cmd, &amp;quot;level %d&amp;quot;, &amp;amp;level) == 1 &amp;amp;&amp;amp;&lt;br /&gt;
+                   level &amp;gt;=0 &amp;amp;&amp;amp; level &amp;lt;= 7) {&lt;br /&gt;
+                       /* all except 570, 600e/x, 770e, 770x */&lt;br /&gt;
+                       if (!acpi_ec_write(fan_status_offset, level))&lt;br /&gt;
+                               return -EIO;&lt;br /&gt;
                } else if (fans_handle &amp;amp;&amp;amp;&lt;br /&gt;
                           sscanf(cmd, &amp;quot;speed %d&amp;quot;, &amp;amp;speed) == 1 &amp;amp;&amp;amp;&lt;br /&gt;
                           speed &amp;gt;= 0 &amp;amp;&amp;amp; speed &amp;lt;= 65535) {&lt;/div&gt;</summary>
		<author><name>Dimeco</name></author>
		
	</entry>
	<entry>
		<id>https://www.thinkwiki.org/w/index.php?title=Talk:Code/ibm-acpi-0.12a-2.6.17-fan.patch&amp;diff=24319</id>
		<title>Talk:Code/ibm-acpi-0.12a-2.6.17-fan.patch</title>
		<link rel="alternate" type="text/html" href="https://www.thinkwiki.org/w/index.php?title=Talk:Code/ibm-acpi-0.12a-2.6.17-fan.patch&amp;diff=24319"/>
		<updated>2006-08-22T11:33:36Z</updated>

		<summary type="html">&lt;p&gt;Dimeco: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{CodeHeader|&lt;br /&gt;
|filename=ibm-acpi-0.12a-2.6.17-fan.patch&lt;br /&gt;
|context=[[Patch for controlling fan speed]]&lt;br /&gt;
|author=[[User:dimeco|dimeco]]&lt;br /&gt;
|license=GPL v2 or higher, or GFDL v1.2 or higher&lt;br /&gt;
}}&lt;/div&gt;</summary>
		<author><name>Dimeco</name></author>
		
	</entry>
	<entry>
		<id>https://www.thinkwiki.org/w/index.php?title=Patch_for_controlling_fan_speed&amp;diff=24318</id>
		<title>Patch for controlling fan speed</title>
		<link rel="alternate" type="text/html" href="https://www.thinkwiki.org/w/index.php?title=Patch_for_controlling_fan_speed&amp;diff=24318"/>
		<updated>2006-08-22T11:32:14Z</updated>

		<summary type="html">&lt;p&gt;Dimeco: /* The patch */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Overview==&lt;br /&gt;
&lt;br /&gt;
This patch extends the [[ibm-acpi]] Linux kernel module to control fan speed. It can be used to reduce [[Problem with fan noise|fan noise]] (both speed and pulsing) and to decrease fan power consumption.&lt;br /&gt;
&lt;br /&gt;
When this patch is applied and the &amp;lt;tt&amp;gt;ibm-acpi&amp;lt;/tt&amp;gt; module is loaded with the &amp;lt;tt&amp;gt;experimental=1&amp;lt;/tt&amp;gt; module parameter, the following new capabilities are added to {{path|/proc/acpi/ibm/fan}}:&lt;br /&gt;
* {{cmdroot|echo level LEVEL &amp;gt; /proc/acpi/ibm/fan}} sets a fan speed level between 0 and 7, where &amp;lt;tt&amp;gt;LEVEL&amp;lt;/TT&amp;gt;=0 means fan off and &amp;lt;tt&amp;gt;LEVEL&amp;lt;/tt&amp;gt;=7 is the fastest speed.&lt;br /&gt;
* {{cmdroot|echo level auto &amp;gt; /proc/acpi/ibm/fan}} tells the embedded controller to set the fan speed automatically according to system temperatures (this is the default).&lt;br /&gt;
* {{cmdroot|echo level disengaged &amp;gt; /proc/acpi/ibm/fan}} tells the embedded controller to disengage fan speed control (see specs below).&lt;br /&gt;
* {{cmdroot|cat /proc/acpi/ibm/fan}} shows the current fan level (in addition to the fan speed in RPM).&lt;br /&gt;
&lt;br /&gt;
For example:&lt;br /&gt;
&lt;br /&gt;
 '''#cat /proc/acpi/ibm/fan'''&lt;br /&gt;
 status:         enabled&lt;br /&gt;
 level:          auto&lt;br /&gt;
 speed:          4219&lt;br /&gt;
 commands:       enable, disable, level &amp;lt;level&amp;gt;&lt;br /&gt;
                 (&amp;lt;level&amp;gt; is 0-7, auto or disengaged)&lt;br /&gt;
 &lt;br /&gt;
 '''#echo level 2 &amp;gt; /proc/acpi/ibm/fan'''&lt;br /&gt;
 &lt;br /&gt;
 '''#cat /proc/acpi/ibm/fan'''&lt;br /&gt;
 status:         enabled&lt;br /&gt;
 level:          2&lt;br /&gt;
 speed:          3142&lt;br /&gt;
 commands:       enable, disable, level &amp;lt;level&amp;gt;&lt;br /&gt;
                 (&amp;lt;level&amp;gt; is 0-7, auto or disengaged)&lt;br /&gt;
&lt;br /&gt;
This patch is best used with an [[ACPI fan control script#Variable speed control scripts|ACPI fan control script]] that monitors system temperature and sets the fan speed accordingly.&lt;br /&gt;
&lt;br /&gt;
{{WARN|Overriding the system's automatic temperature control may cause permanent hardware damage. Even when using temperature monitoring software, it is not clear whether the software can access all temperature sensor accessible to the embedded controller and understand them correctly. Moreover, this patch relies on an undocumented hardware interface, and may thus have arbitrary effects (especially on models it wasn't tested on).}}&lt;br /&gt;
&lt;br /&gt;
==The patch==&lt;br /&gt;
&lt;br /&gt;
===for ibm-acpi 0.11===&lt;br /&gt;
{{CodeRef|ibm-acpi-0.11-2.6.13-fan.patch}}&lt;br /&gt;
&lt;br /&gt;
This also includes a minor fix (rename of &amp;lt;tt&amp;gt;device_add&amp;lt;/tt&amp;gt;) to make [[ibm-acpi]] 0.11 compile on kernel 2.6.13.&lt;br /&gt;
&lt;br /&gt;
===for ibm-acpi 0.12a as found in kernel 2.6.14===&lt;br /&gt;
&lt;br /&gt;
A slightly modified version which also keeps the lines in the format expected by the gkrellm plugin.&lt;br /&gt;
&lt;br /&gt;
{{CodeRef|ibm-acpi-0.12a-2.6.14-fan.patch}}&lt;br /&gt;
&lt;br /&gt;
(modified for kernel 2.6.17: {{CodeRef|ibm-acpi-0.12a-2.6.17-fan.patch}})&lt;br /&gt;
&lt;br /&gt;
{{NOTE|In order to patch the ibm_acpi.c file you have tu issue the following command: &amp;lt;code&amp;gt;patch -p0 -l &amp;lt; fanpatch&amp;lt;/code&amp;gt;. The '-l' option is important because if the patch pasted here doesn't have any tabs any more. Another advice: Always try to patch the files first before really patching it. That is done by adding --dry-run to the command.}}&lt;br /&gt;
&lt;br /&gt;
===Ideas for improvement===&lt;br /&gt;
&lt;br /&gt;
* When fan speed is controlled from userspace (e.g., by the [[ACPI fan control script#Variable speed control scripts|ACPI fan control scripts]]), the userspace component may die (for whatever reason) leaving the fan at a low speed, potentially leading to damage. We can add a watchdog to the kernel component, which resets the fan to Embedded Controller control (&amp;lt;tt&amp;gt;leve: auto&amp;lt;/tt&amp;gt;) if {{path|/proc/acpi/ibm/fan}} was not written to for ''N'' seconds.&lt;br /&gt;
&lt;br /&gt;
==Alternative methods and hardware specs==&lt;br /&gt;
&lt;br /&gt;
See [[How to control fan speed]].&lt;br /&gt;
&lt;br /&gt;
==Supported models==&lt;br /&gt;
&lt;br /&gt;
See [[How to control fan speed]].&lt;br /&gt;
&lt;br /&gt;
[[Category:Patches]]&lt;/div&gt;</summary>
		<author><name>Dimeco</name></author>
		
	</entry>
	<entry>
		<id>https://www.thinkwiki.org/w/index.php?title=Talk:Code/ibm-acpi-0.11-2.6.17-fan.patch&amp;diff=24316</id>
		<title>Talk:Code/ibm-acpi-0.11-2.6.17-fan.patch</title>
		<link rel="alternate" type="text/html" href="https://www.thinkwiki.org/w/index.php?title=Talk:Code/ibm-acpi-0.11-2.6.17-fan.patch&amp;diff=24316"/>
		<updated>2006-08-22T11:29:39Z</updated>

		<summary type="html">&lt;p&gt;Dimeco: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{CodeHeader|&lt;br /&gt;
|filename=ibm-acpi-0.11-2.6.17-fan.patch&lt;br /&gt;
|context=[[Patch for controlling fan speed]]&lt;br /&gt;
|author=[[User:dimeco|dimeco]]&lt;br /&gt;
|license=GPL v2 or higher, or GFDL v1.2 or higher&lt;br /&gt;
}}&lt;/div&gt;</summary>
		<author><name>Dimeco</name></author>
		
	</entry>
	<entry>
		<id>https://www.thinkwiki.org/w/index.php?title=Talk:Code/ibm-acpi-0.11-2.6.17-fan.patch&amp;diff=24315</id>
		<title>Talk:Code/ibm-acpi-0.11-2.6.17-fan.patch</title>
		<link rel="alternate" type="text/html" href="https://www.thinkwiki.org/w/index.php?title=Talk:Code/ibm-acpi-0.11-2.6.17-fan.patch&amp;diff=24315"/>
		<updated>2006-08-22T11:27:46Z</updated>

		<summary type="html">&lt;p&gt;Dimeco: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Dimeco</name></author>
		
	</entry>
	<entry>
		<id>https://www.thinkwiki.org/w/index.php?title=Talk:Code/ibm-acpi-0.11-2.6.17-fan.patch&amp;diff=24314</id>
		<title>Talk:Code/ibm-acpi-0.11-2.6.17-fan.patch</title>
		<link rel="alternate" type="text/html" href="https://www.thinkwiki.org/w/index.php?title=Talk:Code/ibm-acpi-0.11-2.6.17-fan.patch&amp;diff=24314"/>
		<updated>2006-08-22T11:27:07Z</updated>

		<summary type="html">&lt;p&gt;Dimeco: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;--- drivers/acpi/ibm_acpi.c.orig        2006-08-22 19:04:43.000000000 +0900&lt;br /&gt;
+++ drivers/acpi/ibm_acpi.c     2006-08-22 19:10:28.000000000 +0900&lt;br /&gt;
@@ -1466,6 +1466,7 @@&lt;br /&gt;
 {&lt;br /&gt;
        int len = 0;&lt;br /&gt;
        int s;&lt;br /&gt;
+       char status_read = 0;&lt;br /&gt;
        u8 lo, hi, status;&lt;br /&gt;
&lt;br /&gt;
        if (gfan_handle) {&lt;br /&gt;
@@ -1479,8 +1480,11 @@&lt;br /&gt;
                if (!acpi_ec_read(fan_status_offset, &amp;amp;status))&lt;br /&gt;
                        len += sprintf(p + len, &amp;quot;status:\t\tunreadable\n&amp;quot;);&lt;br /&gt;
                else&lt;br /&gt;
+               {&lt;br /&gt;
                        len += sprintf(p + len, &amp;quot;status:\t\t%s\n&amp;quot;,&lt;br /&gt;
-                                      enabled(status, 7));&lt;br /&gt;
+                                       status ? &amp;quot;enabled&amp;quot; : &amp;quot;disabled&amp;quot; );&lt;br /&gt;
+                       status_read = 1;&lt;br /&gt;
+               }&lt;br /&gt;
&lt;br /&gt;
                if (!acpi_ec_read(fan_rpm_offset, &amp;amp;lo) ||&lt;br /&gt;
                    !acpi_ec_read(fan_rpm_offset + 1, &amp;amp;hi))&lt;br /&gt;
@@ -1488,6 +1492,16 @@&lt;br /&gt;
                else&lt;br /&gt;
                        len += sprintf(p + len, &amp;quot;speed:\t\t%d\n&amp;quot;,&lt;br /&gt;
                                       (hi &amp;lt;&amp;lt; 8) + lo);&lt;br /&gt;
+&lt;br /&gt;
+               if (status_read) {&lt;br /&gt;
+                       if (status &amp;amp; 0x40)&lt;br /&gt;
+                               len += sprintf(p + len, &amp;quot;level:\t\tdisengaged\n&amp;quot;);&lt;br /&gt;
+                       else if (status &amp;amp; 0x80)&lt;br /&gt;
+                               len += sprintf(p + len, &amp;quot;level:\t\tauto\n&amp;quot;);&lt;br /&gt;
+                       else&lt;br /&gt;
+                               len += sprintf(p + len, &amp;quot;level:\t\t%d\n&amp;quot;, status);&lt;br /&gt;
+               }&lt;br /&gt;
+&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        if (sfan_handle)&lt;br /&gt;
@@ -1496,7 +1510,10 @@&lt;br /&gt;
                               &amp;quot; (&amp;lt;level&amp;gt; is 0-7)\n&amp;quot;);&lt;br /&gt;
        if (!gfan_handle)&lt;br /&gt;
                /* all except 570, 600e/x, 770e, 770x */&lt;br /&gt;
-               len += sprintf(p + len, &amp;quot;commands:\tenable, disable\n&amp;quot;);&lt;br /&gt;
+                len += sprintf(p + len, &lt;br /&gt;
+                             &amp;quot;commands:\tenable, disable, level &amp;lt;level&amp;gt;\n&amp;quot;&lt;br /&gt;
+                             &amp;quot;         \t(&amp;lt;level&amp;gt; is 0-7, auto &amp;quot;&lt;br /&gt;
+                             &amp;quot;or disengaged)\n&amp;quot;);&lt;br /&gt;
        if (fans_handle)&lt;br /&gt;
                /* X31, X40 */&lt;br /&gt;
                len += sprintf(p + len, &amp;quot;commands:\tspeed &amp;lt;speed&amp;gt;&amp;quot;&lt;br /&gt;
@@ -1517,7 +1534,8 @@&lt;br /&gt;
                        /* 570, 770x-JL */&lt;br /&gt;
                        if (!acpi_evalf(sfan_handle, NULL, NULL, &amp;quot;vd&amp;quot;, level))&lt;br /&gt;
                                return -EIO;&lt;br /&gt;
-               } else if (!gfan_handle &amp;amp;&amp;amp; strlencmp(cmd, &amp;quot;enable&amp;quot;) == 0) {&lt;br /&gt;
+               } else if (!gfan_handle &amp;amp;&amp;amp; ( (strlencmp(cmd, &amp;quot;enable&amp;quot;) == 0) || &lt;br /&gt;
+                               (strlencmp(cmd, &amp;quot;level auto&amp;quot;) == 0) ) ) {&lt;br /&gt;
                        /* all except 570, 600e/x, 770e, 770x */&lt;br /&gt;
                        if (!acpi_ec_write(fan_status_offset, 0x80))&lt;br /&gt;
                                return -EIO;&lt;br /&gt;
@@ -1525,6 +1543,17 @@&lt;br /&gt;
                        /* all except 570, 600e/x, 770e, 770x */&lt;br /&gt;
                        if (!acpi_ec_write(fan_status_offset, 0x00))&lt;br /&gt;
                                return -EIO;&lt;br /&gt;
+                } else if (!gfan_handle &amp;amp;&amp;amp;&lt;br /&gt;
+                          strlencmp(cmd, &amp;quot;level disengaged&amp;quot;) == 0) {&lt;br /&gt;
+                       /* all except 570, 600e/x, 770e, 770x */&lt;br /&gt;
+                       if (!acpi_ec_write(fan_status_offset, 0x40))&lt;br /&gt;
+                               return -EIO;&lt;br /&gt;
+               } else if (!gfan_handle &amp;amp;&amp;amp;&lt;br /&gt;
+                   sscanf(cmd, &amp;quot;level %d&amp;quot;, &amp;amp;level) == 1 &amp;amp;&amp;amp;&lt;br /&gt;
+                   level &amp;gt;=0 &amp;amp;&amp;amp; level &amp;lt;= 7) {&lt;br /&gt;
+                       /* all except 570, 600e/x, 770e, 770x */&lt;br /&gt;
+                       if (!acpi_ec_write(fan_status_offset, level))&lt;br /&gt;
+                               return -EIO;&lt;br /&gt;
                } else if (fans_handle &amp;amp;&amp;amp;&lt;br /&gt;
                           sscanf(cmd, &amp;quot;speed %d&amp;quot;, &amp;amp;speed) == 1 &amp;amp;&amp;amp;&lt;br /&gt;
                           speed &amp;gt;= 0 &amp;amp;&amp;amp; speed &amp;lt;= 65535) {&lt;/div&gt;</summary>
		<author><name>Dimeco</name></author>
		
	</entry>
</feed>