On 11/8/24 04:05, Werner Sembach wrote:
Hi everyone, I'm currently conceptualizing an upstream implementation for the fan control on our Sirius 16 Gen 1 & 2 devices which has the following custom WMI functions (pseudo code): void SMOD(bool mode): Toggle firmware controlled fans vs manually (aka via the commands below) controlled fans bool GMOD(): Get current SMOD setting int GCNT(): Get number of fans enum GTYP(int index): Returns "CPU-fan" or "GPU-fan" void SSPD(int index, int value): Set fan speed target as a fraction of max speed int GSPD(int index): Get current fan speed target as a fraction of max speed int GRPM(int index): Get current actual fan speed in revolutions per minute int GTMP(int index): Get temperature of thing fan with respective index is pointed at (CPU or GPU die, see GTYP) However there are some physical limitations that are not in the firmware and I would like to implement as low as possible in software, aka the driver, to avoid hardware damage: 1. Valid fan speeds are 0% (fan off) and 25-100%. Values from 1%-24% must not be written. 2. As long as GTMP is > 80°C fan speed must be at least 30%. We would love to see the same driver enforced restrictions in the Uniwil driver Armin is working on and the Clevo driver Juno Computers is working on. My Idea so far: 1. Round SSPD input: 0-12% -> 0%, 13-25% -> 25%
That is acceptable.
2. Periodically check GTMP (every second should be enough) in driver and if the temperature is over 80°C set current and incoming speed commands to at at least 30%. Is this legitimate with the hwmon design?
No. That would have to utilize the thermal subsystem. hwmon is not intended to _control_ the environment, only to monitor it.
Second question: Is there a good way to implement a userspace controlled switch between auto and manual mode?
Only if that is a direction to the chip to switch between modes. Thanks, Guenter