Some of you have used the ECView leaked somewhere or my ClevoECView without knowing how it works actually, now I finally decoded the code and commands sent to EC for fan query and control, for using Linux on my laptop.
If you're on Linux, fanctrl.c is an utility to query and control the CPU fan speed (no auto option; auto is broken anyway), based on some fan-control program for MSI laptop. I'll make an Ubuntu indicator later and maybe write a new auto-control algorithm.
If you're interested in the code/commands, see ec-trace.txt, which contains the information I gathered by disassembling ecview.dll. If you want to do it itself, the functions in ecview.dll are just doing write/read to io ports, code 80h is READ, 66h is EC_SC (send command) and 62h is EC_DATA (send parameters or read back). There isn't much more left to decode though as ecview.dll provides only a small part of functionality to the official ECView program, the rest is in WMI drivers.
On Linux you could read EC registers by loading ec_sys module and then read debug information on filesystem, like:
The D0 D1 are exactly the the same D0/D1 representing fan speed in fanctrl.c. Writing also works with write_support=1 option to ec_sys but seems to have no effect.Code:od -Ax -t x1 /sys/kernel/debug/ec/ec0/io
-
The control indicator for Ubuntu is completed! See github.
rwx, Dennismungai, Exec360 and 3 others like this.
Clevo fan control code & Linux utility
Discussion in 'Sager and Clevo' started by aqd, Jan 30, 2016.