Fan.cs - Feature/update EC when needed (ramping up cycle); Config: Thinkpad E570 #1228
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I added config for Lenovo ThinkPad E570, where 100% of the target fan speed is really some "special" full fan speed (also really loud). This is only enabled for critical temperature. Without this, this fan has only 5 speed modes (0x01, 0x02, 0x03, 0x04, 0x05) written to 0x2F EC. The special fast+loud one is 0x40.
Another thing that I noticed is the constant ramping up cycle on my laptop - everytime when the EcPollInterval started with checking up the temperature and setting the value in EC, fan stops for a moment and starts again with the desired fan speed. The problem is with the constant writing to EC, which somehow resets or reinitializes fan. I think the same behavior is described in #925.
I added a few lines to the Fan.cs, so that writing to EC happens only when needed (when the change in target speed actually happens). This stops constant fan ramping up after EcPollInterval, but still when the change in target speed happens, it resets the fan for a moment. Maybe its not the best solution, but it better than torturing the fan with constant on-ing and off-ing.