mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] therm_adt746x: smooth fan
@ 2005-01-26  8:12 Jorge Bernal
  2005-01-26 13:03 ` Colin Leroy
  0 siblings, 1 reply; 3+ messages in thread
From: Jorge Bernal @ 2005-01-26  8:12 UTC (permalink / raw)
  To: linux-kernel

Hi all!

This patchs allows a smoother fan speed switching with therm_adt746x. Instead 
of setting 0 or 128, it scales speed according to temperature.

It would be even better if I'd have more precise temp data, but I'm not sure 
if it's even supported by the chip.

--- linux-source-2.6.9.orig/drivers/macintosh/therm_adt746x.c 2005-01-26 02:50:31.941528728 +0100
+++ linux-source-2.6.9/drivers/macintosh/therm_adt746x.c 2005-01-26 03:10:36.925343344 +0100
@@ -272,7 +272,10 @@
       printk(KERN_INFO "adt746x: Limit exceeded by %d, setting speed to specified for %s.\n",
        var, fan_number?"GPU":"CPU");     
      th->overriding[fan_number] = 0;
-     write_fan_speed(th, fan_speed, fan_number);
+     if ((var > 2) && (var < 8))
+      write_fan_speed(th, (int)(fan_speed * var / 6), fan_number);
+     else
+      write_fan_speed(th, fan_speed, fan_number);
      started = 1;
     } else if (var < -1) {
      /

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2005-01-26 13:45 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-01-26  8:12 [PATCH] therm_adt746x: smooth fan Jorge Bernal
2005-01-26 13:03 ` Colin Leroy
2005-01-26 13:44   ` Jorge Bernal

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®