Thermal zone driver available

Post Reply
prj
Posts: 90
Joined: Tue May 12, 2009 9:13 am

Thermal zone driver available

Post by prj »

I've written a thermal zone driver based on the script from Irads. It hooks into the thermal sys-if and the hwmon sys-if (if included in kernel). I think this is all that is needed to get the sensors showing up in gkrellm and sensors-applet (though I haven't tried it myself).

You can get it by doing

Code: Select all

git clone git://github.com/patjak/fitpc2_tz
You need the kernel headers and build-tools installed to compile. Test it on your systems and tell me if it works.

Edit: This driver is written for the 2.6.31 kernel (might also work for newer releases). Irads or Denis, please move it into 9.10 forum.

Cheers
Last edited by prj on Wed Mar 24, 2010 9:53 pm, edited 2 times in total.

morgad
Posts: 17
Joined: Thu Oct 15, 2009 8:13 pm

Re: Thermal zone driver available

Post by morgad »

did not work for me -

Code: Select all

fit@ubuntu-fitpc2:~/thermal-zone/fitpc2_tz$ make
make -C /lib/modules/2.6.24-34-fitpc2/build M=/home/fit/thermal-zone/fitpc2_tz
make[1]: Entering directory `/usr/src/linux-headers-2.6.24-34-fitpc2'
  LD      /home/fit/thermal-zone/fitpc2_tz/built-in.o
  CC [M]  /home/fit/thermal-zone/fitpc2_tz/fitpc2_tz.o
/home/fit/thermal-zone/fitpc2_tz/fitpc2_tz.c: In function ‘get_temp’:
/home/fit/thermal-zone/fitpc2_tz/fitpc2_tz.c:98: error: implicit declaration of function ‘msleep’
/home/fit/thermal-zone/fitpc2_tz/fitpc2_tz.c: At top level:
/home/fit/thermal-zone/fitpc2_tz/fitpc2_tz.c:130: warning: ‘enum thermal_trip_type’ declared inside parameter list
/home/fit/thermal-zone/fitpc2_tz/fitpc2_tz.c:130: warning: its scope is only this definition or declaration, which is probably not what you want
/home/fit/thermal-zone/fitpc2_tz/fitpc2_tz.c: In function ‘get_trip_type’:
/home/fit/thermal-zone/fitpc2_tz/fitpc2_tz.c:133: error: dereferencing pointer to incomplete type
/home/fit/thermal-zone/fitpc2_tz/fitpc2_tz.c:133: error: ‘THERMAL_TRIP_ACTIVE’ undeclared (first use in this function)
/home/fit/thermal-zone/fitpc2_tz/fitpc2_tz.c:133: error: (Each undeclared identifier is reported only once
/home/fit/thermal-zone/fitpc2_tz/fitpc2_tz.c:133: error: for each function it appears in.)
/home/fit/thermal-zone/fitpc2_tz/fitpc2_tz.c: At top level:
/home/fit/thermal-zone/fitpc2_tz/fitpc2_tz.c:148: warning: initialisation from incompatible pointer type
/home/fit/thermal-zone/fitpc2_tz/fitpc2_tz.c:149: error: unknown field ‘get_crit_temp’ specified in initialiser
/home/fit/thermal-zone/fitpc2_tz/fitpc2_tz.c:149: warning: initialisation from incompatible pointer type
/home/fit/thermal-zone/fitpc2_tz/fitpc2_tz.c:150: warning: initialisation from incompatible pointer type
/home/fit/thermal-zone/fitpc2_tz/fitpc2_tz.c:151: warning: initialisation from incompatible pointer type
/home/fit/thermal-zone/fitpc2_tz/fitpc2_tz.c: In function ‘fitpc2_init’:
/home/fit/thermal-zone/fitpc2_tz/fitpc2_tz.c:172: error: too many arguments to function ‘thermal_zone_device_register’
/home/fit/thermal-zone/fitpc2_tz/fitpc2_tz.c:177: error: too many arguments to function ‘thermal_zone_device_register’
make[2]: *** [/home/fit/thermal-zone/fitpc2_tz/fitpc2_tz.o] Error 1
make[1]: *** [_module_/home/fit/thermal-zone/fitpc2_tz] Error 2
make[1]: Leaving directory `/usr/src/linux-headers-2.6.24-34-fitpc2'
make: *** [all] Error 2
fit@ubuntu-fitpc2:~/thermal-zone/fitpc2_tz$ uname -a
Linux ubuntu-fitpc2 2.6.24-34-fitpc2 #1 PREEMPT RT Tue Sep 29 17:21:05 IST 2009 i686 GNU/Linux
have I done something stupid?

Dave

prj
Posts: 90
Joined: Tue May 12, 2009 9:13 am

Re: Thermal zone driver available

Post by prj »

Sorry, forgot to mention that it's for the 2.6.31 kernel. I'm using it on a vanilla 9.10 server install. I can backport it to 8.04 if there is enough interest.

MikeMc
Posts: 1
Joined: Thu Apr 08, 2010 9:26 pm

Re: Thermal zone driver available

Post by MikeMc »

Patrik - thanks for the driver (which compiles fine) but can you provide a little more info on how to use it? I built the module and then used "insmod fitpc2_tz.ko" but now what? If I look at /proc/acpi/thermal_zone/TZ00/temperature it shows 0 deg. I did change /proc/acpi/thermal_zone/TZ00/polling_frequency to 30 sec. I am missing something?

prj
Posts: 90
Joined: Tue May 12, 2009 9:13 am

Re: Thermal zone driver available

Post by prj »

Hi MikeMC, you can read the new sensors in /sys/class/thermal/thermal[2:3]/ and also in /sys/class/hwmon/hwmon[1:2]/

Output from my system:

Code: Select all

patrik@patrik-server:~$ cat /sys/class/thermal/thermal_zone2/temp
56
patrik@patrik-server:~$ cat /sys/class/thermal/thermal_zone3/temp
53

pie86
Posts: 7
Joined: Sun Dec 20, 2009 10:12 am

Re: Thermal zone driver available

Post by pie86 »

works great on 2.6.33 kernel!thank you!

Post Reply

Return to “Linux on fit-PC2”