2005-01-26 08:13:16

by Jorge Bernal

[permalink] [raw]
Subject: [PATCH] therm_adt746x: smooth fan

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) {
/


2005-01-26 13:03:58

by Colin Leroy

[permalink] [raw]
Subject: Re: [PATCH] therm_adt746x: smooth fan

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

Thanks, but you'd have saved some of your time if you had checked
2.6.10: I implemented such a system, it's in since 2.6.10 :)

> 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.

It's not possible, iirc.

Also, it's better to Cc: the maintainer of a module when submitting
patches. I'm not subscribed to lkml currently, and would have missed
your mail if I didn't get it from a friend.
--
Colin

2005-01-26 13:45:13

by Jorge Bernal

[permalink] [raw]
Subject: Re: [PATCH] therm_adt746x: smooth fan

El Mi?rcoles 26 Enero 2005 14:03, Colin Leroy escribi?:
> > This patchs allows a smoother fan speed switching with therm_adt746x.
> > Instead of setting 0 or 128, it scales speed according to temperature.
>
> Thanks, but you'd have saved some of your time if you had checked
> 2.6.10: I implemented such a system, it's in since 2.6.10 :)
>

doh! no problem at all, it didn't took me much time.

I guess I'll try in 2.6.11, since hibernation does not work very well with
2.6.10 in my ibook.

> > 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.
>
> It's not possible, iirc.
>
> Also, it's better to Cc: the maintainer of a module when submitting
> patches. I'm not subscribed to lkml currently, and would have missed
> your mail if I didn't get it from a friend.

I'll note for the next time, thanks :)

--
Jorge Bernal "Koke"
Personal: [email protected]
Jabber: [email protected]
Blog: http://www.amedias.org/koke/

"Computer Science is no more about computers than astronomy is about
telescopes." - Edsger Dijkstra