linux-surface / kernel

Linux kernel with modifications for Microsoft Surface devices.
Other
118 stars 33 forks source link

Platform profile: switch fan profile #145

Closed iwanders closed 6 months ago

iwanders commented 8 months ago

Followup from https://github.com/linux-surface/kernel/pull/144 that adds support to switch the fan profile whenever the platform profile is switched.

Values recorded with IRPMon as sent to the FAN together with the numbers sent to the TMP module:

2023-12-16 6:54:41 PM   Seq OUT TMP:03 t01 i00 c 0x03 (  4): 01 00 00 00 
2023-12-16 6:54:41 PM   Seq OUT FAN:05 t01 i01 c 0x0e (  1): 02 

2023-12-16 6:54:45 PM   Seq OUT TMP:03 t01 i00 c 0x03 (  4): 02 00 00 00 
2023-12-16 6:54:45 PM   Seq OUT FAN:05 t01 i01 c 0x0e (  1): 01 

2023-12-16 6:54:30 PM   Seq OUT TMP:03 t01 i00 c 0x03 (  4): 03 00 00 00 
2023-12-16 6:54:30 PM   Seq OUT FAN:05 t01 i01 c 0x0e (  1): 03 

2023-12-16 6:54:33 PM   Seq OUT TMP:03 t01 i00 c 0x03 (  4): 04 00 00 00 
2023-12-16 6:54:33 PM   Seq OUT FAN:05 t01 i01 c 0x0e (  1): 04 

I've confirmed the changes in this PR using the following methodology;

This obtains us the following fan curves:

comparison

We clearly get 4 different fan max speeds, with performance as the highest level.

iwanders commented 8 months ago

I've marked this as ready for review. I cleaned up some comments here and there, and renamed the node in the registry. I've also squashed the commits and put a reasonable commit message / title on it.

qzed commented 6 months ago

@StollD if you have some time, feel free to merge this and add it to the patches. Otherwise I'll try to make some time, but I'm not sure I can get to much before March 15th.

iwanders commented 6 months ago

Upstream lore entry for v1.

StollD commented 6 months ago

I cherry-picked this to our 6.6 and 6.7 branches. Thank you!