[E-devel] [PATCH] e17: add thinkpad to temperature module

2011-01-16 Thread Lars Munch
This adds thinkpad support to the temperature module. The temperature is
accessible through the thinkpad_acpi kernel module.

Signed-off-by: Lars Munch l...@segv.dk
---
 src/modules/temperature/e_mod_main_private.h |3 ++-
 src/modules/temperature/tempget.c|9 +
 2 files changed, 11 insertions(+), 1 deletions(-)

diff --git a/src/modules/temperature/e_mod_main_private.h 
b/src/modules/temperature/e_mod_main_private.h
index 626b9bd..7159292 100644
--- a/src/modules/temperature/e_mod_main_private.h
+++ b/src/modules/temperature/e_mod_main_private.h
@@ -11,7 +11,8 @@ typedef enum _Sensor_Type
SENSOR_TYPE_LINUX_ACPI,
SENSOR_TYPE_LINUX_PCI,
SENSOR_TYPE_LINUX_PBOOK,
-   SENSOR_TYPE_LINUX_INTELCORETEMP
+   SENSOR_TYPE_LINUX_INTELCORETEMP,
+   SENSOR_TYPE_LINUX_THINKPAD
 } Sensor_Type;
 
 #endif
diff --git a/src/modules/temperature/tempget.c 
b/src/modules/temperature/tempget.c
index b98b6ab..99495a3 100644
--- a/src/modules/temperature/tempget.c
+++ b/src/modules/temperature/tempget.c
@@ -125,6 +125,11 @@ init(void)
  sensor_type = SENSOR_TYPE_LINUX_INTELCORETEMP;
  sensor_name = strdup(dummy);
   }
+ else if 
(ecore_file_exists(/sys/devices/platform/thinkpad_hwmon/temp1_input))
+   {
+  sensor_type = SENSOR_TYPE_LINUX_THINKPAD;
+  sensor_name = strdup(dummy);
+   }
 else
   {
  // try the i2c bus
@@ -217,6 +222,9 @@ init(void)
   case SENSOR_TYPE_LINUX_INTELCORETEMP:
 sensor_path = 
strdup(/sys/devices/platform/coretemp.0/temp1_input);
 break;
+  case SENSOR_TYPE_LINUX_THINKPAD:
+sensor_path = 
strdup(/sys/devices/platform/thinkpad_hwmon/temp1_input);
+break;
   case SENSOR_TYPE_LINUX_I2C:
 therms = ecore_file_ls(/sys/bus/i2c/devices);
 
@@ -330,6 +338,7 @@ check(void)
break;
   case SENSOR_TYPE_LINUX_INTELCORETEMP:
   case SENSOR_TYPE_LINUX_I2C:
+  case SENSOR_TYPE_LINUX_THINKPAD:
f = fopen(sensor_path, r);
if (f)
  {
-- 
1.7.2.3


--
Protect Your Site and Customers from Malware Attacks
Learn about various malware tactics and how to avoid them. Understand 
malware threats, the impact they can have on your business, and how you 
can protect your company and customers by using code signing.
http://p.sf.net/sfu/oracle-sfdevnl
___
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel


Re: [E-devel] [PATCH] e17: add thinkpad to temperature module

2011-01-16 Thread Mike Blumenkrantz
On Sun, 16 Jan 2011 13:51:56 +0100
Lars Munch l...@segv.dk wrote:

 This adds thinkpad support to the temperature module. The temperature is
 accessible through the thinkpad_acpi kernel module.
 
 Signed-off-by: Lars Munch l...@segv.dk
in

-- 
Mike Blumenkrantz
Zentific: NULL pointer dereferences now 50% off!

--
Protect Your Site and Customers from Malware Attacks
Learn about various malware tactics and how to avoid them. Understand 
malware threats, the impact they can have on your business, and how you 
can protect your company and customers by using code signing.
http://p.sf.net/sfu/oracle-sfdevnl
___
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel