Page 1 of 1

Controlling fan under OSX : Is that possible?

Posted: Mon Oct 11, 2010 8:29 pm
by JKK
Everything's in the title! That's something really annoying, the fan sometimes starts running at full speed and then won't stop until you restart the unit!

I tested the apps designed for Macbooks and of course they didn't work... Chance are low to find a thing i know, but who knows... Someone maybe did?!

I've read (here i think) someone recommending to use BIOS settings to control that (a little) but i've seen nothing in each BIOS sections, did i miss something..?

Re: Controlling fan under OSX : Is that possible?

Posted: Sun Nov 21, 2010 7:27 am
by Silencer
JKK wrote:Everything's in the title! That's something really annoying, the fan sometimes starts running at full speed and then won't stop until you restart the unit!

I tested the apps designed for Macbooks and of course they didn't work... Chance are low to find a thing i know, but who knows... Someone maybe did?!

I've read (here i think) someone recommending to use BIOS settings to control that (a little) but i've seen nothing in each BIOS sections, did i miss something..?
If you are not too lazy to dig deeper, check this link http://www.projectosx.com/forum/index.p ... topic=1206
The idea is to have patched DSDT and some plugins for FakeSMC which will allow OSX to "talk" to your fan.

Re: Controlling fan under OSX : Is that possible?

Posted: Mon Nov 22, 2010 8:01 am
by Sebinouse
Silencer wrote:I'm not sure 100%, but from what I found on ThinkWiki, I have PC87382 Super I/O chip. In DSDT I have the following device
I have the same conclusions : LPC bus (PC87382 Super I/O, Atmel® 97SC3203 TPM)

Sources: So we have a "Winbond" PC87382 I/O Chip ...

As far as I know the FakeSMCSuperIO plug-in in the "new" FakeSMC only support :

Code: Select all

Winbond W83627DHG
Winbond W83627DHG-P
Winbond W83627EHF
Winbond W83627HF
Winbond W83627THF
Winbond W83667HG
Winbond W83667HG-B
Winbond W83687THF
Source

Hence we can't use it ... we have to use FakeSMCACPImonitor plug-in with custom DSDT edit like this one :

Code: Select all

Method (SMC0, 0, NotSerialized)
                    {
                        Store (FAN1, Local0)
                        Return (Local0)
                    }
With this legend:

Code: Select all

// Fan Keys:
SMC0 = F0ID "System Fan"
SMC1 = F1ID "Processor Fan"
...
// Temperature Keys:
SMCA = TC0H "CPU Heatsink"
SMCB = TN0H "MCP/MCH/Northbridge Heatsink"
SMCC = TW0P "AUX Sensor"
...
But I don't were in DSDT we have to add it ... after this ?

Code: Select all

Device (SIO)
                {
                    Name (_HID, EisaId ("PNP0C02"))
or after this ?

Code: Select all

Device (EC)
                {
                    Name (_HID, EisaId ("PNP0C09"))
in both cases I've got compiling errors:

Code: Select all

Store (FAN1, Local0)
Error    4064 -                                                         Object does not exist
I think I have do declare is object ... but where and how ?

Thanks for your help ...

Re: Controlling fan under OSX : Is that possible?

Posted: Mon Nov 22, 2010 8:18 am
by Silencer
Sebinouse wrote: I think I have do declare is object ... but where and how ?
Well, you will get a compilation error, since FAN1 is not declared. And even if you declare it like that, it won't give you anything, since it will not contain any meaningful values.

What you can do is to try to use already declared EC register that contains fan rotation speed value - HFNI. I believe a universal piece of code (i.e. working in any other block) would look like that:

Code: Select all

Method (SMC0, 0, NotSerialized)
                    {
                        Store (\_SB.PCI0.LPC.EC.HFNI, Local0)
                        Return (Local0)
                    }
You can safely put it under both EC and SI0, it will not break anything.

Re: Controlling fan under OSX : Is that possible?

Posted: Mon Nov 22, 2010 8:29 am
by Silencer
BTW, that Super I/O support is only first step - it will only give you readings of the current fan rotation speed, but you can't control it with HFNI register.

There's another register - HFSP, which controls the speed of the fan, and it takes values from 0 to 7 to set the speed of the fan to some predefined values depending on the ThinkPad model you have. More information can be found here.

Technically you don't even need to know the reading of the current fan speed, you can simply set the fan speed depending on the current CPU temperature, which is available. I think for someone who knows how it would be very-very simple to write a driver or a small utility which would check CPU temperature every 10 or so seconds and then update named register depending on set thresholds.

In my DSDT I have the following code defined for the blue ThinkPad button:

Code: Select all

   
     Scope (PCI0.LPC.EC)
        {
            Method (_Q19, 0, NotSerialized)
            {
                Name (FANS, One)
                Store (HFSP, FANS)
                XOr (FANS, Zero, Local0)
                If (Local0)
                {
                    LED (0xFF, 0x80)
                    Store (Zero, HFSP)
                }
                Else
                {
                    LED (0xFF, 0x80)
                    Store (0x80, HFSP)
                }
            }
        }
When I press ThinkPad the fan switches off if it was on and it switches on if it was off. The code can be modified to have it gradually increase the speed from 1 to 7, but that would require you to manually check your CPU temperature all the time. Not the best solution.

Re: Controlling fan under OSX : Is that possible?

Posted: Mon Nov 22, 2010 10:43 am
by Sebinouse
Silencer wrote:

Code: Select all

Method (SMC0, 0, NotSerialized)
                    {
                        Store (\_SB.PCI0.LPC.EC.HFNI, [color=#FF0000]Local0[/color])
                        Return (Local0)
                    }
So I edited my DSDT (no compiling error), I installed FakeSMC in /S/L/E (without Radeon, Nv and X3100 plugin), and then rebooted ...

As expected I/O chip is recognized as "Unsupported" by FakeSMCSuperIO , but I can't get FakeSMCACPIMonitor plugin to load ... Every other plugin loads ... but not this one ...

I also played with your "Method (_Q19, 0, NotSerialized)" and it worked fine for me ... it is still an alternative ...

So I am back with regular FakeSMC for the moment (I've got CPU temps) ...

I'm curious : How did you find out the signification of the ACPI names (HFNI, HFSP ... ) ? I only found HFSP and a short reference to 0x84 on Thinkwiki )

Re: Controlling fan under OSX : Is that possible?

Posted: Mon Nov 22, 2010 1:17 pm
by Silencer
Sebinouse wrote: I'm curious : How did you find out the signification of the ACPI names (HFNI, HFSP ... ) ? I only found HFSP and a short reference to 0x84 on Thinkwiki )
Well, if you at the following code under (EC) device:

Code: Select all

 OperationRegion (ECOR, EmbeddedControl, Zero, 0x0100)
                    Field (ECOR, ByteAcc, NoLock, Preserve)
                    {
                        HDBM,   1, 
                            ,   1, 
                            ,   1, 
                        HFNE,   1, 
                            ,   1, 
                            ,   1, 
                        [skipped]
                        HIID,   8, 
                                Offset (0x83), 
                        HFNI,   8, 
                                Offset (0x88), 
                        HDEC,   8, 
Right after empty address 0x83 goes HFNI, which starts at 0x84, and that is exactly what we need. And register HFSP is explained on the page on ThinkWiki which I linked before.

Re: Controlling fan under OSX : Is that possible?

Posted: Tue Nov 23, 2010 1:57 am
by Anastasius
Hello! that's an interesting solution for the fan!
But how can I bind this code to the ThinkPad blue button?

Thanks :idea:


Edit: Oh, silly me! Just changed the right part of DSDT and now it's working :)
It will be cool, of course to have it set dynamically. There's an amazing tool for ThinkPads for Windows called tpFanControl - that does this job amazingly for Windows, keeping the fan stopped most of the time and starting it when the temperature rises

Re: Controlling fan under OSX : Is that possible?

Posted: Tue Nov 23, 2010 6:07 am
by Silencer
Anastasius wrote:It will be cool, of course to have it set dynamically. There's an amazing tool for ThinkPads for Windows called tpFanControl - that does this job amazingly for Windows, keeping the fan stopped most of the time and starting it when the temperature rises
Yep, I was thinking exactly about that tool. Again, technically there should be no problems creating something similar for OSX knowing all the right ACPI registers.

Re: Controlling fan under OSX : Is that possible?

Posted: Tue Nov 23, 2010 7:54 am
by Sebinouse
Documentation about Thinkpads ACPI can be found here (seems to be very precise !) :
http://www.linuxhq.com/kernel/v2.6/21-g ... ibm_acpi.c

http://repo.or.cz/w/linux-2.6/linux-acp ... ase/2.6.29 (line 1251)

The more I read about this, the more I also think AdidasPrince would be the one able to do this (it's VERY close to his mod about Fn Keys !)

Re: Controlling fan under OSX : Is that possible?

Posted: Mon Dec 20, 2010 7:44 pm
by Sebinouse
I have been able to monitor CPU Heatsink Temperature, Northbridge Temperature, and HFSP !

I used this DSDT edit :

Code: Select all

				Device (SMCD) // System Monitor and Controll Device
       			{
            		Name (_HID, "monitor") // Driver will look for this in order to load or not
            		Method (FSN0, 0, NotSerialized) // ACPIMonitor FAN 0 Speed
            		{
                		Store (\_SB.PCI0.LPC.EC.HFNI, Local0) // Store FAN 0 Tachometter to Local0
                		Return (Local0)
            		}

            		Method (TCPH, 0, NotSerialized) // ACPIMonitor CPU Heatsink Temperature
            		{
                		Store (\_SB.PCI0.LPC.EC.TMP0, Local0)
                		Return (Local0)
            		}
            		Method (TSYS, 0, NotSerialized) // ACPIMonitor Northbridge Temperature
            		{
                		Store (\_SB.PCI0.LPC.EC.TMP4, Local0)
                		Return (Local0)
            		}
        		}
        		
                Device (EC)
And the latest version (Rev 440) of FakeSMC.kext and ACPIMonitor.kext (both in /E/E) : http://www.projectosx.com/forum/index.p ... topic=1593

I am not able to read HFNI ... I found this here :

Code: Select all

- *   ThinkPad EC register 0x84 (LSB), 0x85 (MSB):
- *   Main fan tachometer reading (in RPM)
- *   ...
- *   FIRMWARE BUG: always read 0x84 first, otherwise incorrect readings
- *   might result.
Do you have any idea how to do so ?

Re: Controlling fan under OSX : Is that possible?

Posted: Tue Dec 21, 2010 3:33 am
by Silencer
Sebinouse wrote:I have been able to monitor CPU Heatsink Temperature, Northbridge Temperature, and HFSP !
Great! I will give it a try this evening and will check HFNI.

Re: Controlling fan under OSX : Is that possible?

Posted: Tue Dec 21, 2010 7:31 am
by Sebinouse
In the latest rev (>440) FSN0 becomes FAN0 and TCPH becomes TCPU ...

Rev 440 Compiles without any errors

Code: Select all

svn co http://subversion.assembla.com/svn/fakesmc/HWSensors -r 440
Rev 449 Compiles with errors in nVClock and Radeon (not important)

Code: Select all

svn co http://subversion.assembla.com/svn/fakesmc/HWSensors

Re: Controlling fan under OSX : Is that possible?

Posted: Tue Dec 21, 2010 11:55 am
by Sebinouse
And ... Fan Control works properly !!! :D (I guess iStat is mandatory)

Code: Select all

		Device (SMCD) // System Monitor and Controll Device
       		{
            		Name (_HID, "monitor") // Driver will look for this in order to load or not
            		Method (FAN0, 0, NotSerialized) // ACPIMonitor FAN 0 Speed
            		{
                		Store (\_SB.PCI0.LPC.EC.HFSP, Local0) // Store FAN 0 Control to Local0
                		Return (Local0)
            		}
            		Method (TSYS, 0, NotSerialized) // ACPIMonitor Northbridge Temperature
            		{
                		Store (\_SB.PCI0.LPC.EC.TMP4, Local0)
                		Return (Local0)
            		}
            		Method (TAMB, 0, NotSerialized) // ACPIMonitor Ambient Temperature
            		{
                		Store (\_SB.PCI0.LPC.EC.TMP5, Local0)
                		Return (Local0)
            		}
            		Method (TCPU, 0, NotSerialized) // Fan Mode Accordind CPU Heatsink Temperature
            		{
                		Store (\_SB.PCI0.LPC.EC.TMP0, Local0)
                		If (LLessEqual (Local0, 0x32))  // CPU Temp is <= 50°C
                		{
                    		Store (Zero, \_SB.PCI0.LPC.EC.HFSP) // Set FAN Off
                		}
                		Else
                		{
                    		Store (0x80, \_SB.PCI0.LPC.EC.HFSP) // Set FAN Auto
                		}
                		Return (Local0)
            		}
		}
Now we just have to figure out how to read fan rpm !

Re: Controlling fan under OSX : Is that possible?

Posted: Tue Dec 21, 2010 3:09 pm
by Silencer
Sebinouse wrote:And ... Fan Control works properly !!! :D (I guess iStat is mandatory)
You are genius! It does work! iStat is probably mandatory, because the controlling method is only called when iStat measures temperature.

I've modified slightly the controlling method:

Code: Select all

Method (TCPU, 0, NotSerialized) // Fan Mode Accordind CPU Heatsink Temperature
{
	Store (\_SB.PCI0.LPC.EC.TMP0, Local0)
	If (LLessEqual (Local0, 0x32))  // CPU Temp is <= 50C
	{
		Store (Zero, \_SB.PCI0.LPC.EC.HFSP) // Set FAN Off
	}
	If (LGreaterEqual (Local0, 0x55)) // CPU Temp is >= 85C
	{
		Store (0x40, \_SB.PCI0.LPC.EC.HFSP) // Set FAN Mode Disengaged - Total Maximum
	}
	Else {
		If (LGreaterEqual (Local0, 0x4B)) // CPU Temp is >= 75C
		{
			Store (0x07, \_SB.PCI0.LPC.EC.HFSP) // Set FAN Mode 7 - Maximum Speed
		}
		Else {
			If (LGreaterEqual (Local0, 0x46)) // CPU Temp is >= 70C
			{
				Store (0x04, \_SB.PCI0.LPC.EC.HFSP) // Set FAN Mode 4 - Medium Speed 
			}
			Else {
				If (LGreaterEqual (Local0, 0x41)) // CPU Temp is >= 65C
				{
					Store (0x02, \_SB.PCI0.LPC.EC.HFSP) // Set FAN Mode 2
				} 
				Else {
					If (LGreaterEqual (Local0, 0x3D)) // CPU Temp is >= 61C
					{
						Store (0x01, \_SB.PCI0.LPC.EC.HFSP) // Set FAN Mode 1 - Lowest Speed
					}
				}
			}
		}
	}
	Return (Local0)
}
First of all it reduces fan pulsing when it goes on and off constantly jumping around one temperature measuring. Now it will switch off only when CPU temperature is less than 50, but will switch on when it's more than 60. That way you will spend 10 degrees in silence :)

Another part is that AUTO mode doesn't actually work in OSX, it will always use medium speed, you can test it with CPUTest (CPU loading utility). In the method above the speed is changed gradually.

It also seems that Northbridge temperature is not measured correctly, it looks to be showing HDD temperature there. We can also check other TMPx values (TMP0-TMP7). For example, TMP3 is GPU. Need to know the names of other temperature measuring methods for GPU, battery, chassis, etc, but for that the source code of ACPIMonitor needs to be modified
Sebinouse wrote:Now we just have to figure out how to read fan rpm !
Yep, that would be interesting to play with. I think ACPIMonitor is waiting for other format of data than it is written in HFNI.

Re: Controlling fan under OSX : Is that possible?

Posted: Tue Dec 21, 2010 4:50 pm
by Silencer
I got the fan rpm reading working! I also enabled four different temperature sensors in iStat, your example only gives me two.

So, to get rpm reading working first you need to add the code below to the Device (EC), right after the big block Field (ECOR, ByteAcc, NoLock, Preserve).

Code: Select all

// Fan Speed reading in rpm
Field (ECOR, ByteAcc, NoLock, Preserve)
{
    Offset (0x84), 
    HFN1,   16 
}
Then modify FAN0 to read that value. The full Device (SMCD) in my case looks like that:

Code: Select all

      Device (SMCD) // System Monitor and Controll Device
             {
                  Name (_HID, "monitor") // Driver will look for this in order to load or not
                  Method (FAN0, 0, NotSerialized) // ACPIMonitor FAN 0 Speed
                  {
                      Store (\_SB.PCI0.LPC.EC.HFN1, Local0) // Store FAN 0 Control to Local0
                      Return (Local0)
                  }
                  Method (TSYS, 0, NotSerialized) // ACPIMonitor - GPU Temperature as Northbridge (T60p)
                  {
                      Store (\_SB.PCI0.LPC.EC.TMP3, Local0)
                      Return (Local0)
                  }
                  Method (TAMB, 0, NotSerialized) // ACPIMonitor - Temperature
                  {
                      Store (\_SB.PCI0.LPC.EC.TMP2, Local0)
                      Return (Local0)
                  }
                  Method (TDIM, 0, NotSerialized) // ACPIMonitor - Most Probably Battery Temperature as Memory Controller (T60p)
                  {
                      Store (\_SB.PCI0.LPC.EC.TMP6, Local0)
                      Return (Local0)
                  }
					Method (TCPU, 0, NotSerialized) // Fan Mode Accordind CPU Heatsink Temperature
					{
						Store (\_SB.PCI0.LPC.EC.TMP0, Local0)
						If (LLessEqual (Local0, 0x32))  // CPU Temp is <= 50C
						{
							Store (Zero, \_SB.PCI0.LPC.EC.HFSP) // Set FAN Off
						}
						If (LGreaterEqual (Local0, 0x55)) // CPU Temp is >= 85C
						{
							Store (0x40, \_SB.PCI0.LPC.EC.HFSP) // Set FAN Mode Disengaged - Absolute Maximum
						}
						Else {
							If (LGreaterEqual (Local0, 0x4B)) // CPU Temp is >= 75C
							{
								Store (0x07, \_SB.PCI0.LPC.EC.HFSP) // Set FAN Mode 7 - Maximum Speed
							}
							Else {
								If (LGreaterEqual (Local0, 0x46)) // CPU Temp is >= 70C
								{
									Store (0x04, \_SB.PCI0.LPC.EC.HFSP) // Set FAN Mode 4 - Medium Speed 
								}
								Else {
									If (LGreaterEqual (Local0, 0x41)) // CPU Temp is >= 65C
									{
										Store (0x02, \_SB.PCI0.LPC.EC.HFSP) // Set FAN Mode 2
									} 
									Else {
										If (LGreaterEqual (Local0, 0x3D)) // CPU Temp is >= 61C
										{
											Store (0x01, \_SB.PCI0.LPC.EC.HFSP) // Set FAN Mode 1 - Lowest Speed
										}
									}
								}
							}
						}
						Return (Local0)
					}
      }
I think TMPx sensors except TMP0 and TMP1 (two CPU cores) can differ from system to system in their meaning. Or not, really don't know for sure. In my DSDT I have 8 TMPx registers defined (TMP0-TMP7), so if you have more or less, you can experiment there. It is also possible to modify ACPIMonitor to include GPU sensor definition, but I'm too lazy for that, reading it as Northbridge suits me just fine.

Re: Controlling fan under OSX : Is that possible?

Posted: Tue Dec 21, 2010 5:34 pm
by Sebinouse
Silencer wrote:I got the fan rpm reading working! I also enabled four different temperature sensors in iStat, your example only gives me two.

So, to get rpm reading working first you need to add the code below to the Device (EC), right after the big block Field (ECOR, ByteAcc, NoLock, Preserve).

Code: Select all

// Fan Speed reading in rpm
Field (ECOR, ByteAcc, NoLock, Preserve)
{
    Offset (0x84), 
    HFN1,   16 
}
Amazing ... :eek: ... I've been looking foe this DSDT trick for 24 long hours ! ... Thanks !
Silencer wrote:I think TMPx sensors except TMP0 and TMP1 (two CPU cores) can differ from system to system in their meaning. Or not, really don't know for sure. In my DSDT I have 8 TMPx registers defined (TMP0-TMP7), so if you have more or less, you can experiment there. It is also possible to modify ACPIMonitor to include GPU sensor definition, but I'm too lazy for that, reading it as Northbridge suits me just fine.
I used this page to map the thermal sensors : http://forum.thinkpads.com/viewtopic.php?t=31837 ( and this has been posted also in thinkwiki : http://www.thinkwiki.org/wiki/Thermal_sensors )

Code: Select all

Label     Address     Typical Temp        Notes
CPU        0x78         36-40      CPU for sure
BAT1a      0x79         32         Battery (main) - heats up when laptop on battery power, cool when AC
PWR        0x7a         40-46      Power diodes   - sensor left of CPU, top side
BAT2a      0x7b                    (probably) Ultrabay 2000 Battery (main?)
BUS        0x7c         48         Northbridge - sensor below and left of Northbridge, bottom of MB
PCM        0x7d         25         PCM/ambient - near VGA 9pin plug (LM75 single temp sensor chip); seems always lowest temp (room temp)
BAT1b      0x7e         31         Battery (ambient) - 0 when battery removed, but doesn't heat up under battery load
BAT2b      0x7f                    (probably) Ultrabay 2000 battery (ambient?)
-          0xc0           0        none of these (below) have any values
-          0xc1           0            "
-          0xc2           0            "
-          0xc3           0            "

Re: Controlling fan under OSX : Is that possible?

Posted: Tue Dec 21, 2010 5:41 pm
by Silencer
Well, if I have TMPx sensors assigned as per the code example above, I get the following picture: http://www.ljplus.ru/img4/s/i/silencers/t60p_temps.png

Re: Controlling fan under OSX : Is that possible?

Posted: Sat Feb 05, 2011 8:02 am
by Great Gatsby
Thank you, Silencer and Sebinouse, for this information! - Sebinouse, could you integrate this into your X60T's package's DSDT?

Re: Controlling fan under OSX : Is that possible?

Posted: Sun Feb 06, 2011 4:46 am
by Sebinouse
It's almost done, I am just gathering more informations about the X61 hack to make the package more relevant ... :wink:

Re: Controlling fan under OSX : Is that possible?

Posted: Mon Feb 07, 2011 12:13 pm
by Great Gatsby
Sebinouse wrote:It's almost done, I am just gathering more informations about the X61 hack to make the package more relevant ... :wink:
Okay, wonderful. - I'm currently experimenting a bit with the ThinkPad 11a/b/g/n Wireless LAN Mini Express Adapter, the one I wrote about earlier in the X60T thread. I ordered myself one on eBay and have meanwhile build it into my X60 Tablet replacing the "driverless" Intel 3945abg miniPCI card with draft n-WLAN (more on that to come in the X60T thread, too, when I have the time). It works quite well using Apple's own Atheros drivers and your Legacy Kext, but seems to be quite a "heater", though, more on Snow Leopard than on Windows. - So, to cut a long story short: Having some sort of access to controlling the ThinkPad's fan under Snow Leopard would be really appreciated at the moment ... ;-)

Re: Controlling fan under OSX : Is that possible?

Posted: Mon Feb 07, 2011 4:31 pm
by Sebinouse
You just have to copy this DSDT.aml in /E, the kexts in /E/E, repair permissions and install istat 2.0 :

http://www.mediafire.com/?uyi89lkbepd4pvs

http://mac.brothersoft.com/istat-menus-2.0.html

Re: Controlling fan under OSX : Is that possible?

Posted: Tue Feb 08, 2011 12:24 pm
by Great Gatsby
Sebinouse wrote:You just have to copy this DSDT.aml in /E, the kexts in /E/E, repair permissions and install istat 2.0 :
Thank you! I tried it - and it works sans problème with my X60T. Here's a screenshot:

Image

Both CPU cores are usually around 55° C, CPU Heatsink has produced temperatures between 65° C and 72° C so far (quite high - is that normal?), Northbridge seems to stay permanently at 28° C (is there a sensor for that at all?). SystemFan is at ~ 2500 rpm, but I've seen it up to 4200 rpm when I did more CPU consuming activity (HD playback etc.). And, as you can see, I recently exchanged my Samsung HD for a 750 GB WD Scorpio Blue ... :-)

Re: Controlling fan under OSX : Is that possible?

Posted: Mon Mar 07, 2011 8:42 am
by mightycrown
Hi
Thanks for the hard work, now i can control my Fan.
However regarding the sensors, We do not have Offsect (0xc0) Under Device (EC). just wondering if it is possible to add them back to our DSDT. However i do not know their names. I think c1 is for PCI, c0 for North bridge. C2 for chipset.

Edit: Assigning them as TMP8 TMP9 and TMP0A offset (0xc0). i got 2 more readings, but not sure what they are , probably Northbridge or something

Re: Controlling fan under OSX : Is that possible?

Posted: Thu Nov 17, 2011 4:47 pm
by bkribbs
Hey! You guys look like you've done well! I've installed Lion on a HP Probook 4530s, and am trying to get fan control similar to this:

Code: Select all

Device (SMCD) // System Monitor and Controll Device
             {
                  Name (_HID, "monitor") // Driver will look for this in order to load or not
                  Method (FAN0, 0, NotSerialized) // ACPIMonitor FAN 0 Speed
                  {
                      Store (\_SB.PCI0.LPC.EC.HFN1, Local0) // Store FAN 0 Control to Local0
                      Return (Local0)
                  }
                  Method (TSYS, 0, NotSerialized) // ACPIMonitor - GPU Temperature as Northbridge (T60p)
                  {
                      Store (\_SB.PCI0.LPC.EC.TMP3, Local0)
                      Return (Local0)
                  }
                  Method (TAMB, 0, NotSerialized) // ACPIMonitor - Temperature
                  {
                      Store (\_SB.PCI0.LPC.EC.TMP2, Local0)
                      Return (Local0)
                  }
                  Method (TDIM, 0, NotSerialized) // ACPIMonitor - Most Probably Battery Temperature as Memory Controller (T60p)
                  {
                      Store (\_SB.PCI0.LPC.EC.TMP6, Local0)
                      Return (Local0)
                  }
               Method (TCPU, 0, NotSerialized) // Fan Mode Accordind CPU Heatsink Temperature
               {
                  Store (\_SB.PCI0.LPC.EC.TMP0, Local0)
                  If (LLessEqual (Local0, 0x32))  // CPU Temp is <= 50C
                  {
                     Store (Zero, \_SB.PCI0.LPC.EC.HFSP) // Set FAN Off
                  }
                  If (LGreaterEqual (Local0, 0x55)) // CPU Temp is >= 85C
                  {
                     Store (0x40, \_SB.PCI0.LPC.EC.HFSP) // Set FAN Mode Disengaged - Absolute Maximum
                  }
                  Else {
                     If (LGreaterEqual (Local0, 0x4B)) // CPU Temp is >= 75C
                     {
                        Store (0x07, \_SB.PCI0.LPC.EC.HFSP) // Set FAN Mode 7 - Maximum Speed
                     }
                     Else {
                        If (LGreaterEqual (Local0, 0x46)) // CPU Temp is >= 70C
                        {
                           Store (0x04, \_SB.PCI0.LPC.EC.HFSP) // Set FAN Mode 4 - Medium Speed 
                        }
                        Else {
                           If (LGreaterEqual (Local0, 0x41)) // CPU Temp is >= 65C
                           {
                              Store (0x02, \_SB.PCI0.LPC.EC.HFSP) // Set FAN Mode 2
                           } 
                           Else {
                              If (LGreaterEqual (Local0, 0x3D)) // CPU Temp is >= 61C
                              {
                                 Store (0x01, \_SB.PCI0.LPC.EC.HFSP) // Set FAN Mode 1 - Lowest Speed
                              }
                           }
                        }
                     }
                  }
                  Return (Local0)
               }
      }
I just wanted to ask, did you insert that device under EC?

I have an EC0 which I think is equivalent. But I can't figure out how exactly to do this, and there doesn't appear to be an easy guide out there.

Also, how did you get those values for temperature? Would they be the same on my machine?

Thanks for the help!

Re: Controlling fan under OSX : Is that possible?

Posted: Mon Nov 21, 2011 3:19 am
by Silencer
bkribbs wrote: I just wanted to ask, did you insert that device under EC?
No, you add it at the root level.
bkribbs wrote: Also, how did you get those values for temperature? Would they be the same on my machine?
Since you have an HP machine, most probably code examples from this thread won't work for you. You need to find proper registers for your laptop yourself.

Re: Controlling fan under OSX : Is that possible?

Posted: Thu Nov 24, 2011 12:17 am
by bkribbs
Right. And how would I go about tracking down all of the registers?

Re: Controlling fan under OSX : Is that possible?

Posted: Fri Jan 06, 2012 3:22 pm
by seppdepp
Nice post. There are even people transfering your findings to other thinkpad models (W520 http://www.insanelymac.com/forum/index. ... pic=273621).

I'm right now trying to transfer the DSDT patch to a X121e Thinkpad,
but the DSDT file looks totally different (even different to the W520 mentioned, which is also from 2011).

TPFanControl in Windows works fine. So I suppose the interface should be
the same.

Where would be the position to try patching the X121e's DSDT?

DSDT.aml: http://tonymacx86.com/download/file.php?id=14264 (sry no file upload permission on this forum)

(P.S.: Can someone suggest a good theory tutorial on DSDT and its structure?)

Re: Controlling fan under OSX : Is that possible?

Posted: Mon Jan 14, 2013 3:07 am
by milanas
Hi guys,

I tried on my x61 with Lion, but the fan still cannot be stopped.
However, I can manually stop it through the blue thinkadvange button.
Also I have installed istat, version 4.03, but cannot get the fan speed info.

Re: Controlling fan under OSX : Is that possible?

Posted: Sun Feb 03, 2013 4:25 am
by dragonknight
milanas wrote:Hi guys,

I tried on my x61 with Lion, but the fan still cannot be stopped.
However, I can manually stop it through the blue thinkadvange button.
Also I have installed istat, version 4.03, but cannot get the fan speed info.
I followed the instruction from Anastasius (from here) and have all working fine with istat menus 4.03. You'll need his dsdt and install FakeSMC.kext to get them working.