Messages in this thread Patch in this message |  | | | From | Jorge Bernal <> | | Subject | [PATCH] therm_adt746x: smooth fan | | Date | Wed, 26 Jan 2005 09:12:26 +0100 |
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) { / - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
|  |