[ltp] [PATCH] ibm_acpi - Allow fan to be set to full speed

Leon Brokken linux-thinkpad@linux-thinkpad.org
Mon, 22 Aug 2005 11:32:28 +0300


This is a multi-part message in MIME format.

--Boundary_(ID_8D8LvUfABEyJG4Ny0HonUg)
Content-type: text/plain; charset=ISO-8859-1
Content-transfer-encoding: 8BIT

Patch works on my T41.

However, the ibm_manage_fan script doesn't work anymore (ibm_manage_fan
script disables the fan when CPU temp is below a certain value). Anyone
else noticed this behaviour?

bash-bash-3.00# cat /proc/acpi/ibm/fan
status:         enabled
speed:          3581
commands:       enable, disable, full-speed
bash-3.00# echo full-speed > /proc/acpi/ibm/fan
bash-3.00# cat /proc/acpi/ibm/fan              
status:         disabled
speed:          4986
commands:       enable, disable, full-speed

Cheers, Leon.


Thomas Renninger wrote:

>echo full-speed >/proc/acpi/ibm/fan
>sets the speed to max for most Thinkpads.
>
>      Thomas
>  
>
>------------------------------------------------------------------------
>
>--- drivers/acpi/ibm_acpi.c.orig	2005-08-20 19:42:16.000000000 -0600
>+++ drivers/acpi/ibm_acpi.c	2005-08-20 19:42:48.000000000 -0600
>@@ -1507,7 +1507,7 @@
> 			       " (<level> is 0-7)\n");
> 	if (!gfan_handle)
> 		/* all except 570, 600e/x, 770e, 770x */
>-		len += sprintf(p + len, "commands:\tenable, disable\n");
>+		len += sprintf(p + len, "commands:\tenable, disable, full-speed\n");
> 	if (fans_handle)
> 		/* X31, X40 */
> 		len += sprintf(p + len, "commands:\tspeed <speed>"
>@@ -1538,6 +1538,11 @@
> 			/* all except 570, 600e/x, 770e, 770x */
> 			if (!acpi_ec_write(fan_status_offset, 0x00))
> 				return -EIO;
>+		} else if (!gfan_handle &&
>+			   strlencmp(cmd, "full-speed") == 0) {
>+			/* all except 570, 600e/x, 770e, 770x */
>+			if (!acpi_ec_write(fan_status_offset, 0x50))
>+				return -EIO;
> 		} else if (fans_handle &&
> 		    sscanf(cmd, "speed %d", &speed) == 1 &&
> 		    speed >= 0 && speed <= 65535) {
>  
>

-- 
Leon J.S. Brokken
Dept. of Anatomy, Inst. of Biomedicine, University of Turku
Tykistökatu 6 A, 20520 Turku, Finland
Tel. +358(0)405845063, Fax +358(0)22502610
--
GnuPG: 0x3C0E8DAE | 1EE8 511D A6D3 9F9C 2F43 EB6E 8387 B051 3C0E 8DAE
--


--Boundary_(ID_8D8LvUfABEyJG4Ny0HonUg)
Content-type: text/html; charset=ISO-8859-1
Content-transfer-encoding: 7BIT

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
  <title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
Patch works on my T41.<br>
<br>
However, the ibm_manage_fan script doesn't work anymore (ibm_manage_fan
script disables the fan when CPU temp is below a certain value). Anyone
else noticed this behaviour?<br>
<br>
bash-bash-3.00# cat /proc/acpi/ibm/fan <br>
status:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; enabled<br>
speed:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 3581<br>
commands:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; enable, disable, full-speed<br>
bash-3.00# echo full-speed &gt; /proc/acpi/ibm/fan <br>
bash-3.00# cat /proc/acpi/ibm/fan&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br>
status:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; disabled<br>
speed:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 4986<br>
commands:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; enable, disable, full-speed<br>
<br>
Cheers, Leon.<br>
<br>
<br>
Thomas Renninger wrote:
<blockquote cite="mid43080397.9010106@gmx.net" type="cite">
  <pre wrap="">echo full-speed &gt;/proc/acpi/ibm/fan
sets the speed to max for most Thinkpads.

      Thomas
  </pre>
  <pre wrap="">
<hr size="4" width="90%">
--- drivers/acpi/ibm_acpi.c.orig	2005-08-20 19:42:16.000000000 -0600
+++ drivers/acpi/ibm_acpi.c	2005-08-20 19:42:48.000000000 -0600
@@ -1507,7 +1507,7 @@
 			       " (&lt;level&gt; is 0-7)\n");
 	if (!gfan_handle)
 		/* all except 570, 600e/x, 770e, 770x */
-		len += sprintf(p + len, "commands:\tenable, disable\n");
+		len += sprintf(p + len, "commands:\tenable, disable, full-speed\n");
 	if (fans_handle)
 		/* X31, X40 */
 		len += sprintf(p + len, "commands:\tspeed &lt;speed&gt;"
@@ -1538,6 +1538,11 @@
 			/* all except 570, 600e/x, 770e, 770x */
 			if (!acpi_ec_write(fan_status_offset, 0x00))
 				return -EIO;
+		} else if (!gfan_handle &amp;&amp;
+			   strlencmp(cmd, "full-speed") == 0) {
+			/* all except 570, 600e/x, 770e, 770x */
+			if (!acpi_ec_write(fan_status_offset, 0x50))
+				return -EIO;
 		} else if (fans_handle &amp;&amp;
 		    sscanf(cmd, "speed %d", &amp;speed) == 1 &amp;&amp;
 		    speed &gt;= 0 &amp;&amp; speed &lt;= 65535) {
  </pre>
</blockquote>
<br>
<pre class="moz-signature" cols="72">-- 
Leon J.S. Brokken
Dept. of Anatomy, Inst. of Biomedicine, University of Turku
Tykist&ouml;katu 6 A, 20520 Turku, Finland
Tel. +358(0)405845063, Fax +358(0)22502610
--
GnuPG: 0x3C0E8DAE | 1EE8 511D A6D3 9F9C 2F43 EB6E 8387 B051 3C0E 8DAE
--
</pre>
</body>
</html>

--Boundary_(ID_8D8LvUfABEyJG4Ny0HonUg)--